We could confirm which ports are trunking on our switches
likes an example going to the switch 1
and typing sh interfaces trunk as you can see here
the command sh interfaces trunk shows me that gigabit 0/0 1, 2, and 3
are set on for trunking using 802.1Q
the status is trunking and the native VLAN is VLAN 1.
The VLANs allowed across those ports are VLANs 1 to 4094
in other words, we’ve allowed all VLANs
the VLANs currently allowed and active in the management domain of 1, 10, and 20
VLANs in the Spanning Tree forwarding state not pruned of 1, 10, and 20
we'll talk about Spanning Tree in a moment
but this port is the only port that is forwarding traffic across it
because port 1 and 2 are currently blocked as shown here
because port 1, 2 and 3 are currently blocked through Spanning Tree
sh spanning-tree as an example
shows me that those ports are blocking
This port is not a trunk port, this is an access port.
So sh int trunk
shows me in a nice simple format which interfaces
are configured for trunking, which encapsulation is used
and which ports are forwarding for which VLANs.
Let’s have a look at switch 2 as an example
on switch 2 sh int trunk port g0/0, g0/1, g0/2, and g0/3
so these interfaces are trunking, the mode is on
we're not using DTP, encapsulation is dot1q, status is trunking
native VLAN is VLAN 1
the VLANs allowed across those ports are 1 - 4094
currently the VLANs allowed and active
in the management domain are 1, 10, and 20
VLANs in Spanning Tree forwarding state
are not pruned are 1, 10, and 20 across all the ports.
At the moment sh vlan brief shows me
that I only have VLAN 1, 10, and 20 configured on the switch
and hence the switch is forwarding those VLANs across those ports
1, 10, and 20 is forwarded across port gigabit 0 1 2 and 3.
Spanning Tree is not blocking any of these ports
and I can see that by typing sh spanning-tree
as you can see here all those ports are forwarding
and they are designated ports
because the switch is the root switch
whereas on switch 1 once again sh spanning-tree shows me
that the switch is not the root bridge or root switch of the Spanning Tree
these ports 1, 2, and 3, so 1, 2, and 3 are blocking
sh int trunk
shows me that those ports are trunk ports
but only gigabit 0/0 is forwarding VLANs 1, 10, and 20 across it.
So sh int is trunk is a very useful command
to see a summary of your trunks.