Switching and VLANsIntermediate25 min read

What Is DTP in Networking?

Reviewed byJohnson Ajibi· Senior Network & Security Engineer · MSc IT Security
On This Page

Quick Definition

DTP is a Cisco feature that helps switch ports decide automatically if they should become a trunk or stay as an access port. It sends special messages between Cisco switches to agree on the port mode. This can save time but also creates security risks if not configured carefully.

Commonly Confused With

DTPvsVTP (VLAN Trunking Protocol)

VTP is used to synchronize VLAN information (like VLAN numbers and names) across multiple switches in a domain. DTP is only used to negotiate whether a single port is an access or trunk port. They are both Cisco proprietary but serve completely different purposes. VTP operates at the network-wide level, while DTP operates at the link level.

A network administrator uses VTP to add VLAN 30 on one switch, and all other switches learn about it automatically. DTP is used when connecting two switches to decide if that link will carry VLAN 30 across it.

DTPvs802.1Q

802.1Q is an IEEE standard that defines how VLAN tags are added to Ethernet frames on a trunk link. DTP is a negotiation protocol that decides whether a port will use 802.1Q trunking or not. 802.1Q is the mechanism that makes trunking work, while DTP is just the conversation that decides to turn on that mechanism.

If two switches agree via DTP to form a trunk, they will then use 802.1Q tagging on that link. DTP is the negotiation; 802.1Q is the actual tagging.

DTPvsISL (Inter-Switch Link)

ISL is an older Cisco proprietary trunking encapsulation that is now obsolete. Modern Cisco switches use 802.1Q. DTP can negotiate both ISL and 802.1Q trunking on older switches, but on current IOS versions, DTP only negotiates 802.1Q trunking. ISL is no longer supported in most modern hardware.

On an old switch, DTP could negotiate either ISL or 802.1Q depending on the configuration. On modern switches, DTP only negotiates 802.1Q.

DTPvsSwitchport mode access

Switchport mode access is a command that explicitly sets a port to operate as a nontrunking access port, but it does not necessarily stop DTP messages from being sent. Switchport nonegotiate is the command that actually disables DTP. Many learners confuse setting a port to access mode with disabling DTP, but they are two separate actions.

You can set a port to switchport mode access, and the port will still send DTP frames to the neighbor. To stop DTP entirely, you must also use switchport nonegotiate.

Must Know for Exams

DTP is a specific and recurring topic in the CCNA 200-301 exam, which is the most common related exam for this term. The exam objectives under Network Access include VLAN configuration, trunking, and DTP. You need to know the different DTP modes (Dynamic Auto, Dynamic Desirable, Trunk, Access) and the outcomes when two ports with different modes are connected. Exam questions often present a scenario where two switches are connected, and you must determine whether a trunk will form based on the DTP configuration of each side. For example, a question might say, "Switch A has interface fa0/1 configured as switchport mode dynamic auto. Switch B has interface fa0/1 configured as switchport mode dynamic desirable. Will a trunk form?" The correct answer is yes, because Dynamic Desirable initiates negotiation and Dynamic Auto responds.

Questions may also ask about the security implications of DTP. You might be asked to identify which DTP mode is the most secure for an access port that connects to a host. The answer is to set the port to "switchport mode access" and then apply "switchport nonegotiate" to disable DTP entirely. Another common question presents a troubleshooting scenario where a trunk is not forming between two Cisco switches, and you must examine the DTP configuration to find the problem. For instance, if both ends are set to Dynamic Auto, no trunk will form because neither side actively sends DTP messages.

The exam also tests your understanding of the difference between DTP and VTP (VLAN Trunking Protocol). While both are Cisco proprietary and relate to VLANs, VTP manages the distribution of VLAN information across switches, whereas DTP only negotiates trunking on a per-port basis. You need to keep them separate in your mind. The CCNA exam may include simulation or lab-style questions where you have to configure DTP settings on a switch to meet specific requirements, such as ensuring that a port connected to a router (router-on-a-stick) becomes a trunk while ports connected to PCs remain as access ports.

