Disable Routing Cache on Ubuntu 12.04.5 LTS

Guruprasad Kulkarni gkulkarni at gridcosystems.com
Wed Mar 25 17:14:24 UTC 2015


Hi,

I am using Ubuntu 12.04.5 LTS and have a couple of static routes on it.

The IP Address is 192.168.10.23 and the default gateway is 192.168.10.1

I added a couple of static routes to it so that it reaches a particular IP
address using a different gateway

route add -net 10.24.78.0 netmask 255.255.255.0 gw 192.168.10.99 dev eth0

​This seems to work for a few days and then suddenly it forgets that it is
supposed to use the different gateway to reach that ip address. It instead
uses the default gateway

So instead of going through 192.168.10.99, it tries reaching 10.24.78.x
through 192.168.10.1

The static route is still in place (verified by netstat -rn). The route
table has not changed.

I did a "ip route flush cache" and this brought things back to normal.

So my question is, how do I disable this caching permanently? If this is
not advisable, what are the other options?

I tried setting /proc/sys/net/ipv4/route/max_size to 0, but this value
default to 214748364 on reboot.​
​If not mistaken, this sets the max size of the cache?


-- 
-Guruprasad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20150325/9172c390/attachment.html>


More information about the ubuntu-users mailing list