DTP, or Dynamic Trunking Protocol, is a Cisco proprietary protocol used on LAN switches to automatically negotiate trunking on a link between two devices.
Understanding DTP
DTP simplifies network administration by automating the trunking process. Instead of manually configuring trunk links on both sides, DTP-enabled devices can negotiate the trunking mode. This automatic negotiation can save time and reduce the risk of configuration errors.
How DTP Works
DTP operates by sending and receiving DTP frames between two switches. These frames communicate the desired trunking mode of each switch. Based on these messages, the switches determine the operational mode for the link.
DTP Modes
DTP supports several modes, influencing how a switch negotiates trunking:
- Switchport Mode Trunk: Forces the link to be a trunk link. The switch actively tries to convert the link into a trunk link and will negotiate with the other device.
- Switchport Mode Dynamic Desirable: Actively attempts to trunk. The switch actively tries to convert the link into a trunk link and will negotiate with the other device.
- Switchport Mode Dynamic Auto: Passively waits for the other side to initiate trunking. If the other side is set to desirable or trunk, the link will become a trunk. If the other side is set to access mode, then the link will remain as access.
- Switchport Mode Access: Forces the link to be an access link.
- Switchport Mode No Negotiate: Disables DTP. The switchport does not generate DTP frames. This option should be configured when trunking is manually configured or when the port is configured for access mode.
Security Considerations
While DTP simplifies configuration, it also presents a potential security risk. An attacker could exploit DTP to gain unauthorized access to a network by manipulating trunk links. Therefore, it's generally recommended to disable DTP on production networks using the switchport nonegotiate
command and explicitly configure trunking or access mode.
Example Configuration
To disable DTP on a trunk port:
interface GigabitEthernet0/1
switchport mode trunk
switchport nonegotiate
This configuration ensures that the port operates as a trunk link without DTP negotiation, enhancing network security.
Summary
DTP is a useful feature for simplifying initial network setup but poses a security risk and may create problems in more complicated networks. It’s best to disable DTP and configure trunking manually for security and predictable network behavior in production environments.