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
switch. 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
switch in VTP client mode. A
switch 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
switch 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
switch in VTP off mode. A
switch 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
switch in VTP server mode. A
switch in VTP server mode is enabled for
VTP and sends advertisements. You can configure VLANs on the
switch. The
switch can recover all the VLAN information
in the current VTP database from nonvolatile storage after reboot.
|
transparent
|
Places the
switch in VTP transparent mode. A
switch 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
switch 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
switch running configuration file, and you
can save them in the
switch 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
switch.
|
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 Release 15.0(2)EX
|
This command was introduced.
|
Usage Guidelines
VTP Version 3 is supported
only when the switch is running the
LAN Base image.
When you save VTP
mode, domain name, and VLAN configurations in the
switch startup configuration file and
reboot the
switch, 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
switch is in the no-management-domain state
until you configure a domain name. While in the no-management-domain state, the
switch does not send any VTP advertisements
even if changes occur to the local VLAN configuration. The
switch 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
switch receives its domain from a summary
packet, it resets its configuration revision number to 0. After the
switch 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
switch 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
switch is not in client or transparent
mode.
-
If the
receiving
switch is in client mode, the client
switch changes its configuration to
duplicate the configuration of the server. If you have
switches in client mode, be sure to make all
VTP or VLAN configuration changes on a
switch in server mode, as it has a higher
VTP configuration revision number. If the receiving
switch is in server mode or transparent
mode, the
switch configuration is not changed.
-
A
switch in transparent mode does not
participate in VTP. If you make VTP or VLAN configuration changes on a
switch in transparent mode, the changes are
not propagated to other
switches in the network.
-
If you change
the VTP or VLAN configuration on a
switch that is in server mode, that change
is propagated to all the
switches in the same VTP domain.
-
The
vtp mode
transparent command disables VTP from the domain but does not
remove the domain from the
switch.
-
In VTP
Versions 1 and 2, 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 supports extended-range VLANs in client and server mode
and saves them in the VLAN database.
-
With VTP
Versions 1 and 2, if extended-range VLANs are configured on the
switch and you attempt to set the VTP mode
to server or client, you receive an error message, and the configuration is not
allowed. Changing 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
switches in the same domain.
-
When you use
the
no vtp
password form of the command, the
switch 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
switch automatically detects the
capabilities of all the other VTP devices. To use Version 2, all VTP
switches in the network must support Version
2; otherwise, you must configure them to operate in VTP Version 1 mode.
-
If all
switches in a domain are VTP Version
2-capable, you only need to configure Version 2 on one
switch; the version number is then
propagated to the other Version-2 capable
switches 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
switch configuration file.
Examples
This example shows
how to rename the filename for VTP configuration storage to vtpfilename:
Switch(config)# vtp file vtpfilename
This example shows
how to clear the device storage filename:
Switch(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:
Switch(config)# vtp interface gigabitethernet
This example shows
how to set the administrative domain for the
switch:
Switch(config)# vtp domain OurDomainName
This example shows
how to place the
switch in VTP transparent mode:
Switch(config)# vtp mode transparent
This example shows
how to configure the VTP domain password:
Switch(config)# vtp password ThisIsOurDomainsPassword
This example shows
how to enable pruning in the VLAN database:
Switch(config)# vtp pruning
Pruning switched ON
This example shows
how to enable Version 2 mode in the VLAN database:
Switch(config)# vtp version 2
You can verify
your settings by entering the
show vtp
status privileged EXEC command.