Operating System - HP-UX
1829630 Members
1628 Online
109992 Solutions
New Discussion

Deleting static routes permanently

 
Frank Gentile
Advisor

Deleting static routes permanently

I'd rally appreciate it if anyone could explain how to delete specific static routes permanently ie l don't want them to reappear after a reboot.

Doing a netstat -r shows the routes l need deleted. None of the routes l want to delete are in /etc/rc.config.d/netconf (l'm of the understading that any permanent routes would be listed in the netconf file.

Could you please advise if l'm on the right track and what else l need to check and do to remove these static routes.


regards & thanks in advance

FrankG
6 REPLIES 6
Michael Tully
Honored Contributor

Re: Deleting static routes permanently

Are you sure that the're static routes? Try the /etc/gated.conf file.
Anyone for a Mutiny ?
Frank Gentile
Advisor

Re: Deleting static routes permanently

There are no IP addresses entered in the /etc/gated.conf file. Is this where all statics are listed?
Steven E. Protter
Exalted Contributor

Re: Deleting static routes permanently

netstat -rn shows the routes.

This is set in /etc/rc.config.d/netconf

check the ROUTE_GATEWAY
configuration and remove what you don't want.

Its best to boot the box after that, though you can just restart the network.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rajeev  Shukla
Honored Contributor

Re: Deleting static routes permanently

If you want to delete a particular route use
route add net netmask 1
If you want to delete everytime after reboot write a script in /sbin/init.d and call in /sbin/rc3.d/

Michael Tully
Honored Contributor

Re: Deleting static routes permanently

The static routes are listed in /etc/rc.config.d/netconf by default, however some static routes can be listed in /etc/gated.conf if your using 'rip'. Have a look at the samples in /usr/examples/gated/rip.routed

As suggested remove them with the route command.

# route delete
Anyone for a Mutiny ?
Elmar P. Kolkman
Honored Contributor

Re: Deleting static routes permanently

Also make sure that there are no scripts called when booting that set routes themselves. Check out the scripts in /sbin/rc2.d and /sbin/rc3.d for scripts calling the route command. If the routes keep coming back you could try to replace route with a script echoing the calling command, the commandline and then call the original route to make everything keep on working, but logging to your rc.log file a line for every route command and which script calls it, to make sure where the routes are set.
Every problem has at least one solution. Only some solutions are harder to find.