Operating System - HP-UX
1836645 Members
1559 Online
110102 Solutions
New Discussion

Re: static routes added on startup

 
Gavin Westermann
Frequent Advisor

static routes added on startup

In what file do I make an adjustment or what file do i create to automatically add three static routes to my HPUX server on start up? I was looking in /etc/rc.config.d/netconf but am not sure that is where the add needs to be.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: static routes added on startup

That's the one! They go in this section:

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=130.1.0.248
ROUTE_COUNT[0]=1
ROUTE_ARGS[0]=""

and the subscript [0] get incremented for each subsequent route.


Pete

Pete
Ross Zubritski
Trusted Contributor

Re: static routes added on startup

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="X.X.X.X"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
# Destination
ROUTE_DESTINATION[2]=X.X.X.X
ROUTE_MASK[2]=""
ROUTE_GATEWAY[2]=X.X.X.1
ROUTE_COUNT[2]=1
ROUTE_ARGS[2]=""
# Destination
ROUTE_DESTINATION[3]=X.X.X.X
ROUTE_MASK[3]=""
ROUTE_GATEWAY[3]=X.X.X.X
ROUTE_COUNT[3]=1
ROUTE_ARGS[3]=""

Just rememeber to increment the idex number [x]. And do not duplicate.

Regards,

RZ
Gavin Westermann
Frequent Advisor

Re: static routes added on startup

One more point of clarity. the routes I need to add are network routes. by the command line I would add: route add net 10.1.193.0 255.255.255.0 192.168.49.1 1

How would I sytax the ROUTE_DESTINATION[0]= part?
Ross Zubritski
Trusted Contributor

Re: static routes added on startup

# Destination
ROUTE_DESTINATION[x]=10.1.193.0
ROUTE_MASK[x]=255.255.255.0
ROUTE_GATEWAY[x]=192.168.49.1
ROUTE_COUNT[x]=1
ROUTE_ARGS[x]=""

Sridhar Bhaskarla
Honored Contributor

Re: static routes added on startup

Hi Gavin,

As mentioned by Ross except you have to add "net" if the destination is a subnet.

ROUTE_DESTINATION[x]="net 210.210.210.0"
ROUTE_MASK[x]="255.255.255.0"
ROUTE_GATEWAY[x]=200.200.200.1
ROUTE_COUNT[x]=1

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Gavin Westermann
Frequent Advisor

Re: static routes added on startup

excellent! - Thanks again for the help - issue solved.

Gavin
W.C. Epperson
Trusted Contributor

Re: static routes added on startup

Gavin,

They solved your issue, but don't deserve any points?
"I have great faith in fools; self-confidence, my friends call it." --Poe