• Home
  • About Me
  • Contact Me
837 3750 ADS aix backup catalyst cisco cisco ios ftp hmc ibm ios juniper LDAP linux nas network nfs p-series password prestashop radius router sfu ssh steel belted tftp unix vpn windows
more tags
Home

Deleting Duplicated default gateways on AIX

  • aix
  • default gateway
  • lsattr
  • network
  • pseries
  • smitty
  • unix

Ever had that weird problem on AIX where your routing table has a second default gateway?

I had and this is how i fixed it. In my case when I changed a ip address and default gateway in smitty, the routing table ended up with TWO default gateways. This is bad news if your machine is a seperate vLAN or subnet and needs to communicate outside of this vLAN or subnet.

The example below shows the output of a netstat -rn. In it you can see two default gateways. One is correct 10.2.98.113 and the other 10.0.72.16 is incorrect.

However the incorrect one is not listed in aix smitty nor is it in /etc/rc.net /etc/defaultgateways.

To get rid of the rogue gateway and restore connectivity I listed the device attributes for the interface. To do this type from the aix machine console I typed:

lsattr -E -l inet0

which gave the following output

# lsattr -E -l inet0
authm         65536                          Authentication Methods
True
bootup_option no                             Use BSD-style Network Configuration
True
gateway                                      Gateway
True
hostname      AAAUSINISNDPOL01               Host Name
True
rout6                                        IPv6 Route
True
route         net,-hopcount,0,,0,10.0.72.1   Route
True
route         net,-hopcount,0,,0,10.2.98.113 Route
True

I then typed the chdev command again from the aix console. NOTE: Caution when doing this if connected over a network interface from another host as you are altering the network!!

chdev -l inet0 -a delroute=net,-hopcount,0,,0,10.0.72.1

if you look at closely this chdev command you can see basically the part after the delroute attribute was copied exactly from the above lattrb command output. This is what you will need to do for your environment.

After this was completed the second default route was removed and connectivity was restored.

Tiaras Dog Harnesses