Operating System - HP-UX
1826069 Members
3678 Online
109690 Solutions
New Discussion

Multiple default gateway, how to force using one

 
ffiskandar
New Member

Multiple default gateway, how to force using one

So here's my server (A) network configuration, simply like this:

127.0.0.1              255.255.255.255   127.0.0.1                No               lo0
192.168.202.XX   255.255.255.255   192.168.202.XX    No               lan
192.168.97.YY     255.255.255.255    192.168.97.YY       No               lan
192.168.202.0     255.255.255.255   192.168.202.254   Yes              lan
192.168.97.0       255.255.255.255    192.168.97.254     Yes              lan
192.168.202.0     255.255.255.0       192.168.202.XX     No               lan
192.168.97.0       255.255.255.0       192.168.97.YY       No               lan
127.0.0.0             255.0.0.0              127.0.0.1                No               lo0
default               0.0.0.0                  192.168.97.254     Yes              lan
default               0.0.0.0                  192.168.202.254   Yes              lan

My issue is that I have another server (B) in segment 192.168.183.0 and it can only be accessed from segment 192.168.97.0

But using that routing configuration, when I try to reach server B the traffic seems to be ticktocking between gateway 192.168.97.254 and 192.168.202.254 (which will make it unreachable)

How do I force it to always use 192.168.97.254 as the default gateway?

I use 192.168.202.254 as the gateway for doing ignite backup.

 

Thanks,

Felix

1 REPLY 1

Re: Multiple default gateway, how to force using one

long time since I did this and not at a machine right now to check, but IIRC corerctly you simply add the non-preferred gateway with a higher route count (hops - the last argument in the "route add default" command that is sually set to 1) or ROUTE_COUNT[x]=n value in netconf - set it to 2 rather than 1 and the gateway set to 1 will be preferred.

But as I said its years since I looked at this...


I am an HPE Employee
Accept or Kudo