In Linux How To Flush Routing Table From Cache

Posted on : February 25, 2011 , Last Updated on : October 1, 2016 By
| Reply More

Routing Table

Static routes are much important if you have more than one interface connecting to different subnet. Enabling static routes gains much performance for your network. Either of the two below commands can be used to set/delete static routes.

1) ip route
2) route

This page I am not referring about how to add/delete static route but would like to explain how to flush the routing table using “ip route” command. Sometimes network get messed because of routing table cache. Below commands displays current routing table.

# ip route show


# route -n


#netstat -nr

Next question would be, how to clear the routing table?

You can try any of the below command to flush cache:

#/sbin/ip route flush table all /*this command will totally wipe your routing table completely clean */


#/sbin/ip route flush table main

But remember what is mentioned in the Redhat Link

For persistent static route, you can place routes in any of the below file:

#vi /etc/sysconfig/static-routes (this file is called by /etc/sysconfig/network-scripts/ifup-routes each time an interface is
brought up)

or in

#vi /etc/sysconfig/network-scripts/route-eth0


Tagged With :

Free Linux Ebook to Download

Leave a Reply

All comments are subject to moderation.