Operating System - HP-UX
1836588 Members
1484 Online
110102 Solutions
New Discussion

Two default gateways via different lan cards

 
Lora Ganeva
Regular Advisor

Two default gateways via different lan cards

Hi,
I have an HPUX 11i with two lan cards in different gateways.
I want to configure the server to have two different default gateways, but i would like lan0 to be the first and lan2-the second and lan2 to be used only if lan0 is down.
Although I have configured the first defualt route via lan0 with route count 1 and the second - with route count 2, the second is always put before the first(via lan0) in the routing table.
What could be the reason for this?
Any help would be greatly appreciated.
4 REPLIES 4
Ravi_8
Honored Contributor

Re: Two default gateways via different lan cards

Hi,

ROUTE_DESTINATION[2]="default"
ROUTE_MASK[2]=""
ROUTE_GATEWAY[2]=""
ROUTE_COUNT[2]="1"
ROUTE_ARGS[2]=""

must exist in /erc/rc.config.d/netconf for the
lan2
never give up
Adam J Markiewicz
Trusted Contributor

Re: Two default gateways via different lan cards

Hi

I'm not sure, but maybe everything is as you expect? What do you mean 'put second before first in routing table'? Do you mean it shows up earlier in netstat -r? But does it really matter?
The important thing is which one is chosen. You should check routing done for real connections rather than 'what comes first in report from netstat -r'.

My 2 words. Please don't kill me if I'm wrong. :)

Good luck
Adam
I do everything perfectly, except from my mistakes
Ron Kinner
Honored Contributor

Re: Two default gateways via different lan cards

I don't think the order really matters. Do a traceroute to remote host where it has to use the default and see if it looks like it is using the correct lan.

You can also try
netstat -rnv

and see if it gives you the correct usage info. (It's sort of broken in 11.0)

Ron
Jeff Schussele
Honored Contributor

Re: Two default gateways via different lan cards

Hi,

traceroute is kind of "broken" in 11i.
If you just do a normal traceroute it will *try* to go out the first device displayed in a netstat -in output.
You have to force it out the proper lanX device with -i.

Not sure what's broken, but it's a major pain for us as ALL our servers have multiple I/Fs - 1 for public IP & 1 for bulk-data xfer (our dedicated backup network).

I thought you can only have one default route. If you want others, you have to add static routes. But I could be wrong.....

My $0.02,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!