The exam relevance of DTP is categorized as "primary" for CCNA because it appears in multiple question formats, including multiple-choice, drag-and-drop, and simulated lab. You should memorize the DTP mode combinations and the security best practices. Knowing the "switchport nonegotiate" command is essential.

Simple Meaning

Imagine a door in an office building that can either be a regular door for people to go in and out, or a wide loading dock door for trucks. A regular door only lets individuals through one at a time, like an access port that carries traffic for just one VLAN. A loading dock door can handle many pallets at once, like a trunk port that carries traffic for many VLANs. Now imagine the door itself can automatically decide whether to act as a regular door or a loading dock door by talking to the door on the other side. That is what DTP does for switch ports on Cisco switches.

A trunk port is like a highway with multiple lanes, each lane representing a different VLAN. An access port is like a single local road that only serves one VLAN. DTP allows two connected switches to have a conversation: one switch says, "I can be a trunk if you want," and the other replies, "Yes, let's be a trunk," or "No, I want to stay an access port." This automatic negotiation can make setup faster because you do not have to manually configure both ports. However, it can also be a security problem if an attacker connects a switch and tricks your switch into trunking, potentially gaining access to all VLANs. That is why many network engineers disable DTP on ports that should stay as access ports.

In a small network, you might use DTP to save time when connecting two Cisco switches for the first time. But in a production network, security best practices usually tell you to turn DTP off and configure trunking manually. Think of it like locking a door manually instead of leaving it unlocked so someone can decide to open it wide. DTP is convenient, but you need to understand when to use it and when to disable it.

Full Technical Definition

Dynamic Trunking Protocol (DTP) is a Cisco proprietary Layer 2 protocol used to negotiate the operational mode of an Ethernet switch port between access mode and trunk mode. It operates on Cisco switches running IOS, IOS-XE, or NX-OS. DTP frames are sent using the Cisco Discovery Protocol (CDP) multicast address 01-00-0C-CC-CC-CC, and the protocol uses a specific TLV (Type-Length-Value) structure within CDP packets to convey the desired trunking state.

DTP supports several negotiation modes. The primary modes are Dynamic Auto, Dynamic Desirable, Trunk, and Access. When a port is set to Dynamic Auto, it will not actively send DTP messages to initiate trunking but will respond to DTP messages from the neighbor to become a trunk if the neighbor requests it. Dynamic Desirable actively sends DTP messages to negotiate trunking. Trunk mode forces the port to become a trunk regardless of the neighbor's state, but it still sends DTP frames. Access mode forces the port to operate as a nontrunking access port and typically does not negotiate trunking. The outcome of the negotiation depends on the combination of the two ends. If both ends are set to Dynamic Auto, no trunk will form because neither side actively initiates. If one end is Dynamic Desirable and the other is Dynamic Auto, a trunk will form. If one end is Trunk and the other is Dynamic Auto or Dynamic Desirable, a trunk forms. If either end is set to Access, the port will remain an access port.

In real IT implementations, DTP is often disabled at the interface level using the command "switchport nonegotiate" because of security concerns. An attacker who gains physical access to a switch port configured as Dynamic Auto or Dynamic Desirable could connect a rogue switch and negotiate a trunk, thereby gaining visibility into all VLANs traversing the trunk. This is a well-known VLAN hopping attack vector. Therefore, Cisco security best practices strongly recommend disabling DTP on all ports that are meant to be access ports. The command to disable DTP is applied in interface configuration mode: "switchport mode access" followed by "switchport nonegotiate". DTP is also not supported on all switch platforms or on non-Cisco devices.

DTP is closely related to 802.1Q trunking, as the trunk that DTP negotiates uses the 802.1Q encapsulation standard on modern Cisco switches. Older switches also supported ISL (Inter-Switch Link), another Cisco proprietary trunking protocol, but that is now obsolete. DTP is relevant to the CCNA exam because understanding how trunk negotiation works and its security implications is a core topic under Switching and VLANs. You need to know the different DTP modes, the outcomes of each combination, and how to disable DTP to secure the network.

Real-Life Example

Think of a highway with multiple toll lanes. Some lanes are for cars only (access lane), and some lanes are for trucks and cars (trunk lane). The lane itself has a sign that can change to tell drivers what kind of lane it is. Now imagine that two highway entrances from different directions meet at a junction. Each entrance has an electronic sign that can talk to the other sign and automatically decide whether the combined lane should become a car-only lane or a mixed lane.

