how to clear router table

My Question is how to clear the router table using one command, i.e. using one command to remove ALL the router records/items within the router table to get an empty router table.

"router del" can help remove router records one by one, but it seems slow, doesn't it?

I think you are referring to "route" command. route del will work, I don't know why it's slow. You can also wipe out the file /proc/net/route, which holds all the info.

Sysgate, thanks for you answer, however, since /proc/net/net is a read-only file, can I wipe it out?

PS: maybe SLOW is not a right word, and the right word may be COMBERSOME.
Say there are 5 records in the routing table, if I have to run "route del ..." 5 times to make the table empty, it is a little cumbersome, isn't it?

I'm not sure if you can delete it, or empty it, but you can always try :slight_smile: As far as I know, route del accepts *, so you can try that as well. Also, deleting route should not be slow procedure generally, I don't know why it's slow for you. Nevertheless, I'm not aware of any other ways.

Try man ip. Hth.