1

I got following routing setup:

Target        Gateway      Mask
0.0.0.0       192.168.1.1  0.0.0.0
192.168.2.0   192.168.1.2  255.255.255.0
192.168.1.0   0.0.0.0      255.255.255.0

Router 192.168.1.1 connects to internet. Router 192.168.1.2 connects to another LAN. Routing works and I can reach both internet and hosts at 192.168.2.* as expected.

Then

router 192.168.1.2 has changed its IP address to 192.168.1.10. Routing tables has not been changed, they are just like above.

ARP tables has both 192.168.1.2 (old) and 192.168.1.10 (new) if that could have any effect?

That behavior was confusing so I did try same routing configuration with another machine (that's not been part of network before) and as I expected it did not work. Only 192.168.1.10 found from ARP tables as resolved record, which is also expected behavior.

So, my question is: Why does routing to 192.168.2.* hosts still work? There's no valid route to that network anymore.

OS which still connects through "legacy" route is linux 3.18.7 if that matters.

1 Answer 1

5

It works because the arp entry for 192.168.1.2 is still valid. Your router determines that the next hop is 192.168.1.2 and looks in the arp cache. Since the entry is still there, if sends the frame to that MAC address, which is still your router.

If you wait a while, the entry will age out and the network will be unreachable. The new computer you connected didn't have the old entry, so that's why it didn't work.

This article explains how the arp cache ages out on Linux machines.

1
  • 1
    In short, while there's active connections to foreign network (and there is) arp entry stays alive until ethernet gets disconnected/reconnected. I don't know how long it's been since router ip has changed but routing still holds atow. Dec 19, 2015 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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