Arista EOS VLAN Configuration: SVIs, Autostate and Trunks - 夜莺博客

Arista EOS VLAN Configuration: SVIs, Autostate and Trunks

Arista EOS keeps the whole VLAN database in the running configuration — there is no separate vlan.dat like classic Cisco IOS — and every VLAN-related feature, from simple access ports to routed SVIs, is configured in the same global database. This guide follows Arista's official EOS user manual section on VLAN configuration commands and focuses on the parts engineers most often get wrong: VLAN interface autostate, SVI lifecycles and dot1q subinterfaces.

Creating and Managing the VLAN Database

Create a single VLAN or a range in one command, name it, suspend it or delete it:

switch# configure terminal
switch(config)# vlan 10
switch(config-vlan-10)# name servers
switch(config-vlan-10)# state active
switch(config-vlan-10)# exit
switch(config)# vlan 20,30,100-200
switch(config)# vlan 40
switch(config-vlan-40)# state suspend
switch(config)# no vlan 40

state suspend blocks traffic on the VLAN without deleting its configuration, which is handy during maintenance windows. Persist everything with write memory, since EOS does not auto-save. Step-by-step VLAN creation for beginners is covered in our Arista EOS VLAN quick start.

VLAN Interfaces (SVIs) and Autostate

Layer 3 VLAN interfaces are created with interface vlan and removed with no interface vlan:

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

By default an SVI only comes up when three conditions are met: the VLAN exists and is active, at least one Layer 2 port in the VLAN is up and in the spanning-tree forwarding state, and the VLAN interface is not administratively shut down. When you need the SVI to stay up regardless of L2 port state — for example on MLAG peer VLANs — disable autostate:

switch(config-if-Vl10)# no autostate
switch(config-if-Vl10)# show autostate

The no autostate form forces the VLAN interface active. Our SVI, trunk and port-channel run book shows SVIs in a full inter-VLAN routing design.

Trunk Ports and Dot1q Subinterfaces

Trunk ports carry multiple tagged VLANs. EOS defaults to allowing all active VLANs, so pruning is an explicit step:

switch(config)# interface Ethernet49
switch(config-if-Et49)# switchport mode trunk
switch(config-if-Et49)# switchport trunk allowed vlan 10,20,30
switch(config-if-Et49)# switchport trunk allowed vlan add 50,60
switch(config-if-Et49)# switchport trunk allowed vlan remove 60
switch(config-if-Et49)# switchport trunk native vlan 999

Always move the native VLAN away from VLAN 1 and keep it consistent on both ends of the trunk. For routed subinterfaces, the encapsulation dot1q vlan command assigns an 802.1Q tag to an Ethernet or port-channel subinterface; traffic ingressing with that tag is directed to the subinterface:

switch(config)# interface Ethernet1.10
switch(config-subif)# encapsulation dot1q vlan 10
switch(config-subif)# ip address 192.168.10.1/24

Verify your work with show vlan, show vlan id 10, show interfaces trunk and show interfaces Ethernet49 switchport. For VLAN security and STP hardening around these ports, see our Arista EOS configuration cheat sheet.

原文链接:https://arista.com/en/um-eos/eos-section-21-4-vlan-configuration-commands