Dynamic Trunking Protocol (DTP) Explained

The Dynamic Trunking Protocol (DTP) is a Cisco proprietary protocol used to negotiate trunking between Cisco switches. For CCNA and CCNP students, understanding DTP is crucial for configuring and troubleshooting VLAN trunk links in enterprise networks. DTP simplifies the process of establishing trunk connections by automatically negotiating whether a link should operate in trunk or access mode. This article explores DTP’s functionality, configuration modes, and best practices to help you master switch configurations for your Cisco certification exams and real-world networking tasks.
The DTP manages trunk negotiation between Cisco devices, enabling automatic formation of trunk links to carry VLAN traffic. By default, DTP is enabled on Cisco Catalyst 2960 and 3560 Series switches in “dynamic auto” or “dynamic desirable” mode, streamlining configuration in enterprise networks.
The DTP works only on a point-to-point basis between network devices. Some internetworking devices negotiate improperly and send wrong DTP frames, which causes misconfigurations. To avoid this error, turn off Dynamic Trunking Protocol (DTP) on the interface connected to devices that do not support Dynamic Trunking Protocol (DTP.
A non-Cisco switch does not support DTP. The Dynamic Trunking Protocol (DTP) only negotiates if the port on the neighbor switch is configured in a trunk mode that supports DTP. To enable trunking from a Cisco switch that does not support DTP, use the “switchport mode trunk” and “switchport nonegotiate” interface configuration mode commands. This causes the interface to become a trunk but not generate DTP frames.
In the figure below, the switch0 and switch1 links become trunks because the F0/1 ports on switch0 and switch1 are configured as trunks; therefore, they ignore all DTP packets. The Fa0/2 ports on switch1 and switch2 are set to dynamic auto, so the DTP negotiation results in the access mode state. The ports in dynamic auto create an inactive trunk link.
DTP Switchport Modes
Cisco Catalyst switches (e.g., 2960 and 3560 Series) support various trunking modes via DTP. Below is a detailed explanation of each mode, followed by a comparison table.
Switchport Mode Access
Forces the port into access mode, disabling trunking and VLAN tagging.
Use case: Connect to end devices like PCs or servers.
Command:
Switch#configure terminal
Switch(config)#interface fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#exit
Switchport mode dynamic auto
If a switch port is configured as dynamic auto, the interface can convert the port to a trunk port. The interface becomes a trunk interface if the neighboring interface is set to trunk or desirable mode. The default switchport mode for all Ethernet interfaces is dynamic auto, so in the default configuration, “dynamic auto” mode, the switch will not generate DTP messages on the interface.
The dynamic auto interface will only listen for DTP messages from the neighboring switch’s interface. If the dynamic auto interface receives a DTP message from the interface of the neighbor switch, the port will change itself to a trunk. The configuration command for dynamic auto is the following:-
• Sw1#configure terminal
• Sw1(config)#interface fa0/1
• Sw1(config-if)#switchport mode dynamic auto
• Sw1(config-if)#exit
• Sw1(config)#exit
Switchport mode dynamic desirable
A switch port configured as the dynamic desirable mode will actively attempt to convert the link to the trunk link using DTP. A trunk link will be established if the neighboring switch port can form a trunk. The interface configured as the dynamic desirable mode will also generate DTP messages on the interface. If the switch receives DTP messages from the other side switch, it will assume that the other side port can handle tagged frames, and a trunk link will be established between both switches.
• Sw1#configure terminal
• Sw1(config)#interface fa0/1
• Sw1(config-if)#switchport mode dynamic desirable
• Sw1(config-if)#exit
• Sw1(config)#exit
Switchport mode trunk
This is a permanent mode for trunking on the switch. The interface becomes a trunk interface even if the neighboring interface is not.
• Sw1#configure terminal
• Sw1(config)#interface fa0/1
• Sw1(config-if)#switchport mode trunk
• Sw1(config-if)#exit
• Sw1(config)#exit
• Sw1#
Switchport nonegotiate
Port configuration as non-negotiate prevents generating DTP frames. This command is required only when the interface switchport mode is accessed or trunk. To establish a trunk link, you must manually configure the neighboring interface as a trunk interface.
• Sw1#configure terminal
• Sw1(config)#interface fa0/1
• Sw1(config-if)#switchport mode trunk
• Sw1(config-if)#switchport nonegotiate
• Sw1(config-if)#exit
• Sw1(config)#exit
DTP Modes Comparison
Mode | Sends DTP Frames | Responds to DTP Frames | Forms Trunk With | Default on Catalyst Switches |
---|---|---|---|---|
Access | No | No | None | No |
Dynamic Auto | Yes (in response) | Yes | Trunk, Dynamic Desirable | Yes |
Dynamic Desirable | Yes (actively) | Yes | Trunk, Dynamic Desirable, Dynamic Auto | Sometimes |
Trunk | Yes | Yes | Any mode (if not nonegotiate) | No |
Nonegotiate | No | No | Only with manual trunk configuration | Form Trunk With |
Troubleshooting DTP Issues
Common DTP issues can prevent trunk formation or cause misconfigurations. Below are typical problems and solutions:
- Trunk Not Forming:
- Cause: Mismatched DTP modes (e.g., both switches in “dynamic auto”).
- Solution: Ensure one switch is in “dynamic desirable” or “trunk” mode.
- Verification: Use <show interfaces trunk> to confirm trunk status.
- Non-Cisco Device Connectivity:
- Cause: Non-Cisco devices don’t support DTP, causing negotiation failures.
- Solution: Configure the Cisco switch with switchport mode trunk and switchport nonegotiate.
- Verification: Check <show interfaces trunk>for trunk status.
- VLAN Mismatch:
- Cause: Allowed VLAN lists on trunk ports don’t match.
- Solution: Configure matching VLANs using switchport trunk allowed vlan <list>.
- Verification: Use the <show interfaces trunk> command to verify allowed VLANs.
- Security Risks (VLAN Hopping):
- Cause: DTP enabled on untrusted ports allows unauthorized trunking.
- Solution: Disable DTP on ports connected to untrusted devices using switchport mode access or switchport nonegotiate.
- Verification: Use <show dtp interface> to confirm DTP is disabled.
DTP Best Practices
To ensure secure and efficient DTP configurations:
- Disable DTP on Untrusted Ports: Use <switchport mode access> or <switchport nonegotiate> on ports connected to end devices or non-Cisco switches to prevent unauthorized trunking.
- Use Manual Trunking for Critical Links: Configure <switchport mode trunk>for predictable behavior in production environments.
- Verify Configurations: Always use <show interfaces trunk>and <show dtp>to confirm trunk status and DTP settings.
- Limit VLANs on Trunks: Use (switchport trunk allowed vlan <list>) to restrict VLAN traffic for security and performance.
- Document Configurations: Maintain clear documentation of DTP modes and VLAN assignments for troubleshooting.
Conclusion – Dynamic Trunking Protocol (DTP) Explained
The Dynamic Trunking Protocol (DTP) plays a crucial role in simplifying the configuration of trunk links in Cisco network environments by automating the negotiation process between switches. By understanding DTP’s modes—such as Auto, Desirable, On, Off, and Nonegotiate—network administrators can effectively manage trunking configurations to suit their network’s requirements. While DTP offers convenience and flexibility, careful configuration is essential to avoid security risks, such as unauthorized VLAN access or misconfigured trunks. By adhering to best practices, such as explicitly setting trunk modes, disabling DTP on unused ports, and securing switch interfaces, organizations can leverage DTP to streamline network operations while maintaining a secure and efficient LAN infrastructure.