SWITCHING BASICS WITH EASE

Rashmi Bhardwaj | Blog,Protocol,Routing & Switching
Advertisements

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.

Advertisements

TOPOLOGY DIAGRAM:

switching-basics-with-ease

CONFIGURATION:

Switch 1:

interface Ethernet0/0switchport access vlan 10

switchport mode access

!

interface Ethernet0/1

switchport access vlan 10

switchport mode access

Switch 2:

interface Ethernet0/0switchport access vlan 20

switchport mode access

!

interface Ethernet0/1

switchport access vlan 20

switchport mode access

In our lab we have used routers acting as Hosts A and Host B.

Router 1#sh runn int e0/0

Building configuration…Current configuration : 65 bytes

!

interface Ethernet0/0

ip address 1.1.1.1 255.255.255.252

end

 

Router 2#sh runn int e0/0

Building configuration…Current configuration : 65 bytes
!
interface Ethernet0/0

ip address 1.1.1.2 255.255.255.252

end

TESTING:

Router 1#ping 1.1.1.2

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds:

.!!!!

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

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/5/6 ms

ABOUT THE AUTHOR


Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart