Sunday, January 23, 2011

How to find and remove a duplicate default route

Here's how to find and remove a duplicate default route (or other bad route):


Method 1:
=> lsattr -El inet0
authm         65536                            Authentication Methods              True
bootup_option no                               Use BSD-style Network Configuration True
gateway                                        Gateway                             True
hostname      phimords001                      Host Name                           True
rout6                                          IPv6 Route                          True
route         net,-hopcount,0,,0,10.80.81.1    Route                               True
route         net,-hopcount,0,,0,176.230.125.1 Route                               True

Removing the duplicate default route:

smitty route
 remove a static route <==  put 'default' in as destination address, and put the duplicate default ip in as the gateway:



                              Remove Static Route

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
  Destination TYPE                                    net                    +
* DESTINATION Address                                [default]
  (dotted decimal or symbolic name)
* GATEWAY Address                                    [176.230.125.1]
  (dotted decimal or symbolic name)
  Network MASK (dotted decimal)                      []


Hit enter, the command will "appear" to fail, but is not failing, it does remove the duplicate default:


                                 COMMAND STATUS

Command: failed        stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

Method error (/usr/lib/methods/chginet):
        0514-085 Error controlling a device path in the kernel.
writing to routing socket: No such process
entry not in table or multiple matches
0821-103:  The command /usr/sbin/route delete -net  0 176.230.125.1 failed.


=> lsattr -El inet0
authm         65536                         Authentication Methods              True
bootup_option no                            Use BSD-style Network Configuration True
gateway                                     Gateway                             True
hostname      phxxxxxxs001                   Host Name                           True
rout6                                       IPv6 Route                          True
route         net,-hopcount,0,,0,10.80.81.1 Route                               True


Method 2:
lsattr -El inet0 -> sees bad route
chdev -l inet0 -a delroute=<bad routes>
lsattr -El inet0 -> bad routes removed

No comments:

Post a Comment