Operating System - HP-UX
1833704 Members
3090 Online
110062 Solutions
New Discussion

stop dynamic routes from being added in routing table

 
Tim Nelson
Honored Contributor

stop dynamic routes from being added in routing table

I have had some intermittant problems with this and was hoping someone could shed some light on this. I have a number of multihomed HP systems which communicate with each other over a private lan only known to them. No routers or other devices on this private lan. Each system also has connectivity over another LAN which provides access to the systems for users and other devices. This lan does have routers attached. A problem exists that the HP systems will occasionally pick up on a dynamic route broadcast by some router with an IP of a system on the private segment. There obviously is a matching IP address somewhere in our intranet that the routers are discovering. Once this dynamic route is added to the routing tables on the HPs all connections over the private lan obviously cease. Question. Can I stop the HPs from adding these discovered/dynamic routes ? I am not using gated. Any discussion on this matter is greatly appreciated. Thank you.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: stop dynamic routes from being added in routing table

Tim, having seen a similar problem on a network with several 10.20 boxes on it I can give you a little food for thought. I saw exactly what you did that sporadically I would lose the connections going out over a private
network. My solution was to create a cronjob which call a script to to clean up the routing tables. I did a netstat -r and searched for
bad patterns. If I found them I did a route -f
and then route add to add back the default and other desired routes.
Not a perfect answer but it did work.
If it ain't broke, I can fix that.
Tim Nelson
Honored Contributor

Re: stop dynamic routes from being added in routing table

That is an option.. Thanks !
Berlene Herren
Honored Contributor

Re: stop dynamic routes from being added in routing table

Tim, on a 10.20 box you can turn off the "don't fragment" bit with nettune -s tcp_pmtu 0, but I don't know the effect it will have on the rest of your network. You can turn it off on the router, but that is not usually advised. Or you can use a script. Here is a sample:

# netstat -rn | grep UGHD > /tmp/icmpfile
# while read DEST GATEWAY OTHER
> do
> /usr/sbin/route delete $DEST $GATEWAY
> done < /tmp/icmpfile
# rm /tmp/icmpfile

You will find that, after the second line is typed and the return key is hit, the > signs will come up automatically. After you've typed the "done" line, the shell knows to run the previous commands. After the commands have executed, you will get back to a standard prompt and enter the remove command.

Thanks to Bert for the script.

Regards,
Berlene


This is how it works::
The first line just saves a list of all the UGHD entries into a file The second line reads from the file The third line takes the information read from the file and uses that
information in a command that will actually do the removal.
The fourth line tells the previous commands which file to use.
The last line is just to clean up the file which is no longer of any value.

If an entry still needs to be redirected, the routing device that sent the original ICMP redirect will send another one. After the cause for the redirect has been corrected, you can issue the commands again.
http://www.mindspring.com/~bkherren/dobes/index.htm
Rahul Mehta
Valued Contributor

Re: stop dynamic routes from being added in routing table

This problem is caused due to icmp redirect messges. System learns or develops routing entry from other routers through their ICMP redirect messages. How it works, when primary gateway is not available , system builds up possible alternate default gateway from other routers ICMP redirect messgaes. This can be good provided that gateway is available . Otherwise it causes the problem.

Best thing to do is disable ICMP redirect messages on your dynamic routers.
Or you can run this script in cron to delete all those routes.

netstat -rn | awk '$3=/UGHD/ {system ("route delete "$1" "$2" ")}' > /dev/null
Rahul
Tim Nelson
Honored Contributor

Re: stop dynamic routes from being added in routing table

Thanks to all. I had the LAN people here locate the router that was sending the bogus discovers. I will keep all the suggestions in mind for the next time.
Much Appreciated.