Arista EOS VLAN Configuration: Step-by-Step CLI Guide - 夜莺博客

Arista EOS VLAN Configuration: Step-by-Step CLI Guide

Arista EOS switches are everywhere in data centers, and VLAN configuration is the first thing you will do on any new leaf or access switch. The good news: EOS has one of the cleanest VLAN command sets in the industry - no separate switchport mode command is needed, and configuration is instantly verified with a handful of show commands. This step-by-step guide takes you from creating a VLAN all the way to inter-VLAN routing through an SVI, with every CLI command spelled out.

Step 1: Create VLANs

switch# configure terminal
switch(config)# vlan 10
switch(config-vlan-10)# name Sales
switch(config-vlan-10)# exit
switch(config)# vlan 20
switch(config-vlan-20)# name Engineering
switch(config-vlan-20)# exit

EOS creates the VLAN in the VLAN database immediately. You can also create a range: vlan 30-40.

Step 2: Assign an Access Port

switch(config)# interface Ethernet1
switch(config-if-Et1)# switchport access vlan 10
switch(config-if-Et1)# exit

Unlike IOS, EOS infers the port mode from the command - switchport access vlan 10 makes Ethernet1 an access port in VLAN 10. The command switchport mode is not used on EOS.

Step 3: Configure a Trunk Port

switch(config)# interface Ethernet2-3
switch(config-if-Et2-3)# switchport trunk allowed vlan 10,20,30
switch(config-if-Et2-3)# exit

This turns Ethernet2-3 into trunk ports carrying VLANs 10, 20 and 30 tagged. Check the native VLAN with switchport trunk native vlan if needed (default 1).

Step 4: Create an SVI for Inter-VLAN Routing

To route between VLANs on the switch itself, create a VLAN interface and assign an IP:

switch(config)# interface Vlan10
switch(config-if-Vl10)# ip address 10.0.10.1/24
switch(config-if-Vl10)# exit
switch(config)# interface Vlan20
switch(config-if-Vl20)# ip address 10.0.20.1/24
switch(config-if-Vl20)# exit

Enable IP routing globally with ip routing if it is not already on (it is on by default on most EOS platforms).

Step 5: Save the Configuration

switch# write memory
Copy completed successfully.

Verification Commands

switch# show vlan
switch# show vlan id 10
switch# show interfaces switchport
switch# show interface Ethernet1 switchport
switch# show mac address-table vlan 10
switch# show ip interface brief
switch# show ip route vrf default 10.0.20.0

show vlan lists every VLAN with its ports; show interfaces switchport shows access/trunk mode and allowed VLANs for all ports in one table.

Common Mistakes

  • Forgetting write memory - EOS config is lost on reload otherwise.
  • Using switchport mode trunk (IOS habit) - not a valid EOS command.
  • Creating an SVI but forgetting ip routing globally.

Related: Arista EOS VLAN, trunk and port-channel guide and Cisco VLAN and inter-VLAN routing guide.

原文链接:https://www.arista.com/en/support/toi/eos-4-24-2f/15577-vlan-configuration