To set or modify the VLAN Trunking Protocol (VTP) configuration characteristics, use the vtp command in global configuration mode. To remove the settings or to return to the default settings, use the no form of this command.
vtp {domain domain-name | file filename | interface interface-name [only] | mode {client | off | server | transparent} [mst | unknown | vlan] | password password [hidden | secret] | pruning | version number}
no vtp {file | interface | mode [client | off | server | transparent] [mst | unknown | vlan] | password | pruning | version}
Syntax Description
domain domain-name
|
Specifies the VTP domain name, an ASCII string from 1 to 32 characters that identifies the VTP administrative domain for the
device. The domain name is case sensitive.
|
file filename
|
Specifies the Cisco IOS file system file where the VTP VLAN configuration is stored.
|
interface interface-name
|
Specifies the name of the interface providing the VTP ID updated for this device.
|
only
|
(Optional) Uses only the IP address of this interface as the VTP IP updater.
|
mode
|
Specifies the VTP device mode as client, server, or transparent.
|
client
|
Places the device in VTP client mode. A device in VTP client mode is enabled for VTP, and can send advertisements, but does
not have enough nonvolatile storage to store VLAN configurations. You cannot configure VLANs on a VTP client. VLANs are configured
on another device in the domain that is in server mode. When a VTP client starts up, it does not send VTP advertisements until
it receives advertisements to initialize its VLAN database.
|
off
|
Places the device in VTP off mode. A device in VTP off mode functions the same as a VTP transparent device except that it
does not forward VTP advertisements on trunk ports.
|
server
|
Places the device in VTP server mode. A device in VTP server mode is enabled for VTP and sends advertisements. You can configure
VLANs on the device. The device can recover all the VLAN information in the current VTP database from nonvolatile storage
after reboot.
|
transparent
|
Places the device in VTP transparent mode. A device in VTP transparent mode is disabled for VTP, does not send advertisements
or learn from advertisements sent by other devices, and cannot affect VLAN configurations on other devices in the network.
The device receives VTP advertisements and forwards them on all trunk ports except the one on which the advertisement was
received.
When VTP mode is transparent, the mode and domain name are saved in the device running configuration file, and you can save
them in the device startup configuration file by entering the copy running-config startup config privileged EXEC command.
|
mst
|
(Optional) Sets the mode for the multiple spanning tree (MST) VTP database (only VTP Version 3).
|
unknown
|
(Optional) Sets the mode for unknown VTP databases (only VTP Version 3).
|
vlan
|
(Optional) Sets the mode for VLAN VTP databases. This is the default (only VTP Version 3).
|
password password
|
Sets 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 password can be an ASCII string from 1 to 32 characters.
The password is case sensitive.
|
hidden
|
(Optional) Specifies that the key generated from the password string is saved in the VLAN database file. When the hidden keyword is not specified, the password string is saved in clear text. When the hidden password is entered, you need to reenter
the password to issue a command in the domain. This keyword is supported only in VTP Version 3.
|
secret
|
(Optional) Allows the user to directly configure the password secret key (only VTP Version 3).
|
pruning
|
Enables VTP pruning on the device.
|
version number
|
Sets the VTP Version to Version 1, Version 2, or Version 3.
|
Command Default
The default filename is flash:vlan.dat.
The default mode is server mode and the default database is VLAN.
In VTP Version 3, for the MST database, the default mode is transparent.
No domain name or password is defined.
No password is configured.
Pruning is disabled.
The default version is Version 1.
Command Modes
Global configuration
Command History
Release |
Modification |
Cisco IOS XE Everest 16.5.1a
|
This command was introduced.
|
Usage Guidelines
When you save VTP mode, domain name, and VLAN configurations in the device startup configuration file and reboot the device,
the VTP and VLAN configurations are selected by these conditions:
-
If the VTP mode is transparent in the startup configuration and the VLAN database and the VTP domain name from the VLAN database
matches that in the startup configuration file, the VLAN database is ignored (cleared), and the VTP and VLAN configurations
in the startup configuration file are used. The VLAN database revision number remains unchanged in the VLAN database.
-
If the VTP mode or domain name in the startup configuration do not match the VLAN database, the domain name and VTP mode
and configuration for VLAN IDs 1 to 1005 use the VLAN database information.
The vtp file filename cannot be used to load a new database; it renames only the file in which the existing database is stored.
Follow these guidelines when configuring a VTP domain name:
-
The device is in the no-management-domain state until you configure a domain name. While in the no-management-domain state,
the device does not send any VTP advertisements even if changes occur to the local VLAN configuration. The device leaves the
no-management-domain state after it receives the first VTP summary packet on any port that is trunking or after you configure
a domain name by using the vtp domain command. If the device receives its domain from a summary packet, it resets its configuration revision number to 0. After
the device leaves the no-management-domain state, it cannot be configured to reenter it until you clear the NVRAM and reload
the software.
-
Domain names are case-sensitive.
-
After you configure a domain name, it cannot be removed. You can only reassign it to a different domain.
Follow these guidelines when setting VTP mode:
-
The no vtp mode command returns the device to VTP server mode.
-
The vtp mode server command is the same as no vtp mode except that it does not return an error if the device is not in client or transparent mode.
-
If the receiving device is in client mode, the client device changes its configuration to duplicate the configuration of the
server. If you have devices in client mode, be sure to make all VTP or VLAN configuration changes on a device in server mode,
as it has a higher VTP configuration revision number. If the receiving device is in transparent mode, the device configuration
is not changed.
-
A device in transparent mode does not participate in VTP. If you make VTP or VLAN configuration changes on a device in transparent
mode, the changes are not propagated to other devices in the network.
-
If you change the VTP or VLAN configuration on a device that is in server mode, that change is propagated to all the devices
in the same VTP domain.
-
The vtp mode transparent command disables VTP from the domain but does not remove the domain from the device.
-
In VTP Versions 1 and 2, the VTP mode must be transparent for VTP and VLAN information to be saved in the running configuration
file.
-
With VTP Versions 1 and 2, you cannot change the VTP mode to client or server if extended-range VLANs are configured on the
switch. Changing the VTP mode is allowed with extended VLANs in VTP Version 3.
-
The VTP mode must be transparent for you to add extended-range VLANs or for VTP and VLAN information to be saved in the running
configuration file.
-
VTP can be set to either server or client mode only when dynamic VLAN creation is disabled.
-
The vtp mode off command sets the device to off. The no vtp mode off command resets the device to the VTP server mode.
Follow these guidelines when setting a VTP password:
-
Passwords are case sensitive. Passwords should match on all devices in the same domain.
-
When you use the no vtp password form of the command, the device returns to the no-password state.
-
The hidden and secret keywords are supported only in VTP Version 3. If you convert from VTP Version 2 to VTP Version 3, you must remove the hidden
or secret keyword before the conversion.
Follow these guidelines when setting VTP pruning:
-
VTP pruning removes information about each pruning-eligible VLAN from VTP updates if there are no stations belonging to that
VLAN.
-
If you enable pruning on the VTP server, it is enabled for the entire management domain for VLAN IDs 1 to 1005.
-
Only VLANs in the pruning-eligible list can be pruned.
-
Pruning is supported with VTP Version 1 and Version 2.
Follow these guidelines when setting the VTP version:
-
Toggling the Version 2 (v2) mode state modifies parameters of certain default VLANs.
-
Each VTP device automatically detects the capabilities of all the other VTP devices. To use Version 2, all VTP devices in
the network must support Version 2; otherwise, you must configure them to operate in VTP Version 1 mode.
-
If all devices in a domain are VTP Version 2-capable, you only need to configure Version 2 on one device; the version number
is then propagated to the other Version-2 capable devices in the VTP domain.
-
If you are using VTP in a Token Ring environment, VTP Version 2 must be enabled.
-
If you are configuring a Token Ring bridge relay function (TrBRF) or Token Ring concentrator relay function (TrCRF) VLAN media
type, you must use Version 2.
-
If you are configuring a Token Ring or Token Ring-NET VLAN media type, you must use Version 1.
-
In VTP Version 3, all database VTP information is propagated across the VTP domain, not only VLAN database information.
-
Two VTP Version 3 regions can only communicate over a VTP Version 1 or VTP Version 2 region in transparent mode.
You cannot save password, pruning, and version configurations in the device configuration file.
Examples
This example shows how to rename the filename for VTP configuration storage to vtpfilename:
Device(config)# vtp file vtpfilename
This example shows how to clear the device storage filename:
Device(config)# no vtp file vtpconfig
Clearing device storage filename.
This example shows how to specify the name of the interface providing the VTP updater ID for this device:
Device(config)# vtp interface gigabitethernet
This example shows how to set the administrative domain for the device:
Device(config)# vtp domain OurDomainName
This example shows how to place the device in VTP transparent mode:
Device(config)# vtp mode transparent
This example shows how to configure the VTP domain password:
Device(config)# vtp password ThisIsOurDomainsPassword
This example shows how to enable pruning in the VLAN database:
Device(config)# vtp pruning
Pruning switched ON
This example shows how to enable Version 2 mode in the VLAN database:
Device(config)# vtp version 2
You can verify your settings by entering the show vtp status privileged EXEC command.