This is like two switches connected by a cable. DTP is the conversation between the electronic signs. If one sign says "I can be a mixed lane if you want" (Dynamic Desirable) and the other says "I am okay with whatever you decide" (Dynamic Auto), they agree to become a mixed lane, meaning the trunk carries traffic for many VLANs. If both signs say "I am okay with whatever you decide" (both Dynamic Auto), neither takes the lead, so they stay as car-only lanes (access ports), and only one VLAN can pass. If one sign is permanently set to "Mixed lane only" (Trunk) and the other says "I am okay with whatever you decide" (Dynamic Auto), they become a mixed lane. But if one sign says "Cars only" (Access) and the other says "Mixed lane only" (Trunk), the mixed lane sign cannot override the car-only sign, so they stay as car-only. This is called a mismatch and can cause connectivity issues.

Now, think about security. If a dishonest person drives up to a car-only lane and uses a device that pretends to be a mixed lane sign, that person could trick the real sign into becoming a mixed lane, allowing that person to access all the lanes (all VLANs). That is why, in a real network, you permanently lock the sign to "Cars only" and disable the conversation feature. You do not want any automatic negotiation that could let an unauthorized device change the lane type.

Why This Term Matters

DTP matters because it directly impacts the security and stability of a switched network. Many network engineers, especially those starting out, leave DTP enabled on all ports by default because it makes initial setup easier. However, this opens the door to VLAN hopping attacks, one of the most common Layer 2 security vulnerabilities. An attacker can plug into a wall port that is set to Dynamic Auto or Dynamic Desirable and, with a Cisco switch, negotiate a trunk. Once a trunk is established, the attacker can see traffic from all VLANs that are allowed on the trunk, potentially capturing sensitive data such as passwords, emails, or internal server communications.

Beyond security, DTP misconfigurations can cause unexpected network behavior. For example, if one switch port is set to Trunk and the connected switch port is set to Access, the trunk port will not become operational because the access port does not participate in trunking. This can lead to a port being stuck in an err-disabled state or to the link being down entirely. Troubleshooting such issues often requires checking DTP negotiation status with commands like "show interfaces trunk" and "show dtp interface". Understanding DTP helps you avoid these pitfalls.

In practical IT environments, DTP is almost always disabled on access ports that connect to end devices like PCs, printers, and IP phones. It is kept enabled only on ports that connect to other Cisco switches where you intend to allow dynamic trunking. Even then, many organizations prefer to configure trunking manually to remove any uncertainty. Knowing when and how to disable DTP is a fundamental skill for network administrators and is tested on the CCNA exam. It may seem like a small detail, but misconfiguring DTP can lead to major security breaches or network outages.

How It Appears in Exam Questions

DTP appears in CCNA exam questions primarily in three forms: scenario-based, configuration-based, and troubleshooting-based. In scenario-based questions, you are given a diagram or description of a network with two Cisco switches connected via a single link. The DTP modes on each side are stated, and you must determine the resulting port mode (trunk or access). For example, a question might read: "Switch1 interface Gi0/1 is configured with switchport mode dynamic desirable. Switch2 interface Gi0/1 is configured with switchport mode dynamic auto. What is the operational mode of the link?" The answer is trunk. Another variation might ask: "If both switches are set to dynamic auto, what happens?" The answer is that the link stays as an access port because neither side initiates.

Configuration-based questions ask you to choose the correct commands to achieve a desired outcome. For instance, a question might say: "A network administrator wants to ensure that a port connected to a PC never becomes a trunk. Which two commands should be applied?" The correct answer is to configure "switchport mode access" and then "switchport nonegotiate". Another question might show a partial configuration and ask you to identify missing commands. For example: "interface FastEthernet0/1 switchport mode dynamic desirable no shutdown" and then ask which DTP mode the neighbor must be set to for a trunk to form. The answer could be dynamic auto, dynamic desirable, or trunk.

Troubleshooting-based questions present a scenario where a trunk is not working as expected. You might see output from "show interfaces trunk" or "show dtp interface" and need to diagnose the issue. For example, the output might show that the port is in a trunking state but the native VLAN mismatch exists, or that the port is down because of a DTP mismatch. A common trap is where one switch has "switchport mode access" and the other has "switchport mode trunk", the link might come up, but the trunk side will not function as a trunk because the access side does not negotiate. The trunk port may go into an err-disabled or blocking state in some scenarios.

You may also encounter questions that combine DTP with VLAN hopping attacks. For example: "An attacker connected a switch to an unused port in the conference room. The port was set to the default dynamic auto mode. What type of attack is possible?" The answer is a VLAN hopping attack via DTP spoofing. You would need to recommend the remediation, such as disabling DTP on the port.

Practise DTP Questions

Test your understanding with exam-style practice questions.

Practise

Example Scenario

A small company called TechFlow has two Cisco Catalyst 2960 switches in the same wiring closet. Switch A and Switch B are connected by a single Cat5e cable. The network administrator, Priya, wants to use that link to carry traffic for two VLANs: VLAN 10 for sales and VLAN 20 for engineering. She knows she needs the link to become a trunk. Priya is new to networking and decides to let the switches figure it out themselves using DTP.

On Switch A, she leaves the port at its default setting, which is dynamic auto on many Cisco switches. On Switch B, she also leaves the port at the default setting, also dynamic auto. When she connects the cable, both ports wait for the other to initiate trunk negotiation. But since neither is actively sending DTP messages to ask for trunking, they both remain as access ports. The link comes up, but it only carries traffic for VLAN 1, the default VLAN. Sales and engineering devices cannot communicate across the two switches. Priya wonders why the trunk is not working.

She checks the configuration and realizes that if she wants the trunk to form automatically, at least one side must be set to dynamic desirable. She reconfigures Switch B's port with the global configuration command "interface GigabitEthernet0/1" followed by "switchport mode dynamic desirable". Now Switch B actively sends DTP messages asking to become a trunk. Switch A, still in dynamic auto mode, receives those messages and agrees. The link becomes a trunk using 802.1Q encapsulation. Traffic for VLAN 10 and VLAN 20 can now flow between the switches.

Later, Priya learns about security risks. She decides that for future connections, she will manually configure trunking instead of relying on DTP, because she does not want an unauthorized switch to negotiate a trunk into her network. She also uses the "switchport nonegotiate" command on all ports connected to end devices to disable DTP entirely. This scenario shows how DTP can be convenient but also how it can cause unexpected behavior if both ends do not cooperate.

Common Mistakes

Assuming that two switches both set to dynamic auto will automatically form a trunk.

Dynamic auto does not actively initiate trunk negotiation; it only responds to DTP messages. If both sides are dynamic auto, neither sends a message, so the link stays as an access port.

Configure at least one side as dynamic desirable or trunk to start the negotiation, or manually configure trunking on both sides.

Thinking that switchport nonegotiate is the same as switchport mode access.

Switchport mode access sets the port to access mode but does not necessarily disable DTP-DTP still sends frames on access ports by default. Switchport nonegotiate stops all DTP frames from being sent or received on that port.

To fully secure an access port, use both commands: switchport mode access and switchport nonegotiate.

Believing DTP works between Cisco switches and non-Cisco devices or between different Cisco IOS versions universally.

DTP is a Cisco proprietary protocol. Non-Cisco switches do not understand DTP frames. Even between Cisco switches, if one runs an old IOS version that does not support DTP or has it disabled, negotiation may fail.

Always verify DTP compatibility on both ends. When linking to non-Cisco devices, manually configure trunking on the Cisco side and disable DTP.

Assuming that if one port is set to trunk and the other to access, a trunk will form because trunk mode overrides the other side.

If one end is set to access mode, it does not participate in DTP negotiation and will not become a trunk. The trunk side may show as trunking in its own configuration but the link will not pass multiple VLANs because the access side is not trunking.

Always ensure both ends of a trunk link are configured for trunking, either via DTP negotiation or manual configuration.

Thinking that DTP is the same as VTP (VLAN Trunking Protocol).

VTP manages the distribution of VLAN information across switched network, while DTP only negotiates whether a specific port is an access or trunk port. They operate at different layers and serve different purposes.

