I have a wireless router installed at my home (provided by ISP). Scenario:
Router IP: 192.168.1.1
My Machine IP (X): 192.168.1.2
IP of machine Y: 192.168.1.3
Now when I ping Y from my machine X.(ping 192.168.1.3 from 192.168.1.2)
My Routing table says: 192.168.1.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
This is a local route and now the ARP will be consulted for the MAC address of Y. Suppose Y has mac: yy:yy:yy:yy:yy:yy Thus a packet will be sent out from wlan0 towards the router.
Now How will the router forward the packet? Will it switched based on MAC or Layer 3 IP lookup will be used to forward in the packet?