Operating System - HP-UX
1851072 Members
1834 Online
104056 Solutions
New Discussion

Re: trouble adding route at boot

 
SOLVED
Go to solution
Rick Garland
Honored Contributor

trouble adding route at boot

Hi all:

Trying to add a route into the routing table at boot time. Have made the requisite entry into the /etc/rc.config.d/netconf file as follows:

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="172.20.66.254"
ROUTE_COUNT[0]=""
ROUTE_ARGS[0]=""
ROUTE_DESTINATION[1]="host 10.1.0.54"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="172.20.65.12"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

When I issue the net stop/net start commands or watch from boot, I get the following:
"Failed to add route entry because its interface is not yet initialized. May need to add this route manually with a route command after the interface is up : add host 10.1.0.54 gateway 172.20.65.12 Network is unreachable"

I am able to add the route manually. Whats the difference?
6 REPLIES 6
Printaporn_1
Esteemed Contributor
Solution

Re: trouble adding route at boot

Hi,

I think you better start checking error for net initialization in /etc/rc.log
or explicite specify submetmask for route entry.
enjoy any little thing in my life
Charles Harris
Super Advisor

Re: trouble adding route at boot

This problem is caused when the startup scripts for you network interface(s) arn't run before the script to add your route is called. There are a couple of ways around this (That I know of) although wether there technically correct or not remains to be seen......

1st one is: try moving your network startup script in /sbin/rc2.d/S340net into rc1.d/ to bring the interface(s) up earlier which might do it.....

or

Add your own S???routes to your init.d using the normal route add procedure.

ie.Create S???routes (linked to init.d)
Create routes (/sbin/init.d)
route add default gw 192.168.1.1 etc.....

I have done both of these in the past (AIX) for Tivoli problems and it worked okay!

Hope this helps!

-ChaZ-
Charles Harris
Super Advisor

Re: trouble adding route at boot

I'll get my coat........


-ChaZ-
Stefan Schulz
Honored Contributor

Re: trouble adding route at boot

What is your netmask? Asking because your gateway0 and gateway1 are in different subnets (172.20.66 and 172.20.65).

Hope this is no typo ;-)

If everything for the 172.20.65 network is routed throug the defaultgateway it may also be that the routing table isn't jet build. Then you could add the second route in a seperate startscript some time after the net startup.

Regards Stefan.
No Mouse found. System halted. Press Mousebutton to continue.
John Bolene
Honored Contributor

Re: trouble adding route at boot

In /sbin/rc3.d we added a S100route module to add more routes.

This is after the interfaces are enabled.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Joseph C. Denman
Honored Contributor

Re: trouble adding route at boot

what about adding this to the above the rout_dest[1]

INTERFACE_STATE[1]=up

...jcd...
If I had only read the instructions first??