View Single Post
  #4   (View Single Post)  
Old 28th January 2015
rocket357's Avatar
rocket357 rocket357 is offline
Real Name: Jonathon
Wannabe OpenBSD porter
Join Date: Jun 2010
Posts: 429

To further beat a dead horse on describing this issue (just kidding, ocicat and jggimi! Great explanations...I'm just OCD about this stuff), the switch cares nothing about what ip address a packet is sent to. It only deals with mac addresses/ethernet frames. In other words, if host A looks in its route table and sees that host B falls within the same subnet as host A, it will send the traffic directly (i.e. the frame with have host Bs mac address and the packet within the frame will contain host Bs ip). If, however, host A notices that host B resides outside of host As subnet (different vlan/subnet/whatever), then it will send the packet as before with host Bs ip, but the containing frame will instead have host As default gateways mac address, with the understanding that host As default gateway will forward the packet down the line (even if that means back to the switch =)

None of this matters if host A and host B are on the same subnet/vlan, though, as the packets/frames will then be forwarded by the switch and not touch the router.
Linux/Network-Security Engineer by Profession. OpenBSD user by choice.
Reply With Quote