to enable 2nd gateway

HI admins,

Server is AIX 5.2

I have 2 NIC card enabled with 2 vlan ips.

en0 - 10.50.102.25 gw 10.50.102.1
en4 - 10.50.103.25 gw 10.50.103.1

I have configured via smitty. But automaticall gateway of en4 changes to 10.50.102.1.

How to make it work so both NICs gets different gateways.

# ifconfig -a
en0: flags=4e080863,80<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG,CHAIN>
        inet 10.50.102.25 netmask 0xffffff00 broadcast 10.50.102.255
en4: flags=4e080863,80<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG,CHAIN>
        inet 10.50.103.25 netmask 0xffffff00 broadcast 10.50.103.255
lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1/0
         tcp_sendspace 65536 tcp_recvspace 65536
#
# netstat -nr
Routing tables
Destination      Gateway           Flags   Refs     Use  If   PMTU Exp Groups
 
Route Tree for Protocol Family 2 (Internet):
default          10.50.102.1       UGc       0        0  en0     -   -   =>
default          10.50.103.1       UGc       0        0  en4     -   -
10.50.102.0      10.50.102.25      UHSb      0        0  en0     -   -  =>
10.50.102/24     10.50.102.25      U         3        6  en0     -   -
10.50.102.255    10.50.102.25      UHSb      0        5  en0     -   -
10.50.103.0      10.50.103.25      UHSb      0        0  en4     -   -  =>
10.50.103/24     10.50.103.25      U         4      181  en4     -   -
10.50.103.25     127.0.0.1         UGHS      0        4  lo0     -   -
10.50.103.255    10.50.103.25      UHSb      0        0  en4     -   -
10.50.111.200    10.50.103.1       UGHW      1      452  en4     -   -
10.55.12.155     10.50.103.1       UGHW      0       26  en4  1500     1
10.55.68.10      10.50.102.1       UGHW      1       99  en0  1500   -
10.55.68.11      10.50.103.1       UGHW      0        3  en4     -     1
127/8            127.0.0.1         U         5      207  lo0     -   -
 
Route Tree for Protocol Family 24 (Internet v6):
::1              ::1               UH        0        0  lo0 16896   -
 

Can we enable both the gateways.

Regards
newaix

well you have one default gateway, that needs to be in the same subnet as one interface ip, all machine traffic that goes to an ip not in the same subnet as your interface ips is sent over the default gateway

having more then one default gateway does not make sense to me, in case you want to reach different ip subnets over your non default gw interface, set static host or netroutes (smitty route)

in your case a standard configuration would be

en0 - 10.50.102.25 default gw 10.50.102.1
en4 - 10.50.103.25

packet goes to 84.34.21.57: sent to 10.50.102.1 over en0
packet goes to 10.50.103.199: sent over en4 directly to this ip without gw
packet goes to 10.50.102.199: sent over en0 directly to this ip without gw

maybe tell us what you want to accomplish with two default gateways?
cheers

Here is the requirement

Server with two nic with below ip config

en0 :10.50.102.25 mask : 255.255.255.0 GW: 10.50.102.1
en4: 10.50.103.25 mask : 255.255.255.0 GW:10.50.103.1

Routing Table should have two default routes as below

Default Route 1 : pointing to 10.50.102.1
Default Route 2 : pointing to 10.50.103.1

Challenge : I configured both NICs without giving GW. Then I added the default routes. After this Both NIC is showing the GW as 10.50.102.1.

I agree that this is not a standard configuration, but we have one critical server in production with two nics. When we migrate this server behind firewalls we are facing some issues. We observed that with the configuration as per my requirement in a windows machine things works well. So we have arranged a test AIX box and trying to perform the same.

Any help is much appreciated.

since aix 5.1 dead gateway detection was introduced, so you may have a fallback default gateway in case your primary one dies

look at this manual:

Help -

Thanks for the response.

But i didnot understand why gw of en4 automatically changes from 10.50.103.1 to 10.50.102.1.

My intention is to configure en0 with gw 10.50.102.1 and en4 with 10.50.103.1

Please suggest

Regards\newaix

---------- Post updated at 01:26 PM ---------- Previous update was at 01:11 PM ----------

My plan is to reconfigure en4 with without gateway and to add a static route gateway 10.50.103.1 in routing table.
Regards
newaix

Hi,

I don't understand how you have configured 2 default gateways in windows. As far as i know any os allows only one default gateway. For other network you have to manually add routes. In aix you have dead gateway detection but in windows there is no such option.

Maybe try to explain why you need 2 default gateway then maybe we will be able to provide proper solution

How have you added it ?
try smitty route > add static gateway
over there you have possibility to select an interface have you did that ?