cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
366
Views
10
Helpful
4
Replies

LAN Question about layer 2 switches...please help

bmoorewiz
Level 4
Level 4

Ok....I am arguing with a colleague at work. We have one switch and everything on it is in Vlan1 and is in the 10.1.1.0 subnet. Except for 1 hub that is connected to this switch...everything on that hub is on the 192.168.1.0 subnet. Now We take a PC that is connected to the switch and it has a regular IP address on the 10.1.1.0 subnet but also a secondary IP address on the 192.168.1.0 subnet...only 1 NIC card. Now my question is...when this PC uses software that needs to access the 192.168.1.0 subnet how does the switch learn that the fa0/18 Interface where the hub is located is where that packet needs to be routed.....Please be thorough for I am having an argument and need to be able to prove this...

Thank you in advance for any and all help..

-Brandon Moore

4 Replies 4

Francois Tallet
Level 7
Level 7

I'm assuming that the hub is also connected on vlan 1. For better understanding, I think we can consider your device as an L2 switch combined with a router connected to it.

The PC is sending a packet to the router through the switch. The router determines that the packet needs to be routed back on the interface where it was received. So basically, the packet is re-injected into the same vlan on the switch. That's where the router work ends.

Now the switch looks at the L2 destination address of the frame. If it has learnt this destination mac on a port (which is most likely, because the router must have resolved the association IP address/mac address via ARP, so it has received an answer from the next hop), it will forward the frame at layer 2 to this port, else it will flood it on all the ports in the vlan.

Regards,

Regards,

Francois

Btw, I was not sure from your message if it was the router or the pc that had a secondary address. If the PC has a secondary address, it ARPs directly for the destination and the router is not involved, of course. The selection of the destination port by the switch is still based on the L2 information.

It is the PC that has the secondary IP address.

So just to be sure here...

When the first request for the 192.168.1.0 comes into the switch, its going to flood an ARP out all interfaces except the one that it came in...and then the computer that has the 192.168.1 address is going to respond w/ its mac address and then it will be saved to the switch....correct? so a router is not needed at all ever for the 192.168.1 network to work....am I correct with all of this?

and thank you for your help I really appreciate it.

Yes. All this is only processed at L2. The switch does not even know this is an ARP request, it floods the frame. The destination host directly answer the ARP request, thus populating the cam table. The traffic between the two hosts is then forwarded at L2 with no flooding by the switch.

The router does not participate in the communication (I don't think proxy arp can kick in here because 192.1.168 is not a subnet of 10.0.0, but some L3 guys on the forum can confirm that;-)

Regards,

Francois

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card