A trunk is a switch port that can carry multiple traffic types, each tagged with a unique VLAN ID. As data is switched across the trunk port or trunk link, it is tagged (or colored) by the egress switch trunk port, which allows the receiving switch to identify that it belongs to a particular VLAN. On the receiving switch ingress port, the tag is removed and the data is forwarded to the intended destination.
The first configuration task when implementing VLAN trunking in Cisco IOS Catalyst switches is to configure the desired interface as a Layer 2 switch port. This is performed by issuing the switchport interface configuration command.
NOTE: This command is required only on Layer 3-capable or Multilayer switches. It is not applicable to Layer 2-only switches, such as the Catalyst 2950 series.
The second configuration task is to specify the encapsulation protocol that the trunk link should use. This is performed by issuing the switchport trunk encapsulation [option] command. The options available with this command are as follows:
| Cat6-Distribution(config)#interface fastethernet 1/1 Cat6-Distribution(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 |
The dot1q keyword forces the switch port to use IEEE 802.1Q encapsulation. The isl keyword forces the switch port to use Cisco ISL encapsulation. The negotiate keyword is used to specify that if the Dynamic Inter-Switch Link Protocol (DISL) and Dynamic Trunking Protocol (DTP) negotiation fail to successfully agree on the encapsulation format, then ISL is the selected format. DISL simplifies the creation of an ISL trunk from two interconnected Fast Ethernet devices. DISL minimizes VLAN trunk configuration procedures because only one end of a link needs to be configured as a trunk.
DTP is a Cisco proprietary point-to-protocol that negotiates a common trunking mode between two switches. DTP will be described in detail later in this chapter. The following output illustrates how to configure a switch port to use IEEE 802.1Q encapsulation when establishing a trunk:
| Cat6-Distribution(config)#interface fastethernet 1/1 Cat6-Distribution(config-if)#switchport Cat6-Distribution(config-if)#switchport trunk encapsulation dot1q |
This configuration can be validated via the show interfaces [name] switchport command as illustrated in the following output:
| Cat6-Distribution#show interfaces fastethernet 1/1 switchport Name: Fa0/2 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) … [Output Truncated] |
The third trunk port configuration step is to implement configuration in order to ensure that the port is designated as a trunk port. This can be done in one of two ways:
- Manual (Static) Trunk Configuration
- Dynamic Trunking Protocol (DTP)
Manual (Static) Trunk Configuration
The manual configuration of a trunk is performed by issuing the switchport mode trunk interface configuration command on the desired switch port. This command forces the port into a permanent (static) trunking mode. The following configuration output shows how to configure a port statically as a trunk port:
| VTP-Server(config)#interface fastethernet 0/1 VTP-Server(config-if)#switchport VTP-Server(config-if)#switchport trunk encapsulation dot1q VTP-Server(config-if)#switchport mode trunk VTP-Server(config-if)#exit VTP-Server(config)# |
This configuration can be validated via the show interfaces [name] switchport command as illustrated in the following output:
| VTP-Server#show interfaces fastethernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) … [Truncated Output] |
Although manual (static) configuration of a trunk link forces the switch to establish a trunk, Dynamic ISL and Dynamic Trunking Protocol (DTP) packets will still be sent out of the interface. This is performed so that a statically configured trunk link can establish a trunk with a neighboring switch that is using DTP, as will be described in the following section. This can be validated in the output of the show interfaces [name] switchport command as illustrated in the following output:
| VTP-Server#show interfaces fastethernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) … [Truncated Output] |
In the output above, the text in bold indicates that despite the static configuration of the trunk link, the port is still sending out DTP and DISL packets.
In some cases, this is considered undesirable. Therefore, it is considered good practice to disable the sending of DISL and DTP packets on a port statically configured as a trunk link by issuing the switchport nonegotiateinterface configuration command as illustrated in the following output:
| VTP-Server(config)#interface fastethernet 0/1 VTP-Server(config-if)#switchport VTP-Server(config-if)#switchport trunk encapsulation dot1q VTP-Server(config-if)#switchport mode trunk VTP-Server(config-if)#switchport nonegotiate VTP-Server(config-if)#exit VTP-Server(config)# |
Again, the show interfaces [name] switchport command can be used to validate the configuration, as follows:
| VTP-Server#show interfaces fastethernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: Off Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) … [Truncated Output] |
Dynamic Trunking Protocol (DTP)
DTP is a Cisco proprietary point-to-protocol that negotiates a common trunking mode between two switches. This dynamic negotiation can also include the trunking encapsulation. The two DTP modes that a switch port can use, depending on the platform, are as follows:
- Dynamic Desirable
- Dynamic Auto
When using DTP, if the switch port defaults to a dynamic desirable state, the port will actively attempt to become a trunk if the neighboring switch is set to dynamic desirable or dynamic auto mode. If the switch ports default to a dynamic auto state, the port will revert to being a trunk only if the neighboring switch is set to dynamic desirable mode.
Figure 2-14 below illustrates the DTP mode combinations that will result in a trunk either establishing or not establishing between two Cisco Catalyst switches:

Fig. 2-14. DTP Mode Combinations
Figure 2-15 below illustrates the valid combinations that will result in the successful establishment of a trunk link between two neighboring switches – one using DTP and the other statically configured as a trunk port:

Fig. 2-15. DTP Mode Combinations 2
In addition to these various combinations that can be used to establish a trunk link between two neighboring switches, it is important to know that if the switches are both set to dynamic auto, they will not be able to establish a trunk between them.
This is because unlike dynamic desirable mode, dynamic auto mode is a passive mode that waits for the other side to initiate trunk establishment. Therefore, if two passive ports are connected, neither will ever initiate trunk establishment and the trunk will never be formed. Similarly, if a statically configured switch port is also configured with the switchport nonegotiate command, it will never form a trunk with a neighboring switch using DTP because this prevents the sending of DISL and DTP packets out of that port.
When using DTP in a switched LAN, the show dtp [interface <name>] command can be used to display DTP information globally for the switch or for the specified interface. The following output shows the information printed by the show dtp command:
| VTP-Server#show dtp Global DTP information Sending DTP Hello packets every 30 seconds Dynamic Trunk timeout is 300 seconds 4 interfaces using DTP |
Based on the output above, the switch is sending DTP packets every 30 seconds. The timeout value for DTP is set to 300 seconds (5 minutes), and 4 interfaces are currently using DTP. The show dtp interface [name] command prints DTP information about the specified interface, which includes the type of interface (trunk or access), the current port DTP configuration, the trunk encapsulation, and DTP packet statistics as illustrated in the following output:
| VTP-Server#show dtp interface fastethernet0/1 DTP information for FastEthernet0/1: TOS/TAS/TNS: TRUNK/ON/TRUNK TOT/TAT/TNT: 802.1Q/802.1Q/802.1Q Neighbor address 1: 000000000000 Neighbor address 2: 000000000000 Hello timer expiration (sec/state): 7/RUNNING Access timer expiration (sec/state): never/STOPPED Negotiation timer expiration (sec/state): never/STOPPED Multidrop timer expiration (sec/state): never/STOPPED FSM state: S6:TRUNK # times multi & trunk 0 Enabled: yes In STP: noStatistics ———- 0 packets received (0 good) 0 packets dropped 0 nonegotiate, 0 bad version, 0 domain mismatches, 0 bad TLVs, 0 other 764 packets output (764 good) 764 native, 0 software encap isl, 0 isl hardware native 0 output errors 0 trunk timeouts 2 link ups, last link up on Mon Mar 01 1993, 00:00:22 1 link downs, last link down on Mon Mar 01 1993, 00:00:20 |
IEEE 802.1Q Native VLAN
Earlier in this chapter, we learned that 802.1Q, or VLAN tagging, inserts a tag into all frames and all frames, except those in the native VLAN, are tagged. The IEEE defined the native VLAN to provide for connectivity to old 802.3 ports that did not understand VLAN tags.
By default, an 802.1Q trunk uses VLAN 1 as the native VLAN. The default native VLAN on an 802.1Q trunk link can be verified by issuing the show interfaces [name] switchport or the show interfaces trunk command as illustrated in the following output:
| VTP-Server#show interfaces fastethernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none … [Truncated Output] |
The native VLAN is used by the switch to carry specific protocol traffic like Cisco Discovery Protocol (CDP), VLAN Trunking Protocol (VTP), Port Aggregation Protocol (PAGP), and Dynamic Trunking Protocol (DTP) information. CDP and PAGP will be described in detail later in this guide. Although the default native VLAN is always VLAN 1, the native VLAN can be manually changed to any valid VLAN number that is not in the reserved range of VLANs.
However, it is important to remember that the native VLAN must be the same on both sides of the trunk link. If there is a native VLAN mismatch, Spanning Tree Protocol (STP) places the port in a port VLAN ID (PVID) inconsistent state and will not forward the link. Additionally, CDP v2 passes native VLAN information between switches and will print error messages on the switch console if there is a native VLAN mismatch. The default native VLAN can be changed by issuing the switchport trunk native vlan [number] interface configuration command on the desired 802.1Q trunk link as illustrated in the following output:
| VTP-Server(config)#interface fastethernet 0/1 VTP-Server(config-if)#switchport trunk native vlan ? <1-4094> VLAN ID of the native VLAN when this port is in trunking mode |
Filtering VLANs on Trunk Links
By default, all trunk ports on Cisco Catalyst switches allow traffic from all VLANs as illustrated in the output of theshow interfaces trunk command:
| VTP-Server#show interfaces trunkPort Mode Encapsulation Status Native vlan Fa0/1 on 802.1q trunking 1 Fa0/2 desirable 802.1q trunking 1 Fa0/3 desirable 802.1q trunking 1Port Vlans allowed on trunk Fa0/1 1-4094 Fa0/2 1-4094 Fa0/3 1-4094 Port Vlans allowed and active in management domain Port Vlans in spanning tree forwarding state and not pruned |
In the output above, three trunk links have been established on the switch. By default, all three trunk links allow traffic from the entire range of VLANs without any explicit configuration. While this default behavior is generally acceptable, in some environments, such as those that require high levels of network security, for example, it may not be acceptable.
Cisco IOS software allows administrators to configure manually the VLANs that are allowed on specific trunk links via the switchport trunk allowed vlan interface configuration command. The options available with this command are as follows:
| VTP-Server(config)#interface fastethernet0/1 VTP-Server(config-if)#switchport trunk allowed vlan ? WORD VLAN IDs of the allowed VLANs when this port is in trunking mode add add VLANs to the current list all all VLANs except all VLANs except the following none no VLANs remove remove VLANs from the current list |
The first available option allows for specifying the VLANs that will be allowed to traverse the trunk link. The addkeyword allows for adding additional VLANs to those that are already allowed to traverse the trunk link. The allkeyword specifies that all VLANs are allowed across the trunk link. This is the default behavior. The exceptkeyword is used to allow all VLANs except for the VLANs specified following this keyword. The none keyword prevents any VLANs from traversing the trunk link. The remove keyword removes previously allowed VLANs from the trunk link.
The following configuration output illustrates how to allow VLANs 1, 10, 20, 30, 40, and 50 to traverse a configured trunk link:
| VTP-Server(config)#interface fastethernet 0/1 VTP-Server(config-if)#switchport VTP-Server(config-if)#switchport trunk encapsulation dot1q VTP-Server(config-if)#switchport mode trunk VTP-Server(config-if)#switchport trunk allowed vlan 1,10,20,30,40,50 VTP-Server(config-if)#exit |
The following configuration output illustrates how to permit all VLANs except for VLANs 100 through 200 on a configured trunk link:
| VTP-Server(config)#interface fastethernet 0/2 VTP-Server(config-if)#switchport VTP-Server(config-if)#switchport trunk encapsulation dot1q VTP-Server(config-if)#switchport mode trunk VTP-Server(config-if)#switchport trunk allowed vlan except 100-200 VTP-Server(config-if)#exit |
The following configuration output illustrates how to remove VLANs 1, 3, 5, and 7–9 from the VLANs permitted to traverse a trunk link:
| VTP-Server(config)#interface fastethernet 0/3 VTP-Server(config-if)#switchport VTP-Server(config-if)#switchport trunk encapsulation dot1q VTP-Server(config-if)#switchport mode trunk VTP-Server(config-if)#switchport trunk allowed vlan remove 1,3,5,7-9 |
These configurations can be validated by issuing the show interfaces trunk command as illustrated in the following output:
| VTP-Server#show interfaces trunkPort Mode Encapsulation Status Native vlan Fa0/1 on 802.1q trunking 1 Fa0/2 desirable 802.1q trunking 1 Fa0/3 desirable 802.1q trunking 1Port Vlans allowed on trunk Fa0/1 1,10,20,30,40,50 Fa0/2 1-99,201-4094 Fa0/3 2,4,6,10-4094 Port Vlans allowed and active in management domain Port Vlans in spanning tree forwarding state and not pruned |