Operating System - HP-UX
1820290 Members
3059 Online
109622 Solutions
New Discussion юеВ

Re: Problem with the route command

 
SOLVED
Go to solution
Kevin Liquori_1
Regular Advisor

Problem with the route command

I rebooted an 11.0 box that had an incorrect lan1 setup in netconf so lan1 came up with the incorrect ip. I took down the interface but a netstat -rn still showed that ip address with a default gateway of that same address. When I used the route command (route delete ip gateway or route delete host ip gateway) it returned "no such file or directory". I was able to fix it by either changing the ip through ifconfig or, ultimately, rebooting. My question, however, is not how to fix it by why did attempts at deleting the route fail?

TIA...Kevin
5 REPLIES 5
hpuxrox
Respected Contributor

Re: Problem with the route command

This tends to happen to me to from time to time. I end up having to flush the routing table ( route -f ) from the console and reenter the routes manualy.

Sachin Patel
Honored Contributor
Solution

Re: Problem with the route command

#netstat -rn |grep default
default 10.20.250.5 UG 0 0 lan0 1500

then
#route delete default 10.20.250.5

will delete the default route

#route add default 10.20.250.5 1
will add the default route.

Sachin

Is photography a hobby or another way to spend $
MANOJ SRIVASTAVA
Honored Contributor

Re: Problem with the route command

Hi Kevin

Do a netstat -nr and get the default gateway.

route delete < default gateway >

route add no. of hops

you should be good to go , another issue is you should be able to ping the default gateway.


Manoj Srivastava
sven verhaegen
Respected Contributor

Re: Problem with the route command

ok some more information on the routing table, as far as I know , when starting up the machine will add routes for it's physical interfaces , these routes are apparently considered special because for instance such a route will have at least 2 entries

IP 127.0.0.1
IP IP

the first one is darn hard to get rid of , e.g. route delete host or net on :

IP 127.0.0.1

allways shows that is cannot find it , this is apparently a protection to prevent you from trowing out you physical interfaces , normally you should be able get rid of the IP IP denotation with the route delete net or route delete host commands , it is however possible that the routing table got confused and that it thinks the entry doesn't exist anymore then a route -f or a restart of the system is needed to flush the entries
...knowing one ignores a greath many things is the first step to wisdom...
John Palmer
Honored Contributor

Re: Problem with the route command

Your attempts to delete the route were probably due to you not specifying the netmask and the default assumed by the route command not matching the entry in the routing table.

See 'man route' for details of how the default is calculated.

Use 'netstat -rnv' to see what netmask is associated with the route entry and if necessary, supply that to the 'route delete' command...

route delete net xxx netmask yyy

Regards,
John