How to Implement VTP Protocol using Two Switch

Posted on

Introduction

This article is showing how to try to implement VTP protocol using two switch as an example. The implementation is using an application simulator such as Cisco Packet Tracer or GNS3. So, the main purpose is to have a switch running in a VTP server mode and the other switch running in a VTP client mode. Using these kinds of setting, VLANs can be implemented across all switches without having bother to add it one by one in each switches. Just add the VLAN in the switch running in a VTP server mode and it will be implemented across all switches connected in a VTP client mode. The configuration itself consists of two parts. The first one is the configuration on the switch running in a VTP server mode. The other one is the configuration on the switch running in a VTP client mode.

Furthermore, in the switch running in a VTP server mode, there is an additional configuration. It is to set the interface connected to the other switch into a trunk mode. What is the main purpose to configure the connected interface into a trunk mode ?. It enable to pass VLAN information between switches. A port running in the trunk mode is by default will be a member of all the VLANs that exist on the switch and carry traffic for all those VLANs between the switches. In order to distinguish between the traffic flows, a port running in the trunk mode must mark the frames with special tags as they pass between the switches. So, trunk mode is a function that must be enabled on both sides of a link. If two switches are connected together, for example, both switch ports must be configured for trunking, and they must both be configured with the same tagging mechanism.

The following is the network schema image of the design for simulating the implementation of VTP protocol using two switch :

How to Implement VTP Protocol using Two Switch
How to Implement VTP Protocol using Two Switch

 

Configuring Switch Running in a VTP server mode

The following part is the step for configuring switch running in a VTP server mode :

1. Access the switch. After that, execute the following command to switch from User EXEC mode to Privileged EXEC mode.

Switch>ena
Switch#

2. Furthermore, switch to the Global Configuration Command mode from the Privileged EXEC mode by executing the following command :

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#

3. Set the switch to run in a VTP server mode. Actually, the execution of those commands consists of these following steps :

Defining the vtp mode by executing the following command :

Switch(config)#vtp mode server
Device mode already VTP SERVER.
Switch(config)#

Defining the VTP domain where all the switches in that domain will receive these VTP updates by executing the command pattern below :

vtp domain vtp_domain_name

An example for defining the VTP domain name with a name of ‘cisco’ exist as follows :

Switch(config)#vtp domain cisco
Changing VTP domain name from NULL to cisco
Switch(config)#

Furthermore, defining the password to secure the VTP advertisements for the VTP domain definition with the following command pattern :

vtp password vtp_password

So, using the above pattern, for an example as an easy one, ‘cisco’ as the password chosen, just type into the command below :

Switch(config)#vtp password cisco
Setting device VLAN database password to cisco
Switch(config)#

3. Run the command for setting the connected port or interface of the switch running in a VTP server mode with the other one running in a VTP client mode as a trunk mode.

The following are the steps to accomplish it :

In the Global Configuration Command mode, access the Interface Configuration Mode as follows :

Switch(config)#int fa0/24
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up

Switch(config-if)#do wr
Building configuration...
[OK]
Switch(config-if)#exit
Switch(config)#exit
Switch#

Finishing the above command execution, the configuration process in the switch running in a VTP server mode is done.

 

Configuring Switch Running in a VTP client mode

Another important part is to configure the connected switch via the trunk mode port into a switch running in a VTP client mode. The following part is the step for configuring switch running in a VTP client mode :

1. Access the switch. Follow the same process with the previous one, switch from the User EXEC mode to the Privileged EXEC mode :

Switch>ena
Switch#

2. After that, execute the following command to switch to the Global Configuration Command mode :

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#

3. Continue on the previous step, set the switch to run in a VTP client mode. Similarly with the previous configuration of VTP server, the execution of those commands consists of these following steps :

Defining the vtp mode by executing the following command :

Switch(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch(config)#

Set the domain name of the switch running in VTP client mode with the same name of the switch running in VTP server mode. In this context, the domain name is ‘cisco’. So, define it also as the domain name definition above as follows :

Switch(config)#vtp domain cisco
Changing VTP domain name from NULL to cisco
Switch(config)#

As in the previous part for configuring the switch running in VTP server mode, do not forget to set the password as follows using the same password which in this context is ‘cisco’ :

Switch(config)#vtp password cisco
Setting device VLAN database password to cisco
Switch(config)#

By executing the last command above, it ends the configuration process of switch running in VTP client mode.

 

Add VLAN in the Switch Running in a VTP server mode


The last part is the part for testing the VTP implementation. In order to test the VTP implementation, just add a new VLAN in the switch running in an VTP server mode. There are several steps for adding a new VLAN, those steps are in the following sequence :

Switch from the User Level Mode to the Privileged Level Mode as follows :

Switch>ena 
Switch# 

Access VLAN database by executing the following command :

Switch#vlan database 
% Warning: It is recommended to configure VLAN from config mode, as VLAN database mode is being deprecated. 
Please consult user documentation for configuring VTP/VLAN in config mode. 
Switch(vlan)#

Finally, add a new vlan by typing the following command :

Switch(vlan)#vlan 10 
VLAN 10 added: Name: VLAN0010 
Switch(vlan)#vlan 20 
VLAN 20 added: Name: VLAN0020 
Switch(vlan)#vlan 30 
VLAN 30 added: Name: VLAN0030 
Switch(vlan)#vlan 40 
VLAN 40 added: Name: VLAN0040 
Switch(vlan)#exit 
APPLY completed. Exiting....

The above process for adding a new VLAN in the switch running in a VTP server mode is a success. Just execute the following command to check the status of the vtp mode and also the existing VLAN :

Switch#sh vlan br

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23
10   VLAN0010                         active    
20   VLAN0020                         active    
30   VLAN0030                         active    
40   VLAN0040                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
Switch#
Switch#sh vtp status
VTP Version                     : 2
Configuration Revision          : 12
Maximum VLANs supported locally : 255
Number of existing VLANs        : 9
VTP Operating Mode              : Server
VTP Domain Name                 : cisco
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xCC 0x59 0x9E 0x9F 0xEE 0x47 0xB2 0x17 
Configuration last modified by 0.0.0.0 at 3-1-93 00:16:46
Local updater ID is 0.0.0.0 (no valid interface found)
Switch#

As expected of the above command output, there are four new VLANs. The second command execution which is ‘vtp status’ is also showing the status of the vtp mode. The command execution is just a prove to show that the execution for adding a new VLAN exist in the switch running in the VTP server mode.

The last step, check the new VLANs in the switch running in a VTP client mode :

Switch>ena
Switch#sh vlan br

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23
10   VLAN0010                         active    
20   VLAN0020                         active    
30   VLAN0030                         active    
40   VLAN0040                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
Switch#sh vtp status
VTP Version                     : 2
Configuration Revision          : 12
Maximum VLANs supported locally : 255
Number of existing VLANs        : 9
VTP Operating Mode              : Client
VTP Domain Name                 : cisco
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xCC 0x59 0x9E 0x9F 0xEE 0x47 0xB2 0x17 
Configuration last modified by 0.0.0.0 at 3-1-93 00:16:46
Switch#

As in the above command execution, it is showing the prove that VLANs exist in the switch running in a VTP client mode without having to add it manually. Because the switch running in a VTP server mode will pass or forward the VLANs information to the other connected switch running in a VTP client mode. In the end, every connected switch running in a VTP client mode will automatically create all those new VLANs.

One thought on “How to Implement VTP Protocol using Two Switch

Leave a Reply