Remember: DTP for trunk negotiation per port, VTP for VLAN database synchronization across switches.

Exam Trap — Don't Get Fooled

{"trap":"A question states: \"Switch A interface is configured as switchport mode dynamic desirable. Switch B interface is configured as switchport mode dynamic auto. The link comes up and operates as a trunk.

Later, the network administrator changes Switch B's interface to switchport mode access. What will happen to the trunk?\" The trap is that learners think the trunk will immediately break or the port will go down."

,"why_learners_choose_it":"Learners often think that DTP is continuously renegotiating the port state. They assume that as soon as one side changes, the other side immediately switches to access mode. In reality, once a trunk is established, the port stays in trunk mode until it is explicitly reconfigured or the link goes down.

DTP negotiation happens only when the link is coming up or when there is a change in the DTP configuration, but not continuously.","how_to_avoid_it":"Remember that DTP negotiation occurs primarily at link initialization or when the DTP mode is changed. Changing one side to access mode after a trunk is established will not automatically change the other side.

The other switch will still see the port as trunking. However, the mismatch can cause issues with traffic flow-the side set to access will only accept traffic for the native VLAN, while the side still in trunk mode will attempt to send traffic for all VLANs. This can cause the port to go into an err-disabled state or create a one-way communication problem.

In exams, always consider the timing of the configuration change and the behavior of DTP after the initial negotiation."

Step-by-Step Breakdown

1

Port Initialization

When a switch port comes up (cable is connected or switch boots), the switch begins sending CDP frames that include DTP information. The DTP mode configured on that port determines what kind of DTP message it sends.

2

DTP Message Exchange

Each switch sends DTP frames to the multicast address 01-00-0C-CC-CC-CC. These frames contain the desired trunking state (trunk, access, or desirable/auto). The switches listen for DTP frames from the neighbor.

3

Negotiation Decision

Based on the configured DTP modes on both sides, a logical decision is made. For example, Dynamic Desirable + Dynamic Auto = trunk. Both sides process the received DTP information and agree on the operational mode.

4

Port Mode Application

If the negotiation results in a trunk, the port is configured internally as a trunk port and begins using 802.1Q encapsulation. If the result is an access port, the port remains in that mode. The switch updates its internal state and the port operational mode is set.

5

Ongoing Operation

Once the port mode is established, DTP frames may continue to be sent periodically (every few seconds) depending on the mode. However, the port mode does not change unless there is a configuration change or the link goes down and renegotiates.

6

Configuration Change or Link Failure

If an administrator changes the DTP mode on one side while the link is up, the switch may resend DTP frames and initiate renegotiation. If the link goes down and comes back, the entire negotiation process starts again from step 1.

Practical Mini-Lesson

DTP is one of those protocols that seems simple but can cause real headaches if you don't understand it thoroughly. In the real world, most production networks disable DTP on all ports except where absolutely necessary. The default mode on many Cisco Catalyst switches is dynamic auto, which means the switch will not actively try to become a trunk. However, if an unauthorized switch is plugged in and configured as dynamic desirable or trunk, that default port can become a trunk and expose all VLANs. That is why the Cisco security best practice is to configure every port that connects to an end device with "switchport mode access" and "switchport nonegotiate". This stops DTP completely and ensures the port never becomes a trunk, even if someone tries to negotiate.

When you are configuring switches for the CCNA exam or in a lab, you need to practice the commands. To see the DTP state of an interface, use "show dtp interface [interface-id]". This will show you the current DTP mode, the number of DTP packets sent and received, and the negotiation status. Another useful command is "show interfaces trunk" which shows which ports are currently trunking. If a trunk is not forming between two Cisco switches, begin by checking the DTP mode on both sides. If one side is set to access and the other to dynamic auto, no trunk will form. If both are dynamic auto, no trunk will form. You can manually force a trunk by setting both sides to trunk with "switchport mode trunk" or by setting one side to dynamic desirable and leaving the other at dynamic auto.

In a practical IT job, you might also encounter situations where DTP causes unexpected behavior after a switch replacement. For instance, you replace an old switch with a new one that defaults to dynamic auto, while the other switch is set to dynamic desirable. The trunk forms automatically, which might be good or bad depending on your security policy. Always document your DTP configurations and include them in your network change management process. Remember that DTP frames use CDP multicast, so if you disable CDP on a port, DTP may also be affected. However, disabling CDP globally will also disable DTP, which might inadvertently break trunk negotiation on ports that rely on DTP. So be cautious when disabling CDP on a switch.

A common mistake in practice is to forget that DTP is still active even after setting the port to access mode. You must explicitly use "switchport nonegotiate" to stop DTP. Otherwise, the port may still respond to DTP messages from a neighbor, potentially becoming a trunk unintentionally. DTP is a convenience feature that should be used sparingly and with full awareness of its security implications.

Memory Tip

Think 'DTP = Do Trunk Please?' but remember, if both sides say 'Auto' (auto means maybe?), the answer is no trunk.

Covered in These Exams

Current Exam Context

Current exam versions that test this topic — use these objectives when studying.

Related Glossary Terms

Frequently Asked Questions

Is DTP enabled by default on Cisco switches?

On many Cisco Catalyst switches that support it, DTP is enabled by default with the port mode set to dynamic auto. This means the port will not initiate trunking but will respond to DTP messages from a neighbor. It is important to check your specific switch model and IOS version.

Can DTP be used with non-Cisco switches?

No, DTP is a Cisco proprietary protocol. Non-Cisco switches do not understand DTP frames. If you connect a Cisco switch to a non-Cisco switch, you must manually configure trunking on the Cisco side and disable DTP with switchport nonegotiate.

What is the difference between switchport mode trunk and switchport mode dynamic desirable?

Switchport mode trunk forces the port to become a trunk regardless of the neighbor's DTP mode, and it actively sends DTP frames. Switchport mode dynamic desirable also actively sends DTP frames but it will only form a trunk if the neighbor responds positively (i.e., the neighbor is in dynamic auto, dynamic desirable, or trunk mode).

Does disabling CDP also disable DTP?

Yes, because DTP frames are encapsulated within CDP frames and use the same multicast address. If you disable CDP globally or on a specific interface, DTP will also stop functioning on that interface or the entire switch. Be cautious when disabling CDP if you rely on DTP.

How do I stop DTP on a port?

Use the command switchport nonegotiate in interface configuration mode. This prevents the port from sending or processing DTP frames. It is often used in combination with switchport mode access to secure a port.

What happens if I set one end of a link to trunk and the other to access?

The trunk side will still be configured as trunk in its own configuration, but the access side will not negotiate or accept trunking. The link may come up, but traffic will be limited to the native VLAN, and there may be connectivity issues. The trunk port may show as trunking, but the link will not carry multiple VLANs effectively.

Will DTP form a trunk if both ends are set to dynamic auto?

No, because dynamic auto does not send active DTP messages to initiate negotiation. Both sides wait for the other side to start the conversation, so the link remains as an access port.

Summary

DTP, or Dynamic Trunking Protocol, is a Cisco proprietary Layer 2 protocol that allows switch ports to automatically negotiate whether they should operate as trunk or access ports. It simplifies initial switch setup but introduces significant security risks, particularly the possibility of VLAN hopping attacks when an unauthorized device negotiates a trunk. Understanding the different DTP modes-Dynamic Auto, Dynamic Desirable, Trunk, and Access-and how they interact is essential for both real-world network management and CCNA exam success.

The most important takeaway for CCNA candidates is to know the outcomes of all possible DTP mode combinations. Practice with the commands and scenarios until the responses become second nature. Also remember that the best security practice is to disable DTP on all ports that connect to end devices using the "switchport mode access" and "switchport nonegotiate" commands. DTP is often confused with VTP, but keep them separate in your mind: DTP for per-port negotiation, VTP for global VLAN database sync.

In exams, you will face questions that test your knowledge of DTP negotiation outcomes, security concerns, and configuration commands. A strong grasp of DTP will also help you troubleshoot trunking issues in a lab or production environment. As you prepare for your certification, pay attention to this small but significant protocol. It may not be the largest topic on the exam, but it is a frequent source of points if you master it.