1832442 Members
3234 Online
110042 Solutions
New Discussion

Re: double gateway

 
SOLVED
Go to solution
Stefano_1
Frequent Advisor

double gateway

I have a Server with two lan interfaces.
I need to configure for each interface a different default gateway.

How can I do this?
12 REPLIES 12
John Bolene
Honored Contributor

Re: double gateway

You can't.

The default gateway is for the machine to know where to send traffic first. This is normally set up as the high traffic side.

It is up to the router it is connected to , to decide where the message needs routed to.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Rainer von Bongartz
Honored Contributor
Solution

Re: double gateway


do this in your network config file /etc/rc.config.d/netconf, the restart with /sbin/init.d/net stop and /sbin/init.d/net start
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Stefano_1
Frequent Advisor

Re: double gateway

Is it correct?

#netstat -rvn
Routing tables
Dest/Netmask Gateway Flags Refs Use Interface Pmtu
127.0.0.1/255.255.255.255
127.0.0.1 UH 0 15977 lo0 4136
10.192.35.20/255.255.255.255
10.192.35.20 UH 0 0 lan1 4136
10.192.35.28/255.255.255.255
10.192.35.28 UH 0 51 lan0 4136
10.192.35.16/255.255.255.248
10.192.35.20 U 2 0 lan1 1500
10.192.35.24/255.255.255.248
10.192.35.28 U 2 0 lan0 1500
127.0.0.0/255.0.0.0 127.0.0.1 U 0 0 lo0 4136
default/0.0.0.0 10.192.35.17 UG 0 0 lan1 1500
default/0.0.0.0 10.192.35.25 UG 0 0 lan0 1500
Rainer von Bongartz
Honored Contributor

Re: double gateway

looks pretty good.....
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Stefan Schulz
Honored Contributor

Re: double gateway

It's never to late to learn something new. I would have sworn that it is not allowed to have two default gateways. But it is. Here is a part from man 7 routing which gave me the hint:

------- snip ------

select the host route entry. The default route by default has a
destination/netmask pair of (0,0). Therefore the default route matches
all destinations but it is also the least specific. The default route
will be selected only if there is not a more specific route.

There may still be multiple routing entries remaining. In that case
the IP packet is routed over the first entry displayed by netstat -r.
Such multiple routes include:

+ Two or more routes to a host via different gateways.
+ Two or more routes to a network via different gateways.
+ Two default routes.

------- snip ------

So if i interprete this right, your routing looks fine.

Hope this helps

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

Re: double gateway

You can set a gateway for each network card, but there can only be one default gateway, which I thought the question asked.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
rick jones
Honored Contributor

Re: double gateway

there is nothing in HP-UX that prevents you from issuing multiple route commands for multiple default gateways, but only one will be used unless you are on HP-UX 11 and have set ip_strong_es_model.

rick jones
there is no rest for the wicked yet the virtuous have no pillows
Stefano_1
Frequent Advisor

Re: double gateway

I'm on HP-UX 11, but where I can modify that parameters?
Mark van Hassel
Respected Contributor

Re: double gateway

Stefano,

You can set this using ndd, see 'ndd -h supported' and the man page. ALso check 'ndd -h ip_strong_es_model for a description.

AS people explained earlier, it is normally possible to define more than one default gateway , however under normal circumstances only one is used. However it is usefull as a 'standby'when the first gateway is not reachable or the NIC fails for example.
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us

Re: double gateway

To set the ip_strong_es_model, take a look at the ndd(1m) command.
To check it's current setting use:

ndd -get /dev/ip ip_strong_es_model

To actually set it use:

ndd -set /dev/ip ip_strong_es_model 1

This can be made a permanent change across reboots by adding this info into the /etc/rc.config.d/nddconf file.

Rick - aren't there some potential issues with setting this parameter that Stefano should be aware of? (I seem to remember some posts on comp.sys.hp.hpux from you on this subject)

I am an HPE Employee
Accept or Kudo
T G Manikandan
Honored Contributor

Re: double gateway

Hello,
I probably feel that you cannot use both the gateway's at the same time.May be one gateway for a sp.network or another gwy for the other.
Whenever the system parses the routing table,it reads from the first entry i.e from top to bottom.Though you have added two entries only the first one will be used.

Thanks.
GM
Stefano_1
Frequent Advisor

Re: double gateway

Hi all,
I have a problem...
I have defined the parameters "ip_strong_es_model" = 1, but in some case I can't ping some IP address because the server uses the wrong default gateway.The problem is not persistent, sometimes works fine, sometimes it doesn't work.
Can you help me??