70
802.1q VLAN Configuration Example
1. Create 802.1q VLAN IDs
Switch(config)# interface 1-22
Enter port 1 to port 22
’s interface
mode.
Switch(config-if-1-22)# vlan dot1q-vlan trunk-
vlan 10, 20
Set port 1 to port 22
’s Trunk-VLAN ID
(VID) to 10 and 20.
Switch(config-if-1-22)# vlan dot1q-vlan mode
trunk
Set the selected ports to Trunk Mode
(tagged).
Switch(config-if-1-22)#exit
Exit current ports interface mode
Switch(config)# interface 23-44
Enter port 23 to port 44
’s interface
mode.
Switch(config-if-23-44)# vlan dot1q-vlan
access-vlan 50
Set port 23 to port 44
’s Access-VLAN
ID (PVID) to 50.
Switch(config-if-23-44)# vlan dot1q-vlan trunk-
vlan 30,40
Set port 23 to port 44
’s Trunk-VLAN
ID (VID) to 30 and 40.
Switch(config-if-23-44)# vlan dot1q-vlan mode
trunk native
Set the selected ports to Trunk-native
Mode (tagged and untagged).
Switch(config-if-1-4)#exit
Exit current ports interface mode
Switch(config)# interface 45-46
Enter port 45 to port 46
’s interface
mode.
Switch(config-if-45-46)# vlan dot1q-vlan
access-vlan 60
Set port 45 to port 46
’s Access-VLAN
ID (PVID) to 60.
Switch(config-if-45-46)# vlan dot1q-vlan mode
access
Set the selected ports to Access Mode
(untagged).
Switch(config-if-45-46)#exit
Exit current ports interface mode
Switch(config)# interface 47-48
Enter port 47 to port 48
’s interface
mode.
Switch(config-if-47-48)# vlan dot1q-vlan
access-vlan 70
Set port 47 to port 48
’s Access-VLAN
ID (PVID) to 70.
Switch(config-if-47-48)# vlan dot1q-vlan mode
access
Set the selected ports to Access Mode
(untagged).
Switch(config-if-47-48)#exit
Exit current ports interface mode
2. Modify 802.1q VLAN IDs
’ names.
Switch(config)# vlan dot1q-vlan 10, 20
Enter VLAN 10,20