VTP (VLAN Trunking Protocol) is a Layer 2 Protocol developed by Cisco. It allows to control, create and delete VLANs from a central VTP Server. In a small network, it is easy to manage VLANs. But in large networks there can be many switches and manual VLAN configuration on theseswitches can be very difficult one by one. So VTP helps us to configure VLANs in one VTP Server and then generate this information to other switches. With this syncronization mechanism, other switches in the VTP domain can be created and updated.
VLAN Trunking Protocol (VTP) is rarely used today. Because using this protocol is a little risky. If you do not manage this mechanism good, it can damage your network configuration with its syncronization mechanism.
There are different VTP modes used in this mechanism. These modes are given below:
So what is the differenfces between these VTP modes? Now, let’s check each of these modes.
VTP Server mode is the active mode. You can create, delete and modify VLANs on this mode. It advertise any VLAN update about the VLANs to the other switches in the same VTP domain. Here, the key point is configuration revision number. According to this number, the latest configuration is set on the other switches. The highest number is the latest configuration. VTP Server stores VLAN database in NVRAM. Cisco switches are in VTP Server mode by default. If you do not configure any mode on a Cisco switch, it is in VTP Server mode.
VTP Client Mode is the passive VTP mode that waits for VLAN information from VTP Server. On this mode, you can not add, modify and delete any VLANs. Switches in client mode receives updates and advertise them to other clients. Except VTPv3, VLAN database does not stored in NVRAM.
VTP Transparent Mode is a special mode. It only creates, deletes and modifies its own VLANs and never update its VLANs by other VTP information coming from VTP Servers. In other words, a switch in VTP Transparent mode is not synchronized. But they can forward VTP information that they get from a VTP Server.
To configure VTP modes we use “vtp mode mode” command.
Switch(config)# vtp mode server
Switch(config)# vtp mode client
Switch(config)# vtp mode transparent
VTP uses a syncronization mechanism. With this mechanism, the latest configuration is advertised to the VTP Clients in the VTP Domain. In this syncronization, configuration revision numbers are very important. The highest configuration register shows the latest configuration. This latest configuration is sent to the other VTP Clients.
For the below example, VTP Server has three VLANs (VLAN 10,20,30). With syncronization, this configuration is sent to the VTP Clients.
Here, there are two clients. But what if there are tens or hundreds of switches? At this time, the imporatance of this syncronization mechanims is understood better.
VLAN Trunking Protocol packets are sent every 5 seconds or after a VLAN information change occurs.
VTP is used in a VTP Domain. So, to use it, firstly we need to configure VTP Domain. The switches in the same VTP domain are syncronized with the same VLAN information. Below, we will configure domain name as ipcisco and password as abc123.
Switch(config)# vtp domain ipcisco
Switch(config)# vtp password abc123
Configuration revision number is an 32 bits number used in VTP mechanism for VLAN updates. This number shows if the configuration up to date or not. For every VLAN update configuratoin revision number is increased one. And the switch which has the highest configuration revision number, has the latest VLAN information. So, the other switches are updated with the configuration of this up to date switch.
The switch which has the highest configuration revision number is generally a VTP Server. But sometimes, there are more than one VTP Server. At that time, the other one is updated with the VTP server which has the highest revision number.
When a switch receives an update which has higher revision number it updates its database. If both revision numbers are same, then it only forwards to the other switches.
Adding a new switch to a VTP domain is a little risky. Such a work can damage your network configuration and can cause unwanted situations in the network. For example, if the newly-added switch has a higher configuration revision number and has different VLAN configuration. Then, the domain is sycnronized with this new switch and all the swithces are updated with the old switch’s VLAN information.
So, before adding a switch, we can do two things for not to damage our existing configuration. We can set the VTP mode of this newly-added switch as Transparent. Or we can change its domain name to an unused domain name. Both of these solutions resets configuration revision number to 0.
After adding setting the new switch VTP mode as Transparent and add the newtork, then, we can change this moda as VTP client. By doing this, new switch can be updated by the existing VTP Server. Because, new switch’s configuration revision number is 0.
What if we do not do anything and add a switch directly to the network? At that time, this newly-added switch can damage our exsiting configuration. For example we add an old switch which has an higher configuration revision number.
At this time, the added switch has a higher configuration revision number. So, it will sent advertisements to the other switches to update them. And the network will be configured wronly.
After the configuration or during the operation, we can check VLAN Trunking Protocol information of a switch with “show vtp status” command.
Switch# show vtp status