How to configure Vlan Trunking Protocol on Gns3
Question
This GNS3 lab is related to VLAN Trunk Protocol, in which you have two switches Switch-1 and Switch-2 and you need to configure the Switch-2 according to following requirement:
- Determine and configure the gateway and last IP address on vlan-interface from subnet 192.168.33.32\27
- Find and configure the same VTP domain on switch-2 as on Switch-1. (Switch-1 has the domain “City-Campus”)
- Configure Switch-2 as VTP Client
Background
- Knowledge background (Vlan and VTP):
- http://frankfu.click/networking/networking-fundamental/vlan.html
- https://www.9tut.com/vlan-trunk-protocol-vtp-tutorial
- Lab build Background: Before this lab, it is mandatory to know how to build a “switch ” in GNS3( router with switch port): http://frankfu.click/cisco/gns/how-to-build-switch-image-and-configure-switch-in-gns-3.html And also be aware that the command in GNS is different from real Cisco switch.
Solution (configure this Lab) :
You can configure this on GNS3 very easily, according to question Router and Switch-1 are already configured. You can complete this lab by creating the above topology in GNS3 and then you can download router and switch-1configurations from here, paste them on router and switch-1 respectively and complete it with following configurations:
Router 3 Config:
version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ip subnet-zero no ip icmp rate-limit unreachable ip cef ip tcp synwait-time 5 ! ! ! ! no ip domain lookup ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 192.168.33.35 255.255.255.224 duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! ip classless ! no ip http server no ip http secure-server ! ! ! control-plane ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end
Switch 1 Configure
version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Switch1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ip subnet-zero no ip icmp rate-limit unreachable ip cef ip tcp synwait-time 5 ! ! ! ! no ip domain lookup ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface FastEthernet1/0 ! interface FastEthernet1/1 ! interface FastEthernet1/2 ! interface FastEthernet1/3 ! interface FastEthernet1/4 ! interface FastEthernet1/5 ! interface FastEthernet1/6 ! interface FastEthernet1/7 ! interface FastEthernet1/8 ! interface FastEthernet1/9 ! interface FastEthernet1/10 ! interface FastEthernet1/11 ! interface FastEthernet1/12 ! interface FastEthernet1/13 ! interface FastEthernet1/14 switchport mode trunk ! interface FastEthernet1/15 ! interface Vlan1 ip address 192.168.33.50 255.255.255.224 ! ip default-gateway 192.168.22.35 ip classless ! no ip http server no ip http secure-server ! ! ! control-plane ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end
Determine and configure the gateway and last IP address from subnet 192.168.33.32\27:
For finding the gateway and vlan IP address on Switch-1 you can use the command “show run”
Step 1, Work out the subnet info for this lab:
From above out-put you can see that vlan-subnet on switch-1 is 192.168.33.50\27 and from subnetting you can find the valid IP addresses for this subnet:
Subnetting for Class C address | |||||||||
Bit# in 4th octet | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | |
IP ranges/ increment | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
From above table we have the following details:
Subnet ID= 192.168.33.32
Broadcast Address=192.168.33.63
Valid IPs= 192.168.33.33 to 192.168.33.62
So we have 192.168.33.62 the last IP address for given subnet.
Switch-2#config t Switch-2(config)#int Vlan1 Switch-2(config-if)#ip address 192.168.22.62 255.255.255.224 Switch-2(config-if)#no shut Switch-2(config-if)#exit Switch-2(config)#ip default-gateway 192.168.22.35
Step2, Find and configure the same VTP domain on switch-2
For VTP domain of switch-1, you can use the “show vtp status” command on Switch-1.
switch-1# show vtp status
We have find that VTP-domain of switch-1 is “City-Campus”. For configuring the same domain you can use the following commands:
Switch-2#config t Switch-2(config)#vtp domain City-Campus
Step 3. Configure Switch-2 as VTP Client
You can set Switch02 as VTP client by using command: “vtp mode client” or “vtp client”
Real Switch Configurations | if you are configuring it on GNS3 |
Switch-2#config t Switch-2(config)#vtp mode client Switch-2(config)#vtp domain City-Campu |
Switch2#vlan database Switch2(vlan)#vtp client Switch2(vlan)#vtp domain City-Campus |
How to Test or Confirm lab configurations on GNS3:
Create some vlan on switch1, if your configurations are complete then it will automatically create that vlan on Switch2 as well. (Switch2 is VTP client therefore it will sync its vlan database from switch1 which is VTP server)
Switch1#vlan database Switch1(vlan)#vlan 11
After creating vlan 11 on switch1, Show vlan-switch on switch2 should have following configurations:
If you have some issue with your lab then you can download Switch2 configuration from here and can compare with your for troubleshooting.
Current configuration : 1342 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname Switch2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ip subnet-zero no ip icmp rate-limit unreachable ip cef ip tcp synwait-time 5 ! ! ! ! no ip domain lookup ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface FastEthernet1/0 ! interface FastEthernet1/1 ! interface FastEthernet1/2 ! interface FastEthernet1/3 ! interface FastEthernet1/4 ! interface FastEthernet1/5 ! interface FastEthernet1/6 ! interface FastEthernet1/7 ! interface FastEthernet1/8 ! interface FastEthernet1/9 ! interface FastEthernet1/10 ! interface FastEthernet1/11 ! interface FastEthernet1/12 ! interface FastEthernet1/13 ! interface FastEthernet1/14 switchport mode trunk ! interface FastEthernet1/15 ! interface Vlan1 ip address 192.168.22.62 255.255.255.224 ! ip default-gateway 192.168.22.35 ip classless ! no ip http server no ip http secure-server ! ! ! control-plane ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end