Configure VLAN Trunking Protocol (VTP) in Cisco IOS Switch

Spread the love




When you have dozens or more number of switches in your network, managing VLAN becomes difficult. VLAN Trunking Protocol (VTP) simplifies creation and management of VLANs in network. Before you configure VLANs, you need to understand the basics of VTP protocol. In this post, I will show steps to Configure VLAN Trunking Protocol (VTP) in Cisco IOS Switch.

Configure VLAN Trunking Protocol (VTP) in Cisco IOS Switch

The diagram below shows simple switching topology. I will configure SwitchA in VTP Server mode, SwitchB and SwitchD in VTP Client mode and SwitchC in VTP Transparent mode. I will use VTP version 2, domain name mustbegeek.com and password mustbegeek. I will create VLANs 10, 20 and 30 in SwitchA and these VLANs should automatically replicate to SwitchB and SwitchD but not SwitchC.

Configure VLAN Trunking Protocol (VTP) in Cisco IOS Switch

Let’s start with SwitchA. First, let’s configure VLANs.

SwitchA(config)#vlan 10
SwitchA(config-vlan)#exit
SwitchA(config)#vlan 20
SwitchA(config-vlan)#exit
SwitchA(config)#vlan 30

Above commands creates three VLANs 10, 20 and 30. For verification, type show vlan brief command as shown below. As you can see below, VLANs 10, 20 and 30 have been created.



SwitchA#show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    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, Fa0/24, Gig0/1
                                                Gig0/2
10   VLAN0010                         active    
20   VLAN0020                         active    
30   VLAN0030                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active

Now, configure TRUNK ports on Fa0/1 and Fa0/2 of SwitchA.

SwitchA(config)#int fa0/1
SwitchA(config-if)#switchport trunk encapsulation dot1q 
SwitchA(config-if)#switchport mode trunk
SwitchA(config)#int fa0/2 
SwitchA(config-if)#switchport trunk encapsulation dot1q 
SwitchA(config-if)#switchport mode trunk

Now, create TRUNK ports in SwitchB, SwitchC and SwitchD. Repeat same commands on SwitchC and SwitchD.

SwitchB(config)#int fa0/1
SwitchB(config-if)#switchport trunk encapsulation dot1q 
SwitchB(config-if)#switchport mode trunk

Type show interfaces trunk to verify TRUNK ports. Type show interfaces trunk in SwitchA as shown below. As you can see blow, SwitchA have two TRUNK ports, Fa0/1 and Fa0/2.

SwitchA#show interfaces trunk 
Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1
Fa0/2       on           802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/1       1-1005
Fa0/2       1-1005

Port        Vlans allowed and active in management domain
Fa0/1       1,10,20,30
Fa0/2       1,10,20,30

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1,10,20,30
Fa0/2       1,10,20,30

Now, let’s configure VLAN Trunking Protocol (VTP) protocol on SwitchA.

SwitchA(config)#vtp mode server 
Device mode already VTP SERVER.
SwitchA(config)#vtp domain mustbegeek.com
Changing VTP domain name from NULL to mustbegeek.com
SwitchA(config)#vtp version 2
SwitchA(config)#vtp password mustbegeek
Setting device VLAN database password to mustbegeek

By default, the VTP modes are always server as you can see the message “Device mode already VTP server”. The command vtp mode server sets the VTP mode to server. Command vtp domain mustbegeek.com sets the VTP domain name to mustbegeek.com. All the switches where you want the VTP advertisement to reach must have same domain name. Command vtp version 2 sets the VTP protocol to version 2. There are three different versions of VTP, 1, 2 and 3. Command vtp password mustbegeek sets the password.

Now configure VTP protocol on SwitchB and SwitchD. Here, VTP mode will be client.

SwitchB(config)#vtp version 2
SwitchB(config)#vtp password mustbegeek
Setting device VLAN database password to mustbegeek
SwitchB(config)#vtp mode client 
Setting device to VTP CLIENT mode.

Here is the configuration for SwitchD. VTP mode is set to client as shown below.

SwitchD(config)#vtp version 2
SwitchD(config)#vtp password mustbegeek
SettinD device VLAN database password to mustbegeek
SwitchD(config)#vtp mode client 
SettinD device to VTP CLIENT mode.

Now, configure SwitchC as VTP mode Transparent.

SwitchC(config)#vtp version 2
SwitchC(config)#vtp password mustbegeek
Setting device VLAN database password to mustbegeek
SwitchC(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.

To verify the VTP status, type show vtp status command. Let’s view this in SwitchA first.

SwitchA(config)#do show vtp status
VTP Version                     : 2
Configuration Revision          : 7
Maximum VLANs supported locally : 1005
Number of existing VLANs        : 8
VTP Operating Mode              : Server
VTP Domain Name                 : mustbegeek.com
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Enabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x5E 0x69 0x7F 0xAF 0xFB 0xD8 0xF7 0xC6

As you can see above, VTP version is 2, configuration revision is 7, Maximum VLANs supported is 1005. VTP version 3 supports all 4096 VLANs. Number of existing VLANs is 8. VTP Opeerating Mode is Server. VTP Domain name is mustbegeek.com. VTP Pruing Mode is disabled. VTP v2 is enabled. You can see the MD5 digest. The digest must be same on other switches too.

Let’s verify on SwitchD as well,

SwitchD#show vtp status
VTP Version                     : 2
Configuration Revision          : 7
Maximum VLANs supported locally : 1005
Number of existing VLANs        : 8
VTP Operating Mode              : Client
VTP Domain Name                 : mustbegeek.com
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Enabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x5E 0x69 0x7F 0xAF 0xFB 0xD8 0xF7 0xC6

As you can see above, VTP Operating Mode is client. Configuration revision number is 7, same as SwitchA. MD5 digest is also same as SwitchA. Let’s do final verification of VLANs. VLANs created on SwitchA must be created in SwitchD automatically. Type show vlan brief on SwitchD as shown below,

SwitchD#show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    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, Fa0/24, Gig0/1
                                                Gig0/2
10   VLAN0010                         active    
20   VLAN0020                         active    
30   VLAN0030                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active

Now, let’s verify VTP configuration in SwitchC.

SwitchC#show vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 1005
Number of existing VLANs        : 8
VTP Operating Mode              : Transparent
VTP Domain Name                 : mustbegeek.com
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Enabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xD7 0xA3 0x6A 0x76 0x8F 0xBA 0xC7 0x47

As you can see above the VTP Operaitng Mode is Transparent. In this way you can configure VTP in Cisco switch.




The following two tabs change content below.
Bipin is a freelance Network and System Engineer with expertise on Cisco, Juniper, Microsoft, VMware, and other technologies. You can hire him on UpWork. Bipin enjoys writing articles and tutorials related to Network technologies. Some of his certifications are, MCSE:Messaging, JNCIP-SEC, JNCIS-ENT, and others.

Latest posts by Bipin (see all)

scroll to top