How to clear the route table?


New Member
Hello all,

This is my first time posting and I am relatively new to Linux.

I work for a system integration company and part of my job is to add networking cards to servers and attach IP addresses to the devices and make sure that they can communicate with a test server.

I might have six devices at once (em1,em2,em3,em4,p1p1,p1p2).

I will assign six different ip addresses to those devices:

ip addr add dev p1p1
ip addr add dev p1p2
ip addr add dev em1
ip addr add dev em2
ip addr add dev em3
ip addr add dev em4

After I have assigned those IP addresses to those devices, I run the Route command and it shows me a table with the six devices and the corresponding IP addresses.

Currently, if I want to reassign those IP addresses I have to use the ip addr del x.x.x.x dev x command.

Is there a command I can use to clear the table completely in one command, rather than unassigning each device one at a time? I have to test multiple cards with a limited amount of cables/ip addresses, so I have to clear out the routing to reuse the ports to test the next set of cards in a server.

I am using a live boot disc of CentOS 7 on Dell R640/640 hardware.

I have tried to Google the problem for the last few days and I can't seem to find an easy solution. I have found solution for clearing individual entries on the table, but I haven't found a way to wipe all addresses on all devices in one shot. Perhaps I am not asking the right question?

I am a n00b and happy to take any constructive chewing out that the folks around here have to offer. :^)


Gold Member
Gold Supporter
ip route flush table main
Last edited:

Members online

Latest posts