Re: 2.2.14 and IP routing weirdness with IP aliases

From: dr john halewood (john@frumious.unidec.co.uk)
Date: Tue May 16 2000 - 12:06:28 EDT

  • Next message: kernel@kvack.org: "Re: write_trylock"

    On Tue, 16 May 2000, Kevin M. Myer wrote:
    > I have come across what appears to be a slight problem in the
    > implimentation of IP routing when IP aliasing is used in the 2.2.X kernel
    > series. Basically, the problem is this:
    > (snip)
    > This problem doesn't appear to exist in 2.0.X, as a packet sent to one
    > interface returns through that interface. I have not tested 2.3.X.
    >
    > By the way, this problem was seen with Red Hat Linux 6.1 (2.2.X) but not
    > with Red Hat Linux 5.2 (2.0.X kernel). I only have access to Red Hat
    > boxes so it would be nice if someone could test this on another
    > distribution to confirm that this is really a kernel problem and not an
    > init script problem with route setup.

    I came across this (or something very like it) a while ago and, after a bit of
    head scratching decided it to be a userspace problem. I had a machine with a
    similar setup and suddenly couldnt get out of the two local subnets. Debugging
    RH's ifup I found that it ran the following two commands when bringing the
    aliased interface up:
    adding route add -host 195.102.69.253 eth0:1
    adding route add default 195.166.20.3 eth0:1
    (195.166.20.3 being the default gateway for the network on eth0). Now I
    had a routing table that looked like this (with bits snipped):
     Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    195.102.69.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    195.166.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    0.0.0.0 195.166.20.3 0.0.0.0 UG 0 0 0 eth0
    0.0.0.0 195.166.20.3 0.0.0.0 UG 0 0 0 eth0
    /sbin/route and /proc/net/route don't know about eth0:1, only eth0
    and packets started coming out of the wrong interfaces. You can trivially fix
    it in RedHat by setting GATEWAYDEV in /etc/sysconfig/network to the correct
    interface or deleting the spurious second default gateway.
      If there is any issue with the kernel, I think its only in the way that the
    parsing of the routing table has changed since 2.0 - previously it would match
    the first default route and exit, now it parses the whole tree.

    cheers
    john

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Tue May 16 2000 - 13:13:22 EDT