What are Trunk Links? Common Problem and Troubleshooting
Trunk links are a common problem that mostly occurs due to incorrect configurations. Troubleshooting trunk links problems is a common task in networking. If a problem with a trunk is found and the cause is unknown, first, check the trunks for a native VLAN mismatch.
If the native VLAN is correct, then check for trunk mode mismatches and, lastly, check for the allowed VLAN list on the trunk. The following types of errors generally occur when configuring the trunk links.
Native VLAN mismatches on Trunk links.
Sometimes a port of the switch behaves like a trunk even if it is not configured as a trunk. If an access port accepts frames from VLANs different from the VLAN to which it is assigned, this is called VLAN leaking. To troubleshoot VLAN leaking in the local and peer VLAN matching, use the show interfaces trunk command. VLAN leaking occurs if the native VLAN is not the same on both sides.
Trunk link ports of both sides configured with different native VLANs are known as native VLAN mismatches. The native VLAN mismatches affect inter-VLAN routing, among other problems. This is also a security risk. The CDP displays a console notification message of a native VLAN mismatch.
Figure 1 illustrates the console notification of a native VLAN mismatch. For example, Figure 1 shows that the native VLAN on one side of the trunk link is VLAN 1, and the other side is VLAN 30. A frame sent from VLAN 1 on one side is received on VLAN 30 on the other side, and VLAN 1 leaks into the VLAN 30 segment.
So, static configuration of trunk links is the best practice ever. Cisco Catalyst switches attempt to negotiate a trunk link by default. Use the show interfaces trunk command to display the status of the trunk and the native VLAN used on that trunk link, and verify trunk establishment. Figure 2 illustrates the output of the show interfaces trunk command on Sw-2.
If the native VLAN mismatch occurs, the connectivity issues start in the network. So, the data traffic for other VLANs, except native VLANs, will successfully propagate across the network. Native VLAN mismatch doesn’t keep trunk establishment. The administrator can easily re-configure native VLAN on both sides of the link.
Trunk Mode Mismatches and Wrong VLAN allowed List
Normally switchport mode trunk command is used to configure trunk links. The Cisco Catalyst switch uses DTP to negotiate the state of the trunk link. When a statically configured trunk port on a trunk link is incompatible with the neighboring trunk port, a trunk link fails to form between the two switches.
Figure 3 illustrates that PC-2 and PC-3 can communicate with each other but cannot communicate with PC-4. The topology indicates a valid configuration. But why can PC-2 and PC3 not connect to PC-4? Use the show interfaces trunk command to check the status of the trunk ports on both switches.
The output shown in Figure 4 reveals that interface Gig0/1 on Sw-1 is in dynamic auto mode, and only VLAN 20 is allowed on the trunk link. Gig0/2 is also in dynamic auto mode. Therefore, PCs of VLAN 20 on Sw-1 cannot communicate with PCs of VLAN-20 on Sw-2. Figure 5 illustrates the show interface trunk output of Sw-2, where all VLANs are allowed.
To resolve this problem, manually configure the trunk mode on Fa0/1 ports on Sw-1 and allow all VLANs with the interface mode command “switchport trunk allowed vlan all” or “switchport trunk allowed vlan vlan-id” .
After the configuration change, the output of the show interfaces command on Sw-1 indicates in figure 6 that port Gig0/1 is now in trunking mode, and all VLANs are now allowed to the trunk. Now, all PCs can communicate with each other on both switches.