Re: Equal Cost Multipath (more than one gateway)

From: Jacob Anawalt (anawaltaj@qwest.net)
Date: Wed Feb 07 2001 - 01:38:23 EST


Ok, this is were I am with ECMP now:

I have a RH 7 box with links to two isp's and an internal network. It is
responding to both isp interfaces, but traffic is only going out one of
them. I was hoping to achieve the affect I though I had read about,
where if I ping different ip addresses on the internet, the interface
used would change. I wasn't expecting to see it switch every time, but
at least once in ten different ip's.

The configure files claim that advanced router and multipath were
compiled in:

CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y

I don't have iproute/iptools on this box, the routing and ip assignments
were done with ifconfig and route:

eth0 Link encap:Ethernet HWaddr 00:01:02:D0:FA:BA
     inet addr:192.168.0.24 Bcast:192.168.0.255 Mask:255.255.255.0
     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
     RX packets:1660799 errors:1 dropped:0 overruns:0 frame:1
     TX packets:850828 errors:0 dropped:0 overruns:0 carrier:0
     collisions:5325 txqueuelen:100
     Interrupt:11 Base address:0xb000

eth1 Link encap:Ethernet HWaddr 00:01:02:2F:8A:F6
     inet addr:63.230.15.179 Bcast:63.230.15.183 Mask:255.255.255.248
     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
     RX packets:7005625 errors:0 dropped:0 overruns:0 frame:0
     TX packets:9378539 errors:0 dropped:0 overruns:0 carrier:0
     collisions:4786 txqueuelen:100
     Interrupt:5 Base address:0xb400

eth2 Link encap:Ethernet HWaddr 00:4F:4E:00:05:AF
     inet addr:207.224.221.223 Bcast:207.224.221.255
Mask:255.255.255.0
     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
     RX packets:572732 errors:1 dropped:0 overruns:0 frame:0
     TX packets:966302 errors:0 dropped:0 overruns:0 carrier:0
     collisions:10148 txqueuelen:100
     Interrupt:10 Base address:0xb800

lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:3924 Metric:1
    RX packets:108189 errors:0 dropped:0 overruns:0 frame:0
    TX packets:108189 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
63.230.15.176 0.0.0.0 255.255.255.248 U 0 0 0 eth1
207.224.221.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 207.224.221.52 0.0.0.0 UG 0 0 0 eth2
0.0.0.0 63.230.15.182 0.0.0.0 UG 0 0 0 eth1

Currently all of the traffic is going out eth2. It is the first in the
table, so that follows what I've read others running into who don't have
ecmp compiled in. What am I missing here? Does it look like the kernel
isn't really compiled with this option (ECMP)?

Eth1 is the default on boot. I added the eth2 default when eth1's isp
link was unreachable for a day. I executed route add default gw
207.224.221.52;ifdown eth1.

When eth1's isp was link was working I executed ifup eth1;ifdown
eth2;ifup eth2;route add default gw 207.224.221.52. I re-added the eth2
default in hopes that the outgoing traffic would be shared over the two
isp links, instead it all went out eth1. The next day it was all going
out eth2, and I hadn't up/downed the interfaces. Perhaps some cron
script did, or even more unlikely another user, I'll ask tomorrow, but
as far as I know neither would have known to put the eth2 default entry
in.

Thank you in advance for any suggestions,
Jacob Anawalt

http://www.uwsg.iu.edu/hypermail/linux/net/0012.1/0019.html

On Sat, Dec 09, 2000 at 01:55:08PM +0100, Andrea Glorioso wrote:
> This is how I understood it (and I would greatly appreciate any
> correction on this):
>
> . if you specify two routes with an equal metric value (using the
> "metric" or "preference" keyword), load balancing is done on a per
> connection basis;

No, it is done on a per route base (which is normally, but not always,
selected based on the IP of the destination). There is currently no
support to bind routes to individual streams. You can change it using
policy routing or fwmark routing though, but that is static.
 
>
> . if you specify the "equalize" keyword on two routes (which of course
> must have the usual triplet matching) then load balancing is done on a
> packet basis;

In this case the route is just recomputed for every packet. Without it
the route stays cached and bound to a specific nexthop (unless the
nexthop
dies)

>
> . I tried to analyze the code (net/ipv4/fib_semantics.c) but I
> couldn't understand where the "weight" parameter came from, given also
> that the "weight" keyword in the ip user level command refers to
> multicast routes.

Weight it set by the nexthop parameter for ip route.

-Andi

Andi Kleen wrote:
>
> On Thu, Feb 01, 2001 at 06:52:21PM -0700, Jake Anawalt wrote:
> > So, in a nut shell, since a) the isp's are not going to be peering with
> > me and b) the gateway devices themselves aren't supported to give me
> > even their status, I need to implement some route checking scripts to
> > add or remove the bad default gateway if it happens to go down? Is my
> > line of thinking correct, or am I missing some information about how
> > osfp/rip enabled programs work, or is there another tool available to do
> > this?
>
> You don't need to change the routes, but up/down the interfaces as needed.
> Interface up/down is currently the only routing failover event supported.
> You could probably do that with a single user space daemon that regularly
> checks links with a second route by ARP or pinging.
>
> -Andi
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org



This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:31 EST