In this post we will learn about a basic switching scenario which is very important and seen as a favorite question usually asked in the Networking Companies interviews.
Let us begin by describing the switching scenario question:
Consider we have two Layer 2 switches connected to each other. Switch 1 has all its ports in access VLAN 10 and Switch 2 is having all its port as access VLAN 20.Switch 1 has a Host A connected with IP address 1.1.1.1/30 in VLAN 10.Switch 2 has Host B connected with IP address 1.1.1.2/30 in VLAN 20.
TOPOLOGY DIAGRAM:
CONFIGURATION:
Switch 1:
switchport mode access
!
interface Ethernet0/1
switchport access vlan 10
switchport mode access
switchport mode access
!
interface Ethernet0/1
switchport access vlan 20
switchport mode access
Router 1#sh runn int e0/0
!
interface Ethernet0/0
ip address 1.1.1.1 255.255.255.252
end
Router 2#sh runn int e0/0
!
interface Ethernet0/0
ip address 1.1.1.2 255.255.255.252
end
TESTING:
Router 1#ping 1.1.1.2
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 2/3/5 ms
We see we are able to communicate between the two hosts on same network though they are on different VLANs.
The reason behind the working of this scenario is that we have Access link between the two switches so when packet travels from Switch 1 to Switch 2 it doesn’t carry any VLAN tag in Layer 2 frame as Access ports only carry the untagged traffic.
We see the first packet is dropped in our ping which is usually dropped for the ARP resolution and once the ARP is resolved on Host A we will see 100% ping response as below:
Router 1#ping 1.1.1.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/5/6 ms
ABOUT THE AUTHOR
I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)