VTP
VTP (Virtual Trunking Protocol) is a Cisco proprietary protocol that manages the addition, deletion, and renaming of VLANs across a switched network. It enables centralized VLAN management where one switch (VTP server) can propagate VLAN configuration changes to other switches (VTP clients) in the same VTP domain. This reduces administrative overhead and ensures VLAN consistency across the network infrastructure.
Diagram
Classes
configuration (iosxe.devices)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
vtp | Class | [vtp] | No |
vtp (iosxe.devices.configuration)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
file | String | No | ||
version | Integer | min: 1 , max: 3 | No | |
interface_type | Choice | Loopback , Vlan , GigabitEthernet , FiveGigabitEthernet , TenGigabitEthernet , FortyGigabitEthernet , HundredGigabitEthernet , PortChannel | No | |
interface_id | String | No | ||
interface_only | Boolean | true , false | No | |
password | String | No | ||
password_hidden | Boolean | true , false | No | |
password_secret | Boolean | true , false | No | |
pruning | Boolean | true , false | No | |
domain | String | No | ||
mode | Choice | client , off , server , transparent | No | |
mode_instance | Choice | mst , unknown , vlan | No |
By centralizing VLAN management, VTP reduces administrative overhead and ensures consistent VLAN configurations across all switches in a VTP domain, preventing misconfigurations and improving network stability.
VTP Parameters
- VTP domain name
- VTP mode (server, client, transparent)
- VTP version
- VTP password
- VTP pruning
- VTP database file
- Interface type/ID (for interface-specific VTP settings)
You can use these VTP parameters to define how your network manages VLANs centrally. Customize the domain, mode, version, and other settings to fit your network’s VLAN management and operational needs. Adjusting these parameters lets you tailor VLAN propagation and consistency for your environment.
Examples
vtp mode server
- Sets the VTP operational mode to server, allowing the switch to create, modify, and delete VLANs and propagate these changes.
vtp domain CiscoNet
- Configures the VTP management domain name, which must match across all switches intended to share VLAN information.
vtp password mysecret
- Sets the VTP password for authentication, ensuring only authorized switches can participate in the VTP domain.
vtp version 2
- Specifies the VTP protocol version to be used, affecting compatibility and feature support (e.g., VTPv3 supports extended VLANs).
vtp pruning
- Enables VTP pruning, which prevents unnecessary broadcast, unknown unicast, and multicast traffic from being sent over trunk links to switches that do not have active ports for a particular VLAN.
Sample Configuration
The following configuration describes how to set up VTP on a Cisco device. It includes setting the VTP mode, domain name, password, version, and enabling pruning for efficient VLAN management.
vtp mode servervtp domain COMPANY-DOMAINvtp password VtpSecurePassword123vtp version 3vtp pruning
Example YAML Code
The following YAML code sets up VTP on an IOS-XE device, specifying the VTP mode, domain, version, password, and pruning settings for centralized VLAN management.
iosxe: devices: - name: Device1 configuration: vtp: file: vtp-database version: 3 interface_type: GigabitEthernet interface_id: "0/0/1" interface_only: false password: VtpSecurePassword123 password_hidden: true password_secret: true pruning: true domain: COMPANY-DOMAIN mode: server mode_instance: vlan