Operating System - HP-UX
1834480 Members
3807 Online
110067 Solutions
New Discussion

Re: Two questions about modifying the routing tables

 
Andrew Kaplan
Super Advisor

Two questions about modifying the routing tables

Hi there --

We have a 10.20 server, and I need to do two things to the routing tables on it.

1. I need to add a static route to the server, and I want to know what the correct syntax is in order to accomplish this.

2. This route needs to supercede several routes that are already in place. Specifically this route will encompass an entire network, and I need to remove any references to specific hosts that are on subnets on that network. How can I do this?

Thanks.
A Journey In The Quest Of Knowledge
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: Two questions about modifying the routing tables

First, you probably want to do this on the console.

You want to issue all of your delete commands first.

route delete net 10.1.2.0
route delete net 10.1.3.0

Next issue your add command:
route add net 10.1.0.0 netmask 255.255.0.0 10.1.1.1 1

Now, assuming that you want to keep your static routes across boots, you need to edit /etc/rc.config.d/netconf and add entries to the routing array.

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=
...
...
you can add [1]'s,[2]'s to this array but make sure that you don't skip any index values. Using this array, n static routes can be added.

If it ain't broke, I can fix that.
tkc
Esteemed Contributor

Re: Two questions about modifying the routing tables

send us the 'netstat -rn' output and let us know how you would like the output to appear like. also send us the file /etc/rc.config.d/netconf. that should be sufficient to resolve your issue.