Phantom default gateway - Aix

This is a discussion on Phantom default gateway - Aix ; We had temporarily setup an ip on the second nic (en1) of a p510 (AIX 5.3.3 ML5). The second IP was a unique private range and had the default gateway of a bogus IP on that range as we didn't ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Phantom default gateway

  1. Phantom default gateway

    We had temporarily setup an ip on the second nic (en1) of a p510 (AIX
    5.3.3 ML5).

    The second IP was a unique private range and had the default gateway
    of a bogus IP on that range as we didn't want routing to occur.

    Once we had completed our use of the second nic, it was unplugged and
    was to remain configured but not in use.

    Obviously that now looks like the wrong way to have handled that.

    netstat -rn shows two default gateways of course, but I can't seem to
    permanently get rid of the "temporary" one.

    I "route delete default (our bogus ip)" to delete it and have tried to
    reset it to the "real" gateway in smit tcpip, but it still comes back
    as the bogus default route after a reboot.

    Now I've tried to remove the IP config of second nic altogether
    (blanking it out in smit) which seems to take, except again that
    default gateway keeps coming back after a reboot.

    Now I'm confused on where it is keeping that info and how to
    permanently get rid of it.
    Just going through smit and changing it isn't doing the job.

    I'm also trying to avoid just deleting it via script on startup.

    1. Was there a better way to have handled the "no route" between nics
    and not have a default gateway?

    2. How can I permanently set that adapter back to "nothing" (i.e. like
    it is when you've just installed)?

    Thanks


  2. Re: Phantom default gateway

    Hi,

    greetings from from Austria.

    Just one hint:

    Default GW entries are stored in device inet0.
    Customized routes (e.g. via smit) are stored in en0/en1 ...

    Clean up the inet0 device with chdev ...

    --jk

    Scottz wrote:
    > We had temporarily setup an ip on the second nic (en1) of a p510 (AIX
    > 5.3.3 ML5).
    >
    > The second IP was a unique private range and had the default gateway
    > of a bogus IP on that range as we didn't want routing to occur.
    >
    > Once we had completed our use of the second nic, it was unplugged and
    > was to remain configured but not in use.
    >
    > Obviously that now looks like the wrong way to have handled that.
    >
    > netstat -rn shows two default gateways of course, but I can't seem to
    > permanently get rid of the "temporary" one.
    >
    > I "route delete default (our bogus ip)" to delete it and have tried to
    > reset it to the "real" gateway in smit tcpip, but it still comes back
    > as the bogus default route after a reboot.
    >
    > Now I've tried to remove the IP config of second nic altogether
    > (blanking it out in smit) which seems to take, except again that
    > default gateway keeps coming back after a reboot.
    >
    > Now I'm confused on where it is keeping that info and how to
    > permanently get rid of it.
    > Just going through smit and changing it isn't doing the job.
    >
    > I'm also trying to avoid just deleting it via script on startup.
    >
    > 1. Was there a better way to have handled the "no route" between nics
    > and not have a default gateway?
    >
    > 2. How can I permanently set that adapter back to "nothing" (i.e. like
    > it is when you've just installed)?
    >
    > Thanks
    >


  3. Re: Phantom default gateway

    Scottz wrote:


    > netstat -rn shows two default gateways of course, but I can't seem to
    > permanently get rid of the "temporary" one.


    smitty tcpip -> STatic Routed -> Delete a static route

    confirm with lsattr -El inet0, there are the static routes listed, also
    the dafault gateways

    > I "route delete default (our bogus ip)" to delete it and have tried to
    > reset it to the "real" gateway in smit tcpip, but it still comes back
    > as the bogus default route after a reboot.


    This is only a temporary measure, remember the ODM.

    > 1. Was there a better way to have handled the "no route" between nics
    > and not have a default gateway?


    You forgot to remove the default route permanently.

    > 2. How can I permanently set that adapter back to "nothing" (i.e. like
    > it is when you've just installed)?


    rmdev -Rdl enX
    cfgmgr

    --
    Michael Prix


  4. Re: Phantom default gateway

    Johann Kappacher wrote:
    > Hi,
    >
    > greetings from from Austria.
    >
    > Just one hint:
    >
    > Default GW entries are stored in device inet0.
    > Customized routes (e.g. via smit) are stored in en0/en1 ...

    Sorry, a mistake!

    Static Routes are stored in inet0,
    Ip aliases are stored in en0/en1 ...

    --jk

  5. Re: Phantom default gateway

    On Sep 9, 7:14 am, Michael Prix wrote:
    > Scottz wrote:
    > > netstat -rn shows two default gateways of course, but I can't seem to
    > > permanently get rid of the "temporary" one.

    >
    > smitty tcpip -> STatic Routed -> Delete a static route
    >
    > confirm with lsattr -El inet0, there are the static routes listed, also
    > the dafault gateways
    >
    > > I "route delete default (our bogus ip)" to delete it and have tried to
    > > reset it to the "real" gateway in smit tcpip, but it still comes back
    > > as the bogus default route after a reboot.

    >
    > This is only a temporary measure, remember the ODM.
    >
    > > 1. Was there a better way to have handled the "no route" between nics
    > > and not have a default gateway?

    >
    > You forgot to remove the default route permanently.
    >
    > > 2. How can I permanently set that adapter back to "nothing" (i.e. like
    > > it is when you've just installed)?

    >
    > rmdev -Rdl enX
    > cfgmgr
    >
    > --
    > Michael Prix


    I seem to have the same issue (a route appear after a reboot, I delete
    it, but after rebooting it comes back).

    Michael, you mentioned removing them from the ODM. Do you have a set
    of instructions? Where are they stored?

    Thanks Miles


  6. Re: Phantom default gateway

    miles wrote:


    > I seem to have the same issue (a route appear after a reboot, I delete
    > it, but after rebooting it comes back).
    >
    > Michael, you mentioned removing them from the ODM. Do you have a set
    > of instructions? Where are they stored?


    Nothing special, just use smitty. The static routes are stored in inet0,
    and can be removed with

    smitty rmroute

    just check afterwards, if the offending entry is removed from inet0 by

    lsattr -El inet0

    If you don't see the route in netstat, and you perform the
    smit-operation, you will get an error but, the entry is still removed
    from inet0, as the underlying script tries to remove the entry from the
    active routingtable.

    --
    Michael Prix
    q: If you were young again, would you start writing TeX again or would
    you use Microsoft Word, or another word processor?
    a: I hope to die before I have to use Microsoft Word.
    -- asking Donald E. Knuth


  7. Re: Phantom default gateway

    On Sep 10, 10:44 am, Michael Prix wrote:
    > miles wrote:
    > > I seem to have the same issue (a route appear after a reboot, I delete
    > > it, but after rebooting it comes back).

    >
    > > Michael, you mentioned removing them from the ODM. Do you have a set
    > > of instructions? Where are they stored?

    >
    > Nothing special, just use smitty. The static routes are stored in inet0,
    > and can be removed with
    >
    > smitty rmroute
    >
    > just check afterwards, if the offending entry is removed from inet0 by
    >
    > lsattr -El inet0
    >
    > If you don't see the route in netstat, and you perform the
    > smit-operation, you will get an error but, the entry is still removed
    > from inet0, as the underlying script tries to remove the entry from the
    > active routingtable.
    >
    > --
    > Michael Prix
    > q: If you were young again, would you start writing TeX again or would
    > you use Microsoft Word, or another word processor?
    > a: I hope to die before I have to use Microsoft Word.
    > -- asking Donald E. Knuth


    This is interesting. As noted before, when I reboot I get two default
    gateways. One I want, the other I don't.
    After I reboot, netstat -r, shows (I'm guessing a bit):
    default BM1 UG 9 8149463 en1
    - -
    default MS UG
    en0

    So I always run:
    route delete default ms

    Which only works until the next reboot.

    But, as you noted, lsattr still shows the route:
    lsattr -El inet0
    ....
    route net,-hopcount,0,,0,10.113.210.1
    Route True
    route net,-hopcount,0,,0,10.113.210.202
    Route True

    Host ms is .202.

    I had a look at the smitty command (f6), and noticed it uses chdev,
    not route, to delete the route. ie:
    chdev -l inet0 -a delroute=$1,$arg2,$2,$3 with cmd_to_exec 'net'
    'default' 'ms'

    The smitty command will FAIL:
    Method error (/usr/lib/methods/chginet):
    0514-068 Cause not known.
    0821-279 writing to routing socket: The process does not exist.
    0821-103 : The command /usr/sbin/route delete -net 0 10.113.210.202
    failed.

    But the route STILL gets deleted:
    ....
    lsattr -El inet0
    route net,-hopcount,0,,0,10.113.210.1
    Route True

    I guess we shouldn't be using route delete, to delete any routes! I
    didn't know that.

    Thanks for you help.

    Miles







  8. Re: Phantom default gateway

    Thanks, the chdev option does "work" (albeit with the errors you
    mentioned for route which is understandable).

    What was odd was that there were more than a few other default routes
    listed for the primary adapter as well.
    These were historic/legacy default gateways used from the time the box
    was setup in house to when the box was installed on site.

    When switching segments, we would just go in with smit tcpip and
    change the info there.
    So apparently it doesn't overwrite this info in inet0, it just adds to
    it.
    Fortunately it seems to use the last one entered and doesn't add the
    others to your "live" routing table which is why probably nobody
    notices.

    It also mostly explains why blanking out the gateway for that nic in
    smit didn't delete it in inet0.
    It just didn't change anything and kept the old.

    Thanks for the help.


  9. Re: Phantom default gateway

    miles wrote:


    > I guess we shouldn't be using route delete, to delete any routes! I
    > didn't know that.


    As I said before: Remember the ODM. The route command only works against
    the actual routing-table, which will be flushed at a reboot (or network
    restart). Static entries reside in the ODM and are bound to the devices
    (enX, trX, ...) for device-attributes and inet0 for routing. These will
    be changed with chdev and/or the appropriate smit-menues.

    > Thanks for you help.


    You?re welcome.

    --
    Michael Prix
    The only sensible way to estimate the stability of a Windows
    server is to power it down and try it out as a step ladder.
    -- Robert Crawford, in the Monastery


+ Reply to Thread