Arista EOS Configuration Cheat Sheet: Essential CLI Commands - 夜莺博客

Arista EOS Configuration Cheat Sheet: Essential CLI Commands

Arista EOS is a Linux-based network operating system built around programmability, automation and high availability, and its CLI is deliberately modeled on Cisco IOS so network engineers can migrate quickly. This cheat sheet collects the essential EOS configuration commands in one place: system and management setup, VLANs and trunks, port-channels, spanning tree, routing protocols, ACLs, SNMP and monitoring - each with a minimal working example.

Arista EOS CLI navigation cheat sheet

Basic System Configuration

switch> enable
switch# configure terminal
switch(config)# hostname switch-1
switch(config)# enable secret <password>
switch(config)# username admin privilege 15 secret <password>
switch(config)# ip domain-name network.arista.com
switch(config)# management ssh idle-timeout 5 no shutdown

VLAN and Interface Configuration

switch(config)# vlan 10 name wireless
switch(config)# interface Ethernet1
switch(config-if-Et1)# switchport mode access
switch(config-if-Et1)# switchport access vlan 10

! trunk with non-default native VLAN
switch(config)# interface Ethernet1/1
switch(config-if-Et1/1)# switchport mode trunk
switch(config-if-Et1/1)# switchport trunk native vlan 999
switch(config-if-Et1/1)# switchport trunk allowed vlan 10-12

! LACP port-channel
switch(config)# interface Ethernet 1-2
switch(config-if-Et1-2)# channel-group 1 mode active
switch(config)# interface port-channel 1
switch(config-if-Po1)# switchport mode trunk
switch(config-if-Po1)# switchport trunk allowed vlan 10-12

! SVI
switch(config)# interface vlan 10
switch(config-if-Vl10)# ip address 172.16.1.1/24
switch(config-if-Vl10)# no shutdown

Spanning Tree and Port Security

switch(config)# spanning-tree mode rapid-pvst
switch(config)# interface Ethernet1/1
switch(config-if-Et1/1)# switchport mode access
switch(config-if-Et1/1)# spanning-tree portfast
switch(config-if-Et1/1)# spanning-tree bpduguard enable
switch(config)# interface Ethernet1
switch(config-if-Et1)# switchport port-security
switch(config-if-Et1)# switchport port-security maximum 1

Routing Configuration

! static routes
switch(config)# ip route 172.16.1.0/24 172.16.2.1
switch(config)# ip route 0.0.0.0/0 172.33.1.2

! OSPF
switch(config)# router ospf 1
switch(config-router-ospf)# router-id 172.16.255.1
switch(config-router-ospf)# network 192.168.0.0/16 area 0

! eBGP
switch(config)# router bgp 65001
switch(config-router-bgp)# neighbor 192.168.1.2 remote-as 65000
switch(config-router-bgp)# network 192.168.1.0/24

Management and Monitoring

switch(config)# snmp-server community arista ro
switch(config)# snmp-server group <group> v3 priv
switch(config)# logging host 192.168.3.1
switch(config)# ntp server 172.16.1.1 prefer
switch(config)# aaa authentication login default group tacacs+ local

ACL Configuration

switch(config)# ip access-list extended HTTPS-FILTER
switch(config-acl-HTTPS-FILTER)# permit tcp 192.168.1.0/24 any eq 443
switch(config-acl-HTTPS-FILTER)# deny tcp 192.168.1.0/24 any eq 23
switch(config-acl-HTTPS-FILTER)# permit ip any any
switch(config)# interface Ethernet1/1
switch(config-if-Et1/1)# ip access-group HTTPS-FILTER in

EOS Configuration Notes

  • Interface naming uses Ethernet (Et1, Et49) without speed.
  • CIDR format (/24) is used for addressing, SVIs and routing protocols.
  • EOS supports STP, RSTP, MSTP and PVRST; VRRP replaces HSRP.
  • No DTP, no VTP - trunks and VLANs are configured explicitly.
  • Verify trunking with show interfaces switchport.
  • Use show running-config include hostname and show interfaces json for automation-friendly output.

Related articles: How to manage VLANs on Arista EOS, SONiC CLI cheat sheet, and Port mirroring on Cisco, Huawei and Arista.

原文链接:https://www.cisconetsolutions.com/arista-eos-configuration-cheat-sheet/