RE: Problem with Load Balancing

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We have also set up a somewhat similar method of load balancing.  Our
traffic is never a 50-50 split (well 3:2 is how we have it set, but it
doesn't always get close to that), but as the load picks up, it tends to be
closer to the actual amount.

Well, then there is not much to do about this.

Dead gateway detection has never worked for us, and one day I'll probably
bother other members of the LARTC group to get some help, but the method
that we use is to check the output of the ip neighbor command.  Basically,
if our two ISPs are 10.1.1.254 and 10.2.2.254, we run a bash script via cron
every minute that does a call something like:

ETH1 = ip neigh 10.1.1.254 | egrep "REACHABLE|DELAY|PROBE|STALE" -c
ETH2 = ip neigh 10.2.2.254 | egrep "REACHABLE|DELAY|PROBE|STALE" -c

The neighbor system basically monitors ARP and if it sees a message leave an
interface without a reply after something like 3-5 seconds, it moves the
interface to DELAY, after another few seconds it moves to PROBE and does an
active arp request, and if that fails to work in a few seconds, it becomes
INCOMPLETE or FAILED or just simply isn't listed. If no data is sent either
way for a while, the entry can be marked STALE or removed.

With the above lines, we get a 1 in the ETH1 or ETH2 variables if the next
neighbor is up, and a 0 if not.  From there you can use some if scripts to
detect if both are up, or if only one is up, which one.  In our case, if
both are up we clear the default route and then make it something like

ip route add default nexthop via 10.1.1.254 dev eth1 weight 1 \
nexthop via 10.2.2.254 dev eth2 weight 1

and if only one is up we clear it and make it :

ip route add default nexthop via 10.1.1.254 dev eth1
or
ip route add default nexthop via 10.2.2.254 dev eth2


Ok, William, this looks like what I'm looking for. I'm going to test it and tell you how it works for us. By the way, about the download of a single file between the two conections, do you know if there is a way to do it?

Thanks for your help and time and sorry for the delay!

_________________________________________________________________
Prodigy/MSN Spaces: Tu espacio en la red http://spaces.msn.com/

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux