4.5 VTP
1. VTP vs DTP
VTP Overview
VTP (VLAN Trunking Protocol) and DTP (Dynamic Trunking Protocol) are both Cisco proprietary protocols used in network environments, but they serve different purposes and operate in distinct ways.
1.1 VTP (VLAN Trunking Protocol)
- Purpose: VTP is used to manage and synchronize VLAN information across multiple switches in a network. It ensures that all switches in the same VTP domain have consistent VLAN configurations.
- How it works:
- A VTP domain is created, and switches within the domain share VLAN information.
- One switch is configured as the VTP server, which can create, modify, or delete VLANs. Other switches can be configured as VTP clients or in transparent mode.
- VLAN changes made on the VTP server are propagated to all switches in the domain.
- Modes:
- Server: Can create, modify, and delete VLANs. Sends and receives VTP updates.
- Client: Cannot create, modify, or delete VLANs. Receives and forwards VTP updates.
- Transparent: Does not participate in VTP updates but forwards them. Can create, modify, and delete VLANs locally.
- Use case: Simplifies VLAN management in large networks by centralizing VLAN configuration.
1.2 DTP (Dynamic Trunking Protocol)
- Purpose: DTP is used to dynamically negotiate trunking between two connected switches or between a switch and a device that supports trunking (e.g., a router or another switch).
- How it works:
- DTP automatically negotiates whether a link should operate as a trunk (carrying multiple VLANs) or as an access link (carrying traffic for a single VLAN).
- It uses DTP packets to communicate between devices and determine the trunking mode.
- Modes:
- Dynamic Auto: Will form a trunk if the other device is set to “Dynamic Desirable” or “Trunk.”
- Dynamic Desirable: Actively tries to form a trunk with the other device.
- Trunk: Forces the link to be a trunk and does not negotiate.
- Access: Forces the link to be an access link and does not negotiate.
- Non-negotiate: Disables DTP and forces trunking without negotiation.
- Use case: Simplifies the configuration of trunk links between switches.
1.3 Key Differences Between VTP and DTP
Feature | VTP (VLAN Trunking Protocol) | DTP (Dynamic Trunking Protocol) |
---|---|---|
Purpose | Manages and synchronizes VLAN information. | Negotiates trunking between devices. |
Functionality | Distributes VLAN configurations. | Determines whether a link should be a trunk or access link. |
Modes | Server, Client, Transparent. | Dynamic Auto, Dynamic Desirable, Trunk, Access, Non-negotiate. |
Layer | Operates at the data link layer (Layer 2). | Operates at the data link layer (Layer 2). |
Dependency | Relies on trunk links to propagate VLAN info. | Relies on VTP for VLAN synchronization. |
Use Case | Simplifies VLAN management in large networks. | Simplifies trunk link configuration. |
2. Example
Sure! Let’s walk through an example of configuring VTP and DTP in Cisco Packet Tracer. This example will demonstrate how to set up a VTP domain and configure trunk links using DTP.
Topology
- Two switches: Switch0 (VTP Server) and Switch1 (VTP Client).
- A PC connected to each switch for testing VLANs.
2.1 Step 1: Configure VTP
-
Configure Switch0 as the VTP Server:
- Open the CLI for Switch0.
- Enter the following commands:
Terminal window Switch> enableSwitch# configure terminalSwitch(config)# vtp mode serverSwitch(config)# vtp domain MyDomainSwitch(config)# vtp password MyPasswordSwitch(config)# exit - Create a VLAN on Switch0:
Terminal window Switch(config)# vlan 10Switch(config-vlan)# name SalesSwitch(config-vlan)# exit
-
Configure Switch1 as the VTP Client:
- Open the CLI for Switch1.
- Enter the following commands:
Terminal window Switch> enableSwitch# configure terminalSwitch(config)# vtp mode clientSwitch(config)# vtp domain MyDomainSwitch(config)# vtp password MyPasswordSwitch(config)# exit
-
Verify VTP Synchronization:
- On Switch1, check if VLAN 10 (“Sales”) has been synchronized:
You should see VLAN 10 listed, which was created on the VTP server (Switch0).
Terminal window Switch# show vlan brief
- On Switch1, check if VLAN 10 (“Sales”) has been synchronized:
2.2 Step 2: Configure DTP for Trunking
-
Configure Trunking on Switch0:
- Open the CLI for Switch0.
- Configure the interface connected to Switch1 as a trunk:
Terminal window Switch(config)# interface GigabitEthernet0/1Switch(config-if)# switchport mode dynamic desirableSwitch(config-if)# exit
-
Configure Trunking on Switch1:
- Open the CLI for Switch1.
- Configure the interface connected to Switch0 as a trunk:
Terminal window Switch(config)# interface GigabitEthernet0/1Switch(config-if)# switchport mode dynamic autoSwitch(config-if)# exit
-
Verify Trunking:
- On both switches, check if the link between them is trunking:
You should see the interface (e.g., GigabitEthernet0/1) listed as a trunk.
Terminal window Switch# show interfaces trunk
- On both switches, check if the link between them is trunking:
2.3 Step 3: Assign VLANs to Access Ports
-
On Switch0:
- Assign the PC connected to Switch0 to VLAN 10:
Terminal window Switch(config)# interface FastEthernet0/1Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 10Switch(config-if)# exit
- Assign the PC connected to Switch0 to VLAN 10:
-
On Switch1:
- Assign the PC connected to Switch1 to VLAN 10:
Terminal window Switch(config)# interface FastEthernet0/1Switch(config-if)# switchport mode accessSwitch(config-if)# switchport access vlan 10Switch(config-if)# exit
- Assign the PC connected to Switch1 to VLAN 10:
2.4 Step 4: Test Connectivity
-
Assign IP addresses to the PCs:
- PC0:
192.168.10.2/24
- PC1:
192.168.10.3/24
- PC0:
-
Use the
ping
command from PC0 to PC1:Terminal window ping 192.168.10.3The ping should be successful since both PCs are in the same VLAN (VLAN 10).