The settings are:
manually set my host IP: 10.0.1.6/24
, gateway: 10.0.0.138/24
they both know each other's MAC (arp -a
shows the list) and there is a direct physical connection between them.
From the trace, I can see the host sends data to the gateway by adding the gateway's MAC in the frame.
But receive nothing from the gateway, also ping is no response.
However, when I change the gateway's subnet mask to 255.255.254.0
, everything is fine, data flows in both ways.
This is confusing me:
Does the host IP must be contained in Router's subnet so that they can communicate? even they know each other's IP and MAC?
To my knowledge, the router doesn't have to be in the same subnet with the next hop, as long as it knows the next hop's IP and MAC, so why my host cannot get responses through my router?
Under my scenario, what's the right thing to do to set up communication in both ways? Adding a static routing entry? please advice, thanks!