Why do Static routes disappear from the routing table?

dziugss

Distinguished
Oct 19, 2011
23
0
18,520
Hello,

I have two OpenWRT routers. They are connected LAN port to LAN port. By default, I can't reach one router from the other because there is no route. So I've added the necessary Static routes to both routers using the route add command. But this way the routes keep disappearing after reboots, disconnects, etc.

Fortunately, there's a Static routes section in my router's WebUI, where you can configure Static routes via a GUI. So I configured the routes that I needed there but I still have the same problem. If I disconnect the routers, the Static routes are gone from the routing table. Only difference is that after I reboot the router or the /etc/init.d/network service, the routes seem to reappear. But if the two routers are not connected at the moment, they disappear shortly after.

I've Googled it for about an hour now but I can't find anything on this. Is this just how routing tables work? I mean when a host becomes unreachable, maybe the routes are supposed to disappear? Or is this a problem with my routers?
 


Well they don't disappear forever. As I have mentioned, they reappear after network service restart or router reboot. That is because the values are saved somewhere and applied during start-up (either the router's start-up or network service's start-up). It's still a problem since every time I disconnect a cable, I lose a route. Or if an unexpected shutdown were to happen the result would be the same.
 


I do not believe you are adding static routes to your router or switch. If you see a route "appear" is was dynamically assigned.