How-to: Configure trunking
A trunk port is a layer 2 port that may carry traffic from multiple VLANs. Trunk ports are mostly used to connect two switches, switch and a router for inter-vlan routing or a server.
Cisco switches support two types of trunking encapsulation protocols as listed below
1- ISL : frames are fully encapsulated with an ISL header before being sent on the trunk link.
2- IEEE 802.1Q (standard): frames are identified by inserting a 4 byte tag in the Ethernet frame. 802.1Q is essential in multi-vendor environments.
Trunk links can be established by manual configuration, or by auto-negotiation between the two interfaces (using DTP).
Note: for auto-negotiation to work properly switches must be in the same VTP domain.
Disabling interface trunking:
To fully disable trunking on a switchport just configure this port as a permenant access port as shown below
Rack1SW4(config-if)#switchport Rack1SW4(config-if)#switchport mode access |
this command forces the port be a non-trunk port.
Permanent Trunk configuration:
The following steps are to be followed in order to configure a permanent trunk
1- Configure trunk encapsulation (ISL or dot1q).
2- Configure the interface in permanent trunking mode.
Rack1SW4(config-if)#switchport Rack1SW4(config-if)#switchport trunk encapsul Rack1SW4(config-if)#switchport trunk encapsulation ? dot1q Interface uses only 802.1q trunking encapsulation when trunking isl Interface uses only ISL trunking encapsulation when trunking negotiate Device will negotiate trunking encapsulation with peer on interface Rack1SW4(config-if)#switchport trunk encapsulation dot1q |
3- Preventing the interface from generating DTP frames is desirable in case of connecting to devices that don't support DTP. The following command will disable DTP negotiation
Rack1SW4(config-if)#switchport nonegotiate |
Configuration verification:
Rack1SW4(config-if)#do sh inter trunk
Port Mode Encapsulation Status Native vlan |
The output is telling us that interface f3/19 is in trunking mode and that encapsulation is dot1q for this link.
Note: make sure that native VLAN is the same on both ends when using dot1q encapsulation in order to avoid any problems that may occur by this misconfiguration.
Establishing trunks dynamically:
Switch can negotiate the interface capabilities and trunks can be brought up dynamically using DTP. DTP runs in one of two modes
1- desirable: the interface actively attempts to convert the interface into a trunk if the other end is in trunking, auto or desirable mode.
2- auto: the interface state is determined by the other side's mode. Interface will convert the link to trunk is the other side is in trunk or desirable mode.
Rack1SW4(config-if)#switchport Rack1SW4(config-if)#switchport mod dynamic ? auto Set trunking mode dynamic negotiation parameter to AUTO desirable Set trunking mode dynamic negotiation parameter to DESIRABLE Rack1SW4(config-if)#switchport mod dynamic desirable |
checking and verification:
Rack1SW4(config-if)#do sh interface trunk
Port Mode Encapsulation Status Native vlan |
The above output is telling us that this interface is now working as a trunk, it is in desirable mode and ISL encapsulation is was negotiated successfully "n-isl = negotiated ISL".
Trunk operation verification:
you can use the command show interface trunk to display all trunking interfaces and their capabilities on the switch as shown in the above examples
Also the command show interface switchport can be used as shown in the below output
Rack1SW4(config-if)#do sh inter f3/19 switch Name: Fa3/19 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: isl Negotiation of Trunking: on Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL |
Happy trunking :)