How to Configure IEEE 802.1q Trunk
A VLAN trunk link carries multiple VLAN traffic between multiple switches unless we restrict the traffic of VLAN manually or dynamically. Port configuration is required at both ends of the physical link with similar sets of commands. The switchport mode trunk command changes port mode permanently to trunking. We can also use DTP for trunking.
Switch port configured as a trunk normally send and receive IEEE 802.1Q VLAN tagged Ethernet frames. In this case, if a switch receives untagged Ethernet frames on its trunk port, they forward the frame to the VLAN configured on the Switch as native VLAN.
Both sides of the trunk link must be configured to be in the same native VLAN. Analyze the following diagram that consists of two switches and two VLANs. The link between the Sw-1 and Sw-2 has been configured as a trunk.
The Cisco IOS switchport trunk native vlan vlan-id command specifies a native VLAN (other than VLAN 1). In the example, VLAN 30 is a native VLAN. The IOS command switchport trunk allowed vlan vlan-list specifies the list of allowed VLANs on the trunk link.
In Figure 2, VLANs 10 and 20 supporting the admin and IT sections of an organization.PC-2, PC-3 and PC-4 are the members of VLAN-10. PC-1, PC-5 and PC-6 are the members of VLAN-20. The GigabitEthernet 0/1 on both switches is configured as a trunk port and forwards traffic for VLANs 10 and 20. VLAN 30 is a native VLAN, and it has no network because it is an unused VLAN.
We have selected Cisco Catalyst 2960 switches which automatically use 802.1Q encapsulation on trunk links. Other switches may need the manual configuration of the encapsulation.
The command for manual encapsulation is switchport trunk encapsulation dot1q. Both ends of a trunk link required the same native VLAN, If 802.1Q trunk configuration is not the same on both sides, Cisco IOS Software reports errors.
Enter Into User Privileged Mode | Sw-1> enable |
Enter Into User Global Configuration Mode | Sw-1# configure terminal |
Inter Into Interface Configuration Mode | Sw-1(config)# interface interface ID |
Configure the Port as Permanent Trunk | Sw-1(config-if)# switchport mode trunk |
Specify a Native VLAN for untagged 802.1Q Trunks | Sw-1(config-if)# switchport trunk native vlan vlan ID |
Specify allowed VLANs | Sw-1(config-if)# switchport trunk native vlan vlan_list |
Return Into Privileged EXEC Mode | Sw-1(config-if)#CTRL+Z or exit and again exit |
Reset 802.1Q Trunk link to Default State
After resetting the trunk to its default state, the trunk allows all VLANs and uses VLAN 1 as the native VLAN. The table below displays the command to reset all trunking configurations of a trunking interface to the default settings.
We can verify the resetting and reconfiguration of the trunk to its default state using show interfaces interface switchport command.
Enter Into User Privileged Mode | Sw-1> enable |
Enter Into User Global Configuration Mode | Sw-1# configure terminal |
Inter Into Interface Configuration Mode | Sw-1(config)# interface interface ID |
Configure the Port as Permanent Trunk | Sw-1(config-if)#no switchport mode trunk |
Specify a Native VLAN for untagged 802.1Q Trunks | Sw-1(config-if)# no switchport trunk native vlan vlan ID |
Specify allowed VLANs | Sw-1(config-if)#no switchport trunk native vlan |
Return Into Privileged EXEC Mode | Sw-1(config-if)#CTRL+Z or exit and again exit |
Verifying Trunk Configuration
We can verify the trunk configuration of the switch port with the show interfaces interface-ID switchport command.