Managing the routing cache with linux

After changes to network routing or the firewall on gateway linux systems, a flush of the routing cache may be required to stop previous settings from being used.

To view the current routing cache use the following command:

route -Cn
Kernel IP routing cache
Source          Destination     Gateway         Flags Metric Ref    Use Iface   l     0      0       21 lo           0      0        2 wlan0

To clear the current routing cache issue the following command as root:

echo 1 > /proc/sys/net/ipv4/route/flush

The route command above should now display an empty cache.

Last updated: 08/08/2010