Operating System - HP-UX
1833178 Members
2795 Online
110051 Solutions
New Discussion

Re: Automatic Route addition problem

 
Amod
Occasional Advisor

Automatic Route addition problem

Hi all,

I want to add following route to my HP 11.11 server everytime it boots. The command which works fine on prompt is

# route add net 10.10.2.0 netmask 255.255.255.0 192.168.8.149

192.168.8.149 is the server's own IP.

My entires in /etc/rc.config.d/netconf corresponding to this route are

ROUTE_DESTINATION[1]=10.10.2.0
ROUTE_MASK[1]=255.255.255.0
ROUTE_GATEWAY[1]=192.168.8.149
ROUTE_COUNT[1]=0

Somehow the startup script fails to add the static route. Is anything wrong with my netconf entries ?
If you can't change it, enjoy it !!
10 REPLIES 10
Balaji N
Honored Contributor

Re: Automatic Route addition problem

hi,

is there any error it is giving.

try running the /sbin/init.d/net start & see if there is any errors reported. also, can u see /etc/rc.log if there are any errors.

is there any duplicate route_..[1] entry in the netconf file.

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Amod
Occasional Advisor

Re: Automatic Route addition problem

I get following error in /etc/rc.log

Output from "/sbin/rc2.d/S340net start":
----------------------------
ERROR: Failed to add route entry because its interface is not yet initialized. May need to add this route entry with a route commad after the interface is up :
netmask: bad value

Point to note this server NIC has 2 IPs assigned to it.

lan0 = 192.168.8.149
lan0:1 = 192.168.8.201

Is the script referring to the virtual interface when adding net
If you can't change it, enjoy it !!
T G Manikandan
Honored Contributor

Re: Automatic Route addition problem

If it is lan0 then you should have entries like

INTERFACE_NAME[0]="lan0"
ROUTE_DESTINATION[0]=10.10.2.0
ROUTE_MASK[0]=255.255.255.0
ROUTE_GATEWAY[0]=192.168.8.149
ROUTE_COUNT[0]=0

replace [1] with [0]
you can use something like this
INTERFACE_NAME[0]="lan0"
INTERFACE_NAME[1]="lan0:1"


Then do a /sbin/init.d/net stop
& start

Revert
Amod
Occasional Advisor

Re: Automatic Route addition problem

Hi TG,

I think you misunderstood the 2 IPs thing. I am attaching my entire 'netconf' file for your reference.

If you can't change it, enjoy it !!
Balaji N
Honored Contributor

Re: Automatic Route addition problem

hi amod,

i am a bit confused.

the netconf file says as below
++++++++++++
# ROUTE_DESTINATION: Destination hostname (in /etc/hosts) or host or network
# IP address in decimal-dot notation, preceded by the word
# "host" or "net"; or simply the word "default".
++++++++++++++

so can u try adding a net:10.X.X.X in the route destination and see if it works. coz, the error message also says netmask: bad value.

pls check and revert.
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Michael Duthie
Trusted Contributor

Re: Automatic Route addition problem

First thing I have noticed is you have missed the hops of the end of the route statement.


route add net 10.10.2.0 netmask 255.255.255.0 192.168.8.149 1

and in the netconf Route_count=1

are you sure the netmask is correct?


Amod
Occasional Advisor

Re: Automatic Route addition problem

Hi Balaji,

I tried all combinations of 'net' preceding the 10.x.x.x

net:10.x.x.x gives 'bad value' error.

Amod.
If you can't change it, enjoy it !!
Amod
Occasional Advisor

Re: Automatic Route addition problem

Mike,

On command prompt I didn't specified any hop count but it still works.

In 'netconf' ROUTE_COUNT is '0' for this perticular route entry. Which according to the text in netconf for local interface.

ROUTE_COUNT:An integer that indicates whether the gateway is a remote interface (one) or the local interface (zero) or loopback interface (e.g., 127.*)

Amod.
If you can't change it, enjoy it !!
Michael Duthie
Trusted Contributor

Re: Automatic Route addition problem

Amod,

I have always been told (HP internal & external courses) that the hop/count should always be "1" no matter what. If in reality it does need more hops, the routers take care of it.
Ron Kinner
Honored Contributor

Re: Automatic Route addition problem

This configuration is a way of using proxy arp so I guess that is what you are trying to do and if so the 0 hop count is correct.

Since you are getting an error message about the netmask and there is obviously nothing wrong with the netmask you may need to turn off subnet checking in ndd.

ndd -get /dev/ip ip_check_subnet_addr

If you get a 1 then you need to do the following:

Edit the file /etc/rc.config.d/nddconf
to add the following entries using whatever is the next available integer in the brackets if you already have entries:

TRANSPORT_NAME[0]=ip
NDD_NAME[0]= ip_check_subnet_addr
NDD_VALUE[0]=0

Reboot and see if you still have your problem.

Ron