Thursday 1 September 2011

How to remove a static route in SPLAT without using SYSCONFIG

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

3 comments:

  1. How to add route via CLI

    ReplyDelete
    Replies
    1. Just replace "del" with "add"
      route add -net 192.168.72.75 netmask 255.255.255.255 gw 172.16.25.45

      Delete
    2. Thanks Rajan, missed this one earlier

      Delete