1825768 Members
2146 Online
109687 Solutions
New Discussion

add route in netconf

 
SOLVED
Go to solution
Clode
Advisor

add route in netconf

Hello,

I'm configuring the permanenet route in netconf file:
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="10.35.2.18"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[1]="10.35.66.0"
ROUTE_MASK[1]="255.255.255.224"
ROUTE_GATEWAY[1]="10.35.2.18"

but I have get the following error:

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

Can you help me ??
thanks
11 REPLIES 11
Peter Nikitka
Honored Contributor

Re: add route in netconf

Hi,

seeing this route configuration
>>
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="10.35.2.18"
<<
I guess you've configured a class-A network and so route destinations internal to your native network are of no use.
Like I said: just a guess.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Geoff Wild
Honored Contributor

Re: add route in netconf

Well this looks completely wrong to me (or is it Friday the 13th?).

Your default route is already set to: 10.35.2.18

So why add it to the permanent route?

Rgds...Geoff



Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Sandman!
Honored Contributor

Re: add route in netconf

As the error suggests your netmask value is bad. Is the destination to a host or network? You need to be specific in the value of the ROUTE_DESTINATION or defaults will apply. Imho according to the 255.255.255.224 netmask value the destination can only be a network address.
John Guster
Trusted Contributor

Re: add route in netconf

remove these lines
ROUTE_DESTINATION[1]="10.35.66.0"
ROUTE_MASK[1]="255.255.255.224"
ROUTE_GATEWAY[1]="10.35.2.18"


you should be fine.
Ben Dehner
Trusted Contributor

Re: add route in netconf

Are you sure you're looking at the right section of the netconf file? If there is a problem earlier in the file, where the IP address on the interface is configured, then that would cause the failure in adding the routes. That seems to be what the error "interface is not yet initialized" is indicating.

The message "netmask: bad value" may be referring to the SUBNET_MASK[x] parameter for the interface configuration.
Trust me, I know what I'm doing
Matti_Kurkela
Honored Contributor

Re: add route in netconf

Another possible reason for the error message is that you haven't specified a ROUTE_COUNT value.

If you don't specify it, the count is assumed to be 0 i.e. the "gateway" is supposed to be one of the machine's local NICs. This is an old quirk of HP-UX.

As others have noted, adding a permanent route with a gateway that is the same as your default gateway is usually worthless.

The general idea of the route specifications is like "to access ROUTE_DESTINATION, send to ROUTE_GATEWAY and let it handle the rest". The default gateway is always used if the destination is not directly reachable using the machine's local interfaces and there isn't any route definition that would apply more specifically.

MK
MK
Clode
Advisor

Re: add route in netconf

Thanks to all

My address is 10.35.2.22 and my gateway is 10.35.2.18.
The problem is that this gateway is not will be permanent and I have to reacheble the machine trough the static route.
I have to add route for 3 network always for the same gateway 10.35.2.18.
I added the route by command line:
route add 10.35.66.0 10.35.2.18 255.255.255.224
..and this works fine.
But if reboot the machine I loss my static route....

thanks again
Murat SULUHAN
Honored Contributor

Re: add route in netconf

Hi

Can you send your /etc/rc.config.d/netconf file

Best Regards
Murat
HP
Murat Suluhan
Sandman!
Honored Contributor

Re: add route in netconf

Could you provide the exact "route add" command you used. Also please post the output of the following commands:

# cat /etc/rc.config.d/netconf
# netstat -rn

The problem might go away if you put in the "net" keyword and the route count equal to 1 (since this is a route thru a remote gateway) as in:

# route add net 10.35.66.0 255.255.255.224 10.35.2.18 1

~hope it helps
V. Nyga
Honored Contributor
Solution

Re: add route in netconf

Hi,

try this one:

ROUTE_DESTINATION[0]="net 10.35.66.0"
ROUTE_MASK[0]="255.255.255.224"
ROUTE_GATEWAY[0]="10.35.2.18"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

maybe better:
ROUTE_MASK[0]="255.255.255.0"

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Clode
Advisor

Re: add route in netconf

thank you
I configured my netconf :
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="10.35.2.18"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[1]="net 10.35.66.48"
ROUTE_MASK[1]="255.255.255.240"
ROUTE_GATEWAY[1]="10.35.2.18"

ROUTE_DESTINATION[2]="net 10.35.66.0"
ROUTE_MASK[2]="255.255.255.224"
ROUTE_GATEWAY[2]="10.35.2.18"

ROUTE_DESTINATION[3]="net 10.35.7.0"
ROUTE_MASK[3]="255.255.255.240"
ROUTE_GATEWAY[3]="10.35.2.18"


It works fine.