Cisco ICND2 – Configure, verify, and troubleshoot trunking on Cisco switches

Configuring a trunk:

When configuring a trunk, the trunk needs to be enabled on both switches. We will configure fa0/1 as a trunk link on both Switch A and Switch B. I will be doing this via Cisco’s packet tracer program on two Cisco 2950 switches.

By default all VLANs are allowed to be received and sent across trunk links, this can be changed and will be discussed later on.

Trunk_SwitchA_SwitchB

Switch A:

configure terminal
interface fa0/1
switchport mode trunk

Switch B:

configure terminal
interface fa0/1
switchport mode trunk

That’s it!

Configuring trunk on a layer 3 switch is slightly different, you have the choice of either using 802.1Q (dot1q) or ISL as the encapsulation.  Newer routers don’t support ISL so It would be wise to use 802.1Q.

configure terminal
int fa0/1
switchport mode trunk
switchport trunk encapsulation dot1q

It is possible to do a range of interfaces to turn them into trunk links:

configure terminal
interface range fa0/1-fa0/5
switchport mode trunk

We can restrict or allow which VLANs are allowed across a trunk link using the trunk allowed command. To configure allowed VLANs make sure you’re under the interface where the trunk is enabled such as interface fa0/1.

This will reset the trunk to default allowing all VLANs across the trunk:

switchport trunk allowed vlan all

This will stop VLANs 2 through 6 from communicating over the trunk:

switchport trunk allowed vlan remove 2-6

This will allow VLAN 6 to communicate over the trunk if we removed it by mistake:

switchport trunk allowed vlan 6

Verifying a trunk:

There are few commands to verify a trunk link. The first is to run a show running-config on both switches.

show running-config

Switch A:

Trunk_Show_Run_SwitchA

Switch B:

Trunk_Show_Run_SwitchB

As shown above, we can see both the interfaces have been configured for trunking.

The next is to display the switchport information for both interfaces on the switches.

show int fa0/1 switchport

Switch A:Trunk_Show_Switchport_Trunk_SwitchA

Switch B:Trunk_Show_Switchport_Trunk_SwitchBWe can see from this information that the operational mode is trunk and the encapsulaton is dot1q.

Lastly we can display information based on all interfaces that are enabled for trunk and what VLANs are allowed across these trunk links.

show int trunk

Switch A:

Trunk_SwitchA_Show_Trunk

Switch B:

Trunk_SwitchB_Show_Trunk

Troubleshooting a trunk:

  • Make sure trunk is enabled on both connecting sides of the interfaces
  • Ensure the encapsulation at both ends meet
  • Check the cable is connected and the correct type of cable is used
  • Check to see whether any restrictions are on the trunk that are preventing a VLAN across the link (show int trunk)
  • Frederic Yesid Pena Sanchez

    I’ve setup trunking using Fiber, bu fiber shows plain-red and not dashed-black as your schema, it’s fine???