Operating System - HP-UX
1833759 Members
2101 Online
110063 Solutions
New Discussion

Re: how to remove a route on the host

 
Hanry Zhou
Super Advisor

how to remove a route on the host

I have a route, and can see from netstat -rn:

destination gateway Flags ...
10.1.5.2 10.1.5.3 UH ...

What command to remove this entry?

I tried:
route delete 10.1.5.2
and:
route delete 10.1.5.2 10.1.5.2

but, they are not working.

Thanks!
none
17 REPLIES 17
Sandman!
Honored Contributor

Re: how to remove a route on the host

Your routing entry looks incorrect. It's a route to a (remote) host thru a gateway as the destination and gateway IPs are different. The Flags should be UGH instead of UH which would be for a (local) host on a local interface in which case the destination and gateway should be the same IP. Could you post the output of the cmd below:

# netstat -rn
Hanry Zhou
Super Advisor

Re: how to remove a route on the host

I know it is incorret, that is why I wanted to remove it.

Now, I just need the help on the command to remove this entry from netstat -rn.

none
Sandman!
Honored Contributor

Re: how to remove a route on the host

Well then try the cmd below:

# netstat delete host 10.1.5.2 10.1.5.3 1

~hope it helps
A. Clay Stephenson
Acclaimed Contributor

Re: how to remove a route on the host

route delete host 10.1.5.2 10.1.5.3
If it ain't broke, I can fix that.
Sandman!
Honored Contributor

Re: how to remove a route on the host

Ooops...don't know what i was thinkin'. Change my cmd to...

# route delete host 10.1.5.2 10.1.5.3 1
Hanry Zhou
Super Advisor

Re: how to remove a route on the host

it is not working:

netstat -rn:
Destination Gateway Flags
10.1.5.2 10.1.5.2 UH

route delete host 10.1.10.2 10.1.10.2 1
delete host 10.1.10.2: gateway 10.1.10.2: no such route


I can not remove the entry.
Please pay attention on the ip, the destination and gateway have the same IP.


none
Hanry Zhou
Super Advisor

Re: how to remove a route on the host

Sorry, following is the output I am getting

route delete host 10.1.5.2 10.1.5.2
delete host 10.1.5.2: gateway 10.1.5.2: no such route
none
A. Clay Stephenson
Acclaimed Contributor

Re: how to remove a route on the host

>>Please pay attention on the ip, the destination and gateway have the same IP.

I did pay attention; your original posting of the output of netstat -rn was wrong.


One possible way to fix you is to remove all entries that specify a remote host for a gateway.

route -f

You should then immediately add back the needed routes; at a minimum the default gateway.

route add default 10.1.0.1 1
substituting the correct ip address or hostname for 10.1.0.1

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: how to remove a route on the host

If you do choose to try route -f, do it from the console.
If it ain't broke, I can fix that.
Sandman!
Honored Contributor

Re: how to remove a route on the host

If none of the suggestions so far worked then only a reboot would be able to fix it. Verify that /etc/rc.config.d/netconf file has the correct entries before rebooting or you would end up having the same problem as before.
Hanry Zhou
Super Advisor

Re: how to remove a route on the host

Is this command "route -f" going to remove all routes on this host? I thought it would only remove these routes whose destination are host.

I did perform this command, and as the result of that, I lost the primary connection. I wish it could be explained better.

I restarted ./net start, so the connections got back now, but the entry is till there.
none
Sandman!
Honored Contributor

Re: how to remove a route on the host

You need to correct the entries in the netconf file before proceeding to restart networking. Also you could attach the contents of the netconf file here.
Padma Asrani
Honored Contributor

Re: how to remove a route on the host

Hi

You can delete using

# route delete host 10.1.5.2 10.1.5.3 1

Regards
Padma
Hanry Zhou
Super Advisor

Re: how to remove a route on the host

this entry was manually added in, not by netconf file.

Padman, I have already tried that command. With or without "1" , all don't work.

It seems I have to reboot the server to get rid of this entry which could not be done now.
none
Keith Jahn
Advisor

Re: how to remove a route on the host

If the IP address of a card in the server is 10.1.5.2, you wil always see "10.1.5.2 10.1.5.2 UH" in "netstat -m".
Padma Asrani
Honored Contributor

Re: how to remove a route on the host

Hi

So you wanted to get rid of
10.1.5.2 10.1.5.2 entry in netstat -r don't you?

It the command I gave you works for me, please let me know what the output of
router delete host 10.1.5.2 10.1.5.2 1

So the format is
route delete host 1

Regards
Padma

Hanry Zhou
Super Advisor

Re: how to remove a route on the host

Keith is right. I have to unplumb the device first before the entry could be gone in netstat -rn.

I am still wondering why after "route -f" , I lost primary connection, may lost all connections...
none