Arista EOS VLAN, Trunk and Port-Channel Configuration Guide - 夜莺博客

Arista EOS VLAN, Trunk and Port-Channel Configuration Guide

Arista EOS is a Linux-based network operating system whose CLI feels familiar to Cisco engineers — but the differences matter where it counts: trunk-group VLAN pruning, session-based config with rollback, and JSON output for automation. This cheat sheet collects the EOS commands you reach for most often in daily operations — VLANs, trunks, port-channels, security features, routing and verification — as a quick reference for engineers managing Arista switches in data centers.

Basic Management Setup

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

VLANs, Access and Trunk Ports

switch(config)# vlan 10
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
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

Note the EOS idiom for restricting VLANs: switchport trunk allowed vlan none followed by switchport trunk allowed vlan add 10-12 — EOS does not use the Cisco "allowed vlan remove" syntax.

Port-Channels and LACP

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

Security and STP Enhancements

switch(config)# spanning-tree mode rapid-pvst
switch(config)# interface Ethernet1/1
switch(config-if-Et1/1)# spanning-tree portfast
switch(config-if-Et1/1)# spanning-tree bpduguard enable
switch(config)# ip dhcp snooping
switch(config)# ip dhcp snooping vlan 10
switch(config)# ip arp inspection
switch(config)# ip arp inspection vlan 10

Routing Basics

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
switch(config)# interface Ethernet1
switch(config-if-Et1)# no switchport
switch(config-if-Et1)# ip address 192.168.1.1/24

Verification

switch# show interfaces switchport
switch# show running-config | include hostname
switch# show interfaces Ethernet1 json   # structured output for automation

See Arista EOS CLI 模式指南 and Arista EOS MLAG 详解 for MLAG and CLI-mode deep dives on the same platform.

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