D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] IP Masquerading with load-balancing over two connections

 


On 29 May 2013 17:01, "Rob Beard" <rob@xxxxxxxxxxxxx> wrote:
>
> Hi folks,
>
> I'm trying to setup load balancing over two ADSL connections on a Linux box with IP Masquerading and I seem to be hitting a dead-end and I wondered if anyone could help?
>
> I've got a desktop PC with 3 network cards running Debian 7.
>
> eth0 is attached to the local lan and has an IP address of 192.168.0.1
> eth1 is attached to the first ADSL router and has an IP address of 192.168.10.1 and the gateway of the ADSL modem is 192.168.10.254
> eth2 is attached to the second ADSL router and has an IP address of 192.168.20.1 and the gateway of the ADSL modem is 192.168.20.254
>
> I'm able to set the default route to either the connection on eth1 or eth2 and I can traceroute out to sites.  However this is where I get a bit stuck...
>
> I'm following this guide: http://www.diegolima.org/wordpress/?p=36
>
> I ran the command " iptables -t mangle -A PREROUTING -j MARK –set-mark 1" and it still seemed to put everything over eth2 when I was expecting it to go over eth1.
>
> When I get to this command... "iptables -t mangle -A PREROUTING -m state –state new -m statistic –mode random –probability 0,5 -j MARK –set-mark 1" it gives me an error message...
>
> "iptables v1.4.14: statistic: bad value for option "--probability", or out of range (0-1)."
>
> So I'm a bit stumped.  I've tried various different guides covering how to do it and I still can't seem to get anywhere.  I'd like to have this box run other things too (hence why I'm not installing pfsense) and well, I wondered if anyone could help or had any links to any guides on how I can set this up?
>
> What I'd like to achieve is have the majority (say 75%) of the traffic go over eth1 as that has the faster connection, and some traffic over eth2 with the option for failing over to one or the other connections if the ADSL goes down.  I just can't seem to get my head around it (although I dare say iptables is probably interesting bed time reading :-s).

What are you serving?
>
> Rob
>
> --
> The Mailing List for the Devon & Cornwall LUG
> http://mailman.dclug.org.uk/listinfo/list
> FAQ: http://www.dcglug.org.uk/listfaq
>

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq