[Mageia-discuss] network balancing by default

P. Christeas p_christ at hol.gr
Tue Oct 26 01:54:00 CEST 2010


On Monday 25 October 2010, you wrote:
> Op maandag 25 oktober 2010 00:56:32 schreef P. Christeas:
> > On Sunday 24 October 2010, Maarten Vanraes wrote:
> > > I would propose the following:
> > > 
> > > A.) by default, add for every interface, a little advanced routing
> > > which makes packets return from the same way they came.
> > > This usually is only useful with incoming packets, but can still be
> > > useful if laptops have for example 2 gateways because the wifi is still
> > > on and the cable is too. That would mean that from both interfaces it'd
> > > be possible to use ssh or vnc or whatever.
> > > 
> > > B.) if we have multiple gateways (like in that case), have them use
> > > both balancedly. ie: start a small daemon which checks which of the
> > > gateways is up or down; and change the default gateway accordingly, or
> > > even both in some kind of balanced mode. (with advanced routing.)
> > > 
> > > This would have the benefit, if you have really clueless users with a
> > > laptop; that everything will still work well. and you're still able to
> > > take over his laptop.
> > 
> > Will that do ? :
> > http://git.hellug.gr/?p=xrg/ip-multipath;a=summary
> > 
> > (note to myself: I have to build a man^Hgeia rpm..)
> 
> This looks like something different than what i intended; isn't this more
> of a configured thing?
> 
> I would propose some changes to the networkingscripts. when having gateway
> addresses (through various means) to change the stuff.

Please excuse me for the lack of documentation.
This script is an addon over the if-up scripts, which adds the support for 
multiple gateways to and from the internet. 
You only need to place this script in /etc/sysconfig/network-scripts/ifup.d/ 
and then some extra variables will help you configure the interfaces:
MULTIPATH_TABLE=10  # needed, just a unique one per interface
MULTI_GATEWAY_IN=1.2.3.4 # if this is a gateway route, but don't want to use
			# the interface by default
MULTI_GATEWAY=1.2.3.4  # default route, along with other interfaces.

The functionality is provided by kernel itself. By using multiple kernel 
routing tables, the first thing you achieve is to have your server listen on 
all its internet-routing interfaces, so that you can connect *to* your server 
from any of them. This is _extremely_ useful, because it allows you to ssh to 
the server from /any/ interface that works, and then fix all the others. Saves 
the day.
The second one, a little more tricky, is to have multiple routes to the 
internet. With TCP connections, this works /almost/ fine, because it may assign 
each connection to a different gateway, thus load-balancing. With UDP ones, 
well, this is not really working (AFAIK). However, if you also give different 
weights, it may activate the kernel's /slow/ transition mechanism (5-10 min 
responses), which will automatically pick the first working interface as its 
default gw (even if all interfaces are up and some of them respond with ICMP 
unreachable, it will work).



-- 
Say NO to spam and viruses. Stop using Microsoft Windows!


More information about the Mageia-discuss mailing list