How to delete a route like the one below from a UNIX server?
122.252.228.38/255.255.255.255 122.252.228.38 UH 0 lan4 4136
How to delete a route like the one below from a UNIX server?
122.252.228.38/255.255.255.255 122.252.228.38 UH 0 lan4 4136
You haven't included which system you're on or which tool-set you're using, but the two most common commands for managing the routing tables are the route
and ip
commands.
Here is how you might remove the route by using the route
command (from the net-tools package):
route del -net 122.252.228.38 netmask 255.255.255.255
And here is how you might delete the same route using the ip
command (from the iproute2 package):
ip route del 122.252.228.38/32
sudo ip route del 122.252.228.38/32 # or any valid selector
sudo ip addr flush dev DEVICE # then flush the cache and the route will be gone
sudo ip addr flush dev DEVICE
is WAY too greedy for the problem at hand! The question just wants to remove a single entry! flush
(as written) will remove ALL ENTRIES for a device!!!!!