1825764 Members
2138 Online
109687 Solutions
New Discussion

Two default gateways

 

Two default gateways

I am working on configuring a BigIP network load balancer to work with an HP N-class server running HPUX 11.

I have noted something unusual and was wondering if anyone could shed some light on it.

In SAM, I show the default gateway as the IP address of the F5 box, which is what I tried setting it to. Yet if I run /sbin/set_parms addl_netwrk, it shows the default gateway as the original gateway. In the /etc/rc.config.d/netconf file, the gateway for the interface lan0 is the original gateway.
Also, both gateways show when doing a 'netstat -r'

When I implement the F5 the lan0 interface will be disabled via SAM and the eight additional nics that I have in the system will be running (each with its own IP in its own subnet)

5 REPLIES 5
RAC_1
Honored Contributor

Re: Two default gateways

set it through SAm or set_params and do
through console do
/sbin/init.d/net stop;/sbin/init.d/net start
There is no substitute to HARDWORK

Re: Two default gateways

Would it also be possible to make changes in the netconf file, by setting the default gateway for each interface?
RAC_1
Honored Contributor

Re: Two default gateways

I do not think it is possible. If you want to reach particular network through particular router/swtich, you can do that.

route add net "network" netmask "xx" "router" 1

Anil
There is no substitute to HARDWORK
Wilfred Chau_1
Respected Contributor

Re: Two default gateways

Add it to /etc/rc.config.d/netconfig. Change
the [x] index as necessary.

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

Per RAC example,
You can do
ROUTE_DESTINATION[1]="net 192.168.0.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="192.168.0.1"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

run, /sbin/init.d/net start
check with netstat -rn
Andrew Cowan
Honored Contributor

Re: Two default gateways

Wilfred is correct in that you can now have in effect two or more default gateways as HP-UX binds the route to the NIC adapter. This behaviour was first introduced in AIX, but now also exists in Linux.