I've got two hosts in one local network: and, their gateway both are

The route table on is as below: On-Link

I can understand the route table.

What I can't understand is that if I delete the second route rule, host 10 can't ping host 11. In my guess, the first route rule should take effect then the router forward IP packets to host 11, but it didn't. Can anyone tell me why?

  • Routers route packets between networks, not from a network back to the same network. For a destination on the same network as the source, the source does not send the traffic to the router. The source will mask both the source and destination addresses to see if they are on different networks. If the networks are different, then the source creates a frame for the router, otherwise it creates a frame for the destination host. – Ron Maupin May 19 at 0:35
  • @RonMaupin You mean the second route helps the host to know its network id? – Alan May 19 at 13:16
  • No, the host knows its own network from its configured address and mask (address AND mask = network, do the same with both the source and destination addresses and compare the results). The second route tells the host how to reach its own network to try to find the destination host, and, yes, the router too because it is on that network. – Ron Maupin May 19 at 13:21
  • @RonMaupin Without second route, the host knows the source and destination are on same network , but it does not know the next hop address. Is that right? – Alan May 19 at 13:41
  • A host must explicitly be told how to reach any network. If it does not know how to reach a network, it drops the packet. Remember that you may have several interfaces on one host, and the host needs to know which to use. The second route tells the host how to reach that network though that interface, The first route tells it that if there are no more specific routes, send it to the router. – Ron Maupin May 19 at 13:48

The problem is that without the second route, your computer does not know how to find the router which is on the same subnet, so it can't send out the traffic.

| improve this answer | |

I think I've found the answer. It's very clear in RFC1918 section 3: "Because private addresses have no global meaning, routing information about private networks shall not be propagated on inter-enterprise links, and packets with private source or destination addresses should not be forwarded across such links. Routers in networks not using private address space, especially those of Internet service providers, are expected to be configured to reject (filter out) routing information about private networks. If such a router receives such information the rejection shall not be treated as a routing protocol error. ".

| improve this answer | |
  • 1
    This answer is incorrect in as much as it does not apply to your problem. The same issue would happen if you had non rfc1918 ips – davidgo May 18 at 22:11
  • @davidgo But it's not like what you said. I can still explore outside websites without the second route. – Alan May 19 at 13:12
  • @davidgo It's a very sample local network with a soho router. – Alan May 19 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.