It's pretty simple:
Consult the routing table to verify the routing information of your to-be-deleted route with one of the two following commands:
route | grep ip_of_your_route
or
netstat -nr | grep ip_of_your_route
An example is below:
netstat -nr |grep 192.168.72.75
192.168.72.75 172.16.25.45 255.255.255.255 UGH 0 0 0 eth5
Delete the route (help for the command can be found with 'route --help'):
route del -net 192.168.72.75 netmask 255.255.255.255 gw 172.16.25.45
Verify the route has been deleted (you should not see the original route anymore):
netstat -nr |grep 192.168.72.75
Save the changes (in case the route was pulled from sysconfig/netconf.C):
route --save
How to add route via CLI
ReplyDeleteJust replace "del" with "add"
Deleteroute add -net 192.168.72.75 netmask 255.255.255.255 gw 172.16.25.45
Thanks Rajan, missed this one earlier
Delete