Skip to contentSkip to conversation

Load balance and big downloads

LARTC Fábio Brito 2 participants 2 messages Aug 30, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

This is the first time I write to the list.

My english is not so good, but I hope I'll be understood.

I have 4 adsl routers, plugged on a linux box, and this box e used to connect to a local network.

The linux box has 5 NICs.

eth0: local network

    inet 10.0.0.56/24 brd 10.0.0.255 scope global eth0
eth1: adsl router 1
    inet 192.168.254.1/24 brd 192.168.254.255 scope global eth1
eth2: adsl router 2
    inet 192.168.253.1/24 brd 192.168.253.255 scope global eth2
eth3: adsl router 3
    inet 192.168.252.1/24 brd 192.168.252.255 scope global eth3
eth4: adsl router 4
    inet 192.168.251.1/24 brd 192.168.252.255 scope global eth4

The route table is:

netuno:~# ip rule show
0:      from all lookup local
32762:  from 192.168.251.0/24 lookup 5
32763:  from 192.168.252.0/24 lookup 4
32764:  from 192.168.253.0/24 lookup 3
32765:  from 192.168.254.0/24 lookup 2
32766:  from all lookup main
32767:  from all lookup default
netuno:~# ip route show table 2
default via 192.168.254.254 dev eth1
netuno:~# ip route show table 3
default via 192.168.253.254 dev eth2
netuno:~# ip route show table 4
default via 192.168.252.254 dev eth3
netuno:~# ip route show table 5
default via 192.168.251.254 dev eth4
netuno:~# ip route show
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.56
192.168.251.0/24 dev eth4  proto kernel  scope link  src 192.168.251.1
192.168.252.0/24 dev eth3  proto kernel  scope link  src 192.168.252.1
192.168.253.0/24 dev eth2  proto kernel  scope link  src 192.168.253.1
192.168.254.0/24 dev eth1  proto kernel  scope link  src 192.168.254.1
default equalize
        nexthop via 192.168.254.254  dev eth1 weight 1
        nexthop via 192.168.253.254  dev eth2 weight 1
        nexthop via 192.168.252.254  dev eth3 weight 1
        nexthop via 192.168.251.254  dev eth4 weight 1

My NAT table is

Chain POSTROUTING (policy ACCEPT)

target     prot opt source               destination
SNAT       all  --  10.0.0.0/24          0.0.0.0/0           to:192.168.254.1
SNAT       all  --  10.0.0.0/24          0.0.0.0/0           to:192.168.253.1
SNAT       all  --  10.0.0.0/24          0.0.0.0/0           to:192.168.252.1
SNAT       all  --  10.0.0.0/24          0.0.0.0/0           to:192.168.251.1

The load balance is working with the 4 adsl links. But I'm having some issues when machines inside the local network try download big files.

The download starts, but in an arbitrary amount of time it stops. I think it is a problem with the return path of the TCP connection, but i don't know how to solve this.

Hope somebody help me.

Thanks.

Signature · 6 lines
Fábio Brito d'Araújo e Oliveira
Registered Linux User
www.psychopenguin.com.br
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw

My Thanks to you Fábio Brit and everyone that has helped me out. In the end it turn out that removing the following line from my script fixed the issue.

Why I'm not really sure why this worked, however the changes are as follows for anyone that hits the same issue:

ip route add 23.215.3.16/28 dev eth0 src 23.215.3.20 table T1 --->#ip route add default via 23.215.3.17 table T1 ip route add 23.215.4.0/26 dev eth2 src 23.215.4.61 table T2 ip route add default via 24.215.4.1 table T2
ip route add 23.215.16.0/21 dev eth1 src 23.215.17.54 table T3 ip route add default via 24.215.16.1 table T3
ip route add 23.215.4.0/26 dev eth3 src 23.215.4.60 table T4 ip route add default via 24.215.4.1 table T4

Which effectively removed the default gateway setting and made the connection rely on the balancing part of the script:

ip route add default scope global nexthop via 23.215.3.17 dev eth0 weight 1 nexthop via 23.215.4.1 dev eth2 weight 1 nexthop via 23.215.16.1 dev eth1 weight 1 nexthop via 23.215.4.1 dev eth3 weight 1

Note: I did adjust the weight values to 1s all around.

Initial Speed Tests (Not Maxed) (Connecting to one IP address)

eth0 – 1177.6 kbit/sec Upstream

eth1 – 455.0 kbit/sec Upstream

eth2 – 656.5 kbit/sec Upstream

eth3 – 1004.3 kbit/sec Upstream

I'm going to be monitoring it for the next few days and see how it does. I'll keep everyone updated.

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/