Configuring Port-Based VLANs on Device-A

Enter the following commands to configure Device-A (as shown in More Complex Port-Based VLAN).
  1. Enable the privileged EXEC mode and enter the global configuration command.
    device# enable
    device# configure terminal
  2. Enter the device name.
    device(config)# hostname device-A
  3. Configure a VLAN by assigning an ID to the VLAN and name it.
    device-A(config)# vlan 2 name BROWN
  4. Configure VLAN 2 by port.
    device-A(config-vlan-2)# vlan 2 by port
    
  5. Configure the following ports as untagged member of VLAN 2.
    device-A(config-vlan-2)# untagged ethernet 1/1/1 to 1/1/4 ethernet 1/1/17
  6. If ports are not a member of the specified VLAN, then add the ports as a tagged member of that VLAN.
    device-A(config-vlan-2)# tagged ethernet 1/1/25 to 1/1/26
  7. Enable STP using the spanning-tree command.
    device-A(config-vlan-2)# spanning-tree
  8. Follow the same steps for other VLANs with the addition of changing the port priority for VLAN 4 and VLAN 5.
    device-A(config-vlan-2)# vlan 3 name GREEN
    device-A(config-vlan-3)# vlan 3 by port
    device-A(config-vlan-3)# untagged ethernet 1/1/5 to 1/1/8 ethernet 1/1/18
    device-A(config-vlan-3)# tagged ethernet 1/1/25 to 1/1/26
    device-A(config-vlan-3)# spanning-tree
    device-A(config-vlan-3)# vlan 4 name BLUE
    device-A(config-vlan-4)# vlan 4 by port
    device-A(config-vlan-4)# untagged ethernet 1/1/9 to 1/1/12 ethernet 1/1/19
    device-A(config-vlan-4)# tagged ethernet 1/1/25 to 1/1/26
    device-A(config-vlan-4)# spanning-tree
    device-A(config-vlan-4)# spanning-tree priority 500
    device-A(config-vlan-4)# vlan 5 name RED
    device-A(config-vlan-5)# vlan 5 by port
    device-A(config-vlan-5)# untagged ethernet 1/1/13 to 1/1/16 ethernet 1/1/20
    device-A(config-vlan-5)# tagged ethernet 1/1/25 to 1/1/26
    device-A(config-vlan-5)# spanning-tree
    device-A(config-vlan-5)# spanning-tree priority 500
    device-A(config-vlan-5)# end
    device-A# write memory