2 default gateways

I have a bunch of servers on AIX, we have at least 2 NIC cards in each of them.

We upgraded them from AIX 4.2 to AIX 5.2. Since then when we reboot a server its always coming up with 2 default gateways. Habitually this is not a problem but sometime its causing some connection problem. We remove the 2nd gateway manually and then everything is fine until next reboot. We never had this problem with AIX 4.2.

When I'm looking in "smitty tcpip" both nic card are pointing on the same gateway so I'm really confused about where this can come from. I tried to find out but I didnt have any luck. I'm planning to have a script to remove it at boot time but i would like to have a cleaner solution or at least to know why its happening.

Anyone having a clue where i can fix that ?

A duplicate default route might lead to every second data packet getting lost.
A route that becomes active with reboot is either defined in the ODM or activated with the route add command from an rc file (most likely rc.net) that is called from inittab.
Check ODM routes with

# odmget -q attribute=route CuAt

Remove a route from the ODM with the chdev command that is accessible from the SMIT panel

 # smitty rmroute

If there are no entries in the ODM check for stanzas like

route add ....

in /etc directory.

Returns nothing:

# odmget -q attribute=route CuAt
#

I checked :

# cd /etc
# for file in `find . -type f`
> do
>    grep "route" $file | grep -v "^#" 
> done

and found no "route add defautl" matching the 2nd default gateway

Thanks a lot for the reply.

A default route does not need to be set with the word "default".... Btw. how is the first default route set?

When I "smitty tcpip", "minimum configuration", en0 or en1. I can see the default gateway address in that screen and it's the same address for both NIC cards.

There is no "route add" with the address specified as the second default gateway

Hm... First thought: The default gw that is visible in the minimum configuration is in the ODM. So we may have a problem here as you said odmget did not return any routing information.

Second thought: it would be wrong to use "minimum configuration" for more than one interface. This panel is meant to be used just once i.e. on first time configuration when setting hostname etc. For any other interface and all additional configuration the panel "further configuration" shall be used.

In case you did use minimum configuration twice I'd recommend to log in to the server through the primary interface. Use ifconfig to set the other (secondary) interface down, detach it, then rmdev -dl the en device to delete all information about it. Run cfgmgr to recreate the en device and then use "smitty tcpip, further configuration" to configure the second interface again.

Hi,
we had similar issues - and root cause was our nimserver - each time we connected to it, it put a second default route onto our box ... which can be savely removed.

Are you running etherchannel or do your nics have separate IPs?

Kind regards
zxmaus

I forgot to mentionned that we have over 50 AIX servers and almost all of them are showing this behavior...

I didn't use it to set the gateway, just to check what it was set to.

You are saying that the NIM server set those gateways on the remote system ? Effectively all our servers were build via a NIM server but we rarely use the NIM server for other operation on the clients. And as I already said, the 2nd default gateway come back when we reboot the server.

Some of our machines do have etherchannel but its not use on the main IP address (primary default).

Thanks all for your inputs

It's important that you do not use smitty mktcpip on the second adapter. Instead, use

smitty chinet

. This will set the IP on that adapter without adding an additional default gateway.

I've had this problem in the past, and I've always cleared it using

smitty rmroute

Can you post your routing table with the extra route listed?

We have that kind of phenomenom sometimes too - and as zxmaus says we also think it might be something from our NIM server after an installation of an LPAR.
Though we always had entries in the ODM like shockneck noted.

If you are absolutely sure that there is no entry of that wrong additional default gateway in the ODM, you can try to write a new boot image with

bosboot -ad /dev/ipldevice
# or
savebase

and check if it is still there after a reboot.

If so, you also might want to check if there is a line in any of your scripts in /etc like rc.tcpip or rc.net that have a line for adding that default GW, just to make sure there isn't:

find /etc -type f -exec grep -lE "route add|chdev|mktcpip" {} \;

It might list some relevant looking files which might be worth to check.

Like zxmaus, we had this issue too. Cat your /etc/niminfo file and look at the last line that starts with "export ROUTES=". It probably looks something like this:

[CODE]export ROUTES=" default:0:192.168.1.1 ..."[CODE]

Rename the /etc/niminfo file to /etc/niminfo.old and run "smitty nim" on your client machines and go through the setup steps again. Then look at the /etc/niminfo file and see if it looks correct after that.