VTP and DTP correlation

What is the correlation between VTP and DTP on a Cisco switch?

This is something interesting I came across while studying for CCNP Switch.
As also explained to me during my CCNA studies; DTP or Dynamic Trunking Protocol is used to negotiate a trunk link between multiple switches, right?

On the other hand, VTP or Vlan Trunk Protocol is used to easily manage a VTP domain with the use of server and client switches. I’ve always understood that the only correlation between these two was that once DTP sets up a trunk link (or you do it manually) VTP will send traffic over this trunk.

It was while doing some labs in prepration for the exam I found this to be not exactly true.

Apparently DTP will not form a trunk link if there is a VTP domain mismatch.

Using the Cisco OCG for the exam, I either completely missed this information or it was badly documented.
So that’s why I will demonstrate the issue in this update.

Let’s imagine a scenario where we just have two switches interconnected on their fast ethernet 0/1 interfaces.
Both sides have DTP enabled with the interface command “switchport mode dynamic desirable

Here is the relevant configuration;

SW1#sh run int fa 0/1

interface FastEthernet0/1
switchport mode dynamic desirable

SW1#sh vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 255
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 : LAB
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x16 0x58 0x75 0x39 0xDF 0xC7 0xA4 0x70
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)

SW2#sh run int fa 0/1

interface FastEthernet0/1
switchport mode dynamic desirable

SW2#sh vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 255
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 : LAB
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x16 0x58 0x75 0x39 0xDF 0xC7 0xA4 0x70
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)

I will enable “debug sw-vlan vtp events” on SW1 and shut/no shut the trunk interface.

VTP LOG RUNTIME: switchport trunk mode on Fa0/1 has changed
VTP LOG RUNTIME: Transmit vtp summary, domain LAB, rev 0, followers 0
MD5 digest calculated = 16 58 75 39 DF C7 A4 70 55 97 5A E0 76 1D FD D3
VTP LOG RUNTIME: Summary packet received, domain = LAB, rev = 0, followers = 0
VTP LOG RUNTIME: Summary packet rev 0 equal to domain LAB rev 0

Okay, it looks like it sees the trunk mode come up and *after* that starts sending its VTP information.
Great, looks like everything is working as expected.

Now what happens if we change the domain name on SW2?

SW2(config)#vtp domain LAP
Changing VTP domain name from LAB to LAP

Back on SW1 I can see VTP complaining about the mismatch.

VTP LOG RUNTIME: Dropping packet received on trunk Fa0/1 – not in domain LAP

Fair enough, we don’t want to accept packets that are in the wrong VTP domain.
But this seems to be the only issue … Atleast until I shut/no shut the port again.

00:23:04 %DTP-5-DOMAINMISMATCH: Unable to perform trunk negotiation on port Fa0/1 because of VTP domain mismatch.

When I first saw this I could not believe it, so I started looking at the actual DTP packets themselves and you can plainly see that there is a field for “Domain Name” meaning VTP information will also end up in your DTP packets!