VTP (VLAN Trunking Protocol) is the protocol that propagates the information about which VLANs exist from one switch to another switch. If VTP did not provide this information, VLANs would have to be created on all switches individually in the network.
VTP is a Cisco proprietary protocol. The default mode of a switch is configured as VTP server. In any case, the server services are turned off, use the following command to turn it back on as VTP server.
SwitchA#vlan database
SwitchA(vlan)#vtp server
SwitchA(vlan)#exit
First create multiple VLANs with name, assign multiple ports to them then create 802.1q trunk link between the two switches to allow communication between VLANs.
To create a VLAN, first enter global configuration mode to run the following commands. Configuration to create VLAN 2 and 3 on switch A (VTP server)
SwitchA(config)#configure terminal
SwitchA(config)#vlan 2
SwitchA(config)#vlan 2 name marketing
SwitchA(config)#vlan 3
SwitchA(config)#vlan 3 name management
SwitchA(config)#exit
Now assigning the ports 2 and 3 to VLAN 2, it must be done from the interface mode. Enter the following commands to add port 2 and 3 to VLAN 2.
SwitchA(config)#configure terminal
SwitchA(config)#interface fastethernet 0/2
SwitchA(config-if)#switchport access vlan 2
SwitchA(config-if)#exit
SwitchA(config)#interface fastethernet 0/3
SwitchA(config-if)#switchport access vlan 2
SwitchA(config-if)#exit
Now assigning the ports 4 and 5 to VLAN 3, enter the following commands to add port 4 and 5 to VLAN 3.
SwitchA(config)#configure terminal
SwitchA(config)#interface fastethernet 0/4
SwitchA(config-if)#switchport access vlan 3
SwitchA(config-if)#exit
SwitchA(config)#interface fastethernet 0/5
SwitchA(config-if)#switchport access vlan 3
SwitchA(config-if)#exit
Configuration of VTP client on switch B
SwitchB#vlan database
SwitchB(vlan)#vtp client
SwitchB(vlan)#vtp domain group1
SwitchB(vlan)#exit
Trunking with 802.1q
Now create 802.1q trunk link between the two switches to allow communication between
VLANs.
On both switches, SwitchA and SwitchB type the following command with 802.1q at the fastethernet 0/1 interface.
SwitchA(config)#configure terminal
SwitchA(config)#interface fastethernet 0/1
SwitchA(config-if)#switchport mode trunk
SwitchA(config-if)#switchport trunk encapsulation dot1q
SwitchA(config-if)#end
SwitchB(config)#interface fastethernet 0/1
SwitchB(config-if)#switchport mode trunk
SwitchA(config-if)#switchport trunk encapsulation dot1q
SwitchB(config-if)#end
To verify that fastethernet 0/1 has been established as trunk port, type the show interface fastethernet 0/1 switchport at the privileged EXEC mode.
Although the VLAN definitions have migrated to the switch B using VTP, but it is necessary to assign ports to these VLANs on switch B.
Now assigning the ports 2 and 3 to VLAN 2, it must be done from the interface mode. Enter the following commands to add port 2 and 3 to VLAN 2.
SwitchB(config)#configure terminal
SwitchB(config)#interface fastethernet 0/2
SwitchB(config-if)#switchport access vlan 2
SwitchB(config-if)#exit
SwitchB(config)#interface fastethernet 0/3
SwitchB(config-if)#switchport access vlan 2
SwitchB(config-if)#exit
Now assigning the ports 4 and 5 to VLAN 3, enter the following commands to add port 4 and 5 to VLAN 3.
SwitchB(config)#configure terminal
SwitchB(config)#interface fastethernet 0/4
SwitchB(config-if)#switchport access vlan 3
SwitchB(config-if)#exit
SwitchB(config)#interface fastethernet 0/5
SwitchB(config-if)#switchport access vlan 3
SwitchB(config-if)#exit
Thanks for sharing this Information. SAP MM Training in Noida
ReplyDelete