Operating System - HP-UX
1819861 Members
2601 Online
109607 Solutions
New Discussion юеВ

Re: How to flush routing table

 
SOLVED
Go to solution
STC ITRC user_1
Occasional Advisor

How to flush routing table

We have HP-UX 11 and the routing table is showing more than one IP for the same card so how to flush it and delete unwanted rows?

# netstat -rn
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
172.xx.xx.xx 172.xx.xx.xx UH 0 2281 lan4:2 4136
172.xx.xx.xx 172.xx.xx.xx UH 0 170 lan4:3 4136
172.xx.xx.xx 172.xx.xx.xx UH 0 170 lan4:1 4136
172.xx.xx.xx 172.xx.xx.xx UH 0 198 lan4 4136
Champion
12 REPLIES 12
Clemens van Everdingen
Honored Contributor

Re: How to flush routing table

Hi,

Use the route command:

route -f delete .....

See: # man route

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
STC ITRC user_1
Occasional Advisor

Re: How to flush routing table

I can't delete any row because it gives a message:
# route -f delete net 172.xx.xx.233 172.xx.xx.233

delete net 172.xx.xx.233: gateway 172.xx.xx.233: No such file or directory

any explenation?
Champion
David Burgess
Esteemed Contributor

Re: How to flush routing table

route -f is the man for the job

From man page :-

-f Delete all route table entries that secify a remote host for a gateway. If this is used with one of the subcommands, the entries are deleted before the subcommand is processed.

Also route delete will delete individual routes.

Regards,

Dave.
Clemens van Everdingen
Honored Contributor

Re: How to flush routing table

Hi,

Try using:

route delete net 172.xx.xx.233 172.xx.xx.233

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
STC ITRC user_1
Occasional Advisor

Re: How to flush routing table

route -f don't help in this case I did that many times.
Champion

Re: How to flush routing table

Take a closer look at your routing table, and note the inetrface descriptions:

lan4:2
lan4:3
lan4:1
lan4

These are additional IP adresses bound to the same card - If you have more than one IP address on the card it is entirely correct to have a routing entry for each one. As to why you have more than one... well it could be because this system is running serviceguard, or it could be simply that another admin has configured it that way.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
David Burgess
Esteemed Contributor

Re: How to flush routing table

route delete net 192.100.100.5 192.100.100.1

where 192.100.100.5 is the destination
and 192.100.100.1 is the gateway.

Take a look at

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe2b979bffde7d4118fef0090279cd0f9,00.html

HTH

Dave.
Clemens van Everdingen
Honored Contributor

Re: How to flush routing table

Hi,

route delete net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx

If gated is running you might want to do this :
/sbin/init.d/gated stop
/sbin/init.d/net start
route delete ...
/sbin/init.d/gated start


look at this one as well:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4f731cc6003bd6118fff0090279cd0f9,00.html

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Sukant Naik
Trusted Contributor

Re: How to flush routing table

Hi Abdullah,

Looks like there are 3 additional IP Addressed being brought up on the same interface.

So as Duncan rightly pointed out, you need to consider whether you need to have the interfaces up and available.

Try this:
# ifconfig lan4:1 down
# ifconfig lan4:2 down
# ifconfig lan4:3 down

This will bring the lan interface down and then try the route delete command.

-Sukant
Who dares he wins
MANOJ SRIVASTAVA
Honored Contributor

Re: How to flush routing table

Hi Abdullah

Did you try deleteing it one by one like
route delete from the highest to the lowest ie first with the IP Addrees for the lan:4 and the :3 and then :2 and then :1.


Manoj Srivastava
Wodisch
Honored Contributor
Solution

Re: How to flush routing table

Hi,

if you want to get rid of "lan4:2" then you have to issue:
ifconfig lan4:2 0.0.0.0

HTH,
Wodisch
STC ITRC user_1
Occasional Advisor

Re: How to flush routing table

Thnax guys,

I deleted them now and it's OK.

Regards,
Abdullah
Champion