VTP configuration is very straightforward and is performed by issuing the vtp [keyword] global configuration command. The keywords available with this command are illustrated in the following switch output:
| VTP-Server(config)#vtp ? domain Set the name of the VTP administrative domain. file Configure IFS filesystem file where VTP configuration is stored. interface Configure interface as the preferred source for the VTP IP updater address. mode Configure VTP device mode password Set the password for the VTP administrative domain pruning Set the administrative domain to permit pruning version Set the administrative domain to VTP version |
The options printed above will be described in the following section.
Configuring the VTP Domain Name
The VTP domain is configured via the vtp domain [name] global configuration command. The domain name is a case sensitive ASCII string from 1 to 32 characters. The following output illustrates how to configure a switch with the VTP domain name howtonetwork.net:
| VTP-Server(config)#vtp domain howtonetwork.net Changing VTP domain name from cisco to howtonetwork.net VTP-Server(config)#exit |
The configuration VTP domain name can be viewed in the output of the show vtp status command as illustrated below:
| VTP-Server#show vtp status … VTP Domain Name : howtonetwork.net VTP Pruning Mode : Enabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x8E 0x85 0x23 0xAA 0x6E 0x7F 0xBF 0x16 Configuration last modified by 10.1.1.1 at 3-2-93 05:53:25 … |
Renaming the VTP Database
By default, VTP and VLAN information is stored in the vlan.dat file in Flash memory. This file can be seen in the output of the show flash command as illustrated below:
| VTP-Server#show flashDirectory of flash:/
2 -rwx 2888547 Mar 01 1993 00:03:33 c2950-i6q4l2-mz.121-13.EA1.bin 7741440 bytes total (2867200 bytes free) |
The vtp filename [name] global configuration command can be used to change this default name to any other desired name. Although the file name can be changed, it is important to remember that this command cannot be used to load a new database. In other words, the same information is retained, only in a file with a different name. The following output illustrates how to rename the VLAN configuration file:
| VTP-Server(config)#vtp file myvlaninfo Setting device to store VLAN database at filename myvlaninfo. VTP-Server(config)#exit |
Again, the show flash command can be used to verify the file in Flash memory as follows:
| VTP-Server#show flashDirectory of flash:/
2 -rwx 2888547 Mar 01 1993 00:03:33 c2950-i6q4l2-mz.121-13.EA1.bin |
NOTE: In the output above, notice that the vlan.dat file is also still present. The renamed file contains all the VLAN information from the vlan.dat file but all new changes, etc., are stored in the new file and not the vlan.dat file. For example, if several new VLANs were created on the switch, only the size of the newly named file would increment as illustrated below:
| VTP-Server(config-vlan)#vlan 60 VTP-Server(config-vlan)#name Test-VLAN-60 VTP-Server(config-vlan)#vlan 70 VTP-Server(config-vlan)#name Test-VLAN-70 VTP-Server(config-vlan)#vlan 80 VTP-Server(config-vlan)#name Test-VLAN-80 VTP-Server(config-vlan)#vlan 90 VTP-Server(config-vlan)#name Test-VLAN-90 VTP-Server(config-vlan)#end VTP-Server# VTP-Server#show flash:Directory of flash:/ 2 -rwx 2888547 Mar 01 1993 00:03:33 c2950-i6q4l2-mz.121-13.EA1.bin 7741440 bytes total (2865664 bytes free) |
Changing the VTP IP Updater Address
The vtp interface [name] [only] global configuration command is used to specify the name of the interface providing the VTP ID updated for this device. The [only] keyword provides an additional capability to force the switch to use only the IP address of the specified interface as the VTP IP updater. The following output illustrates how to force the switch to use only the IP address of interface VLAN 10 as the VTP IP updater:
| VTP-Server#conf t Enter configuration commands, one per line. End with CNTL/Z. VTP-Server(config)#vtp interface vlan10 only VTP-Server(config)#exit |
This option allows administrators to specify a desired interface, such as the IP address of the management VLAN, on switches with multiple interfaces. This configuration can be validated in the following output illustrating theshow vtp status command:
| VTP-Server#show vtp status … [Truncated Output] Configuration last modified by 10.1.1.1 at 3-2-93 05:53:25 Local updater ID is 10.1.1.1 on interface Vl10 (preferred interface) Preferred interface name is vlan10 (mandatory) |
Configuring the VTP Mode
By default, all Cisco Catalyst switches default to a VTP mode of server. This default behavior can be adjusted via the vtp mode [mode] global configuration command. The following configuration output illustrates how to disable VTP on the switch (i.e. transparent mode):
| VTP-Server(config)#vtp mode transparent Setting device to VTP TRANSPARENT mode. VTP-Server(config)#exit |
The configured VTP mode can be viewed in the following output illustrating the show vtp status command:
| VTP-Server#show vtp status … VTP Operating Mode : Transparent VTP Domain Name : howtonetwork.net VTP Pruning Mode : Enabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x8E 0x85 0x23 0xAA 0x6E 0x7F 0xBF 0x16 Configuration last modified by 10.1.1.1 at 3-2-93 05:53:25 |
Configuring the VTP Password
The vtp password [password] global configuration command is used to set the administrative domain password for the generation of the 16-byte secret value used in MD5 digest calculation to be sent in VTP advertisements and to validate received VTP advertisements. The VTP password can be an ASCII string from 1 to 32 characters. The password is case sensitive. The following output illustrates how to configure the VTP password on a switch:
| VTP-Server(config)#vtp password ccnp-here-i-come Setting device VLAN database password to ccnp-here-i-come VTP-Server(config)#exit |
The show vtp password command is used to view the current VTP password in plaintext as follows:
| VTP-Server#show vtp password VTP Password: ccnp-here-i-come |
Configuring VTP Pruning
VTP pruning is enabled globally on the VTP server via the vtp pruning global configuration command. By default, VLAN 1 and VLANs 1002 to 1005 are always pruning-ineligible; however, any other VLANs can be pruned. The following configuration output demonstrates how to enable VTP pruning on a VTP server:
| VTP-Server#conf t Enter configuration commands, one per line. End with CNTL/Z. VTP-Server(config)#vtp pruning Pruning switched on VTP-Server(config)#exit |
This configuration can be validated using the show vtp status command as follows:
| VTP-Server#show vtp status … VTP Operating Mode : Server VTP Domain Name : howtonetwork.net VTP Pruning Mode : Enabled … |
This same state can also be verified on all VTP clients in the management domain as illustrated in the following output:
| VTP-Client#show vtp status … VTP Operating Mode : Client VTP Domain Name : howtonetwork.net VTP Pruning Mode : Enabled … |
In some cases, administrators may want to change the default pruning of all prune-eligible VLANs. Cisco IOS software provides this flexibility via the use of the switchport trunk pruning vlan interface configuration command. The options available with this command are as follows:
| VTP-Server(config)#interface fastethernet 0/1 VTP-Server(config-if)#switchport trunk pruning vlan ? WORD VLAN IDs of the allowed VLANs when this port is in trunking mode add add VLANs to the current list except all VLANs except the following none no VLANs remove remove VLANs from the current list |
The VLAN list allows administrators to manually specify the VLANs they want pruned when pruning has been enabled. The add keyword is used to add to the current list of VLANs being pruned. The except keyword excludes the specified VLANs from being pruned. The none keyword prevents all VLANs from being pruned on the trunk link. The remove keyword removes prune-eligible VLANs from the current pruned VLAN list.
The following output illustrates how to prevent all VLANs from being pruned on a trunk interface (port):
| VTP-Server(config)#interface fastethernet0/1 VTP-Server(config-if)#switchport trunk pruning vlan none VTP-Server(config-if)#exit |
The following output illustrates how to allow only VLANs 10, 20, and 30 to be pruned:
| VTP-Server(config)#interface fastethernet 0/2 VTP-Server(config-if)#switchport trunk pruning vlan 10,20,30 VTP-Server(config-if)#exit |
Pruning configuration applied to trunk ports can be validated by issuing the show interfaces [name] switchportcommand as illustrated in the following output:
| VTP-Server#show interfaces fastethernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q … Trunking VLANs Enabled: 1,10,20,30,40,50 Pruning VLANs Enabled: NONE … VTP-Server# VTP-Server# VTP-Server#show interfaces fastethernet 0/2 switchport Name: Fa0/2 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q … Trunking VLANs Enabled: 1-99,201-4094 Pruning VLANs Enabled: 10,20,30 … |
Additionally, the show interfaces trunk command can be used to view trunking information, including pruning configuration, for all configured trunks on the switch:
| VTP-Server#show interfaces trunkPort Mode Encapsulation Status Native vlan Fa0/1 on 802.1q trunking 1 Fa0/2 desirable 802.1q trunking 1 Fa0/3 desirable 802.1q trunking 1 Port Vlans allowed on trunk Port Vlans allowed and active in management domain Port Vlans in spanning tree forwarding state and not pruned |
Configuring the VTP Version
The default VTP version used in Cisco Catalyst switches is VTP version 1. To change the default VTP version, thevtp version [version] global configuration command can be used as illustrated in the following output:
| VTP-Server(config)#vtp version ? <1-2> Set the administrative domain VTP version number |
NOTE: Keep in mind that VTP version 3 is available only in a select few Cisco Catalyst switches, such as the Catalyst 6500 series switches.