Load Balance adsl connections: a complete explanation of my case...

Linux Advanced Routing and Traffic Control

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

 



I have a linux server running Mandrake 10, with the kernel 
configured with "CONFIG_IP_ADVANCED_ROUTER=y 
CONFIG_IP_MULTIPLE_TABLES=y 
CONFIG_IP_ROUTE_MULTIPATH=y" options, with 4 ethernet 
cards:
- 2 ethernet used to connect to my lan (eth0=192.168.1.x and 
eth1=192.168.2.x)
- 2 ethernet used to internet connection (2 adsl lines, both 
with 600/300 kbtis)
The two lan are used to share the internet connetion with my 
friends. We run p2p services on the linux server, so all the 
heavy traffic is generated directly by the linux server. 
The main objective here is to load balance the traffic 
generated by the p2p services running on the server and the 
lan through the 2 adsl lines, and make the 2 adsl 600/300 
kb/sec looks like a 1200/600 kb/sec connection...


Here is a diagram of the network (i don´t know if it helps.. 
but.. here it is):
       ___________________
eth0   |                  |ppp0
_______|   Linux Server   |__________
       | (Firewall + P2p  |
_______| +Traffic control |__________
eth1   | +Load Balance)   |ppp1
       |__________________|

To make the traffic control i mark all packets using iptables, 
then i put identical cbq rules on each ppp connection. My ideia 
is that the packets go to the cbq qdiscs only after they was 
routed to that ppp connection... is that right? If it is, this 
might work...
The load balance is a problem.. i tried to load balance using 
the commands below:

ip rule add from 200.193.25.93 lookup 1
ip route add 192.168.1.0/24 via 192.168.1.1 table 1
ip route add 192.168.2.0/24 via 192.168.2.1 table 1
ip route add 0/0 via 200.138.225.254 table 1

ip rule add from 201.3.232.150 lookup 2
ip route add 192.168.1.0/24 via 192.168.1.1 table 2
ip route add 192.168.2.0/24 via 192.168.2.1 table 2
ip route add 0/0 via 201.3.196.254 table 2

ip route add default equalize nexthop via 200.138.225.254 
dev ppp0 nexthop via 201.3.196.254 dev ppp1

But... when i use the above commands the lan can´t 
communicate with the internet, just the linux server can see 
the internet... so i need to put one of the ppp connection as 
a "default gateway" to make the lan see the internet, using 
the command:

route add default gw 200.138.225.254

then, i get this route table:

200.138.225.254 *               255.255.255.255 UH    0      
0        0 ppp0
201.3.196.254   *               255.255.255.255 UH    0      
0        0 ppp1
192.168.4.0     *               255.255.255.0   U     0      0        
0 eth3
192.168.2.0     *               255.255.255.0   U     0      0        
0 eth1
192.168.1.0     *               255.255.255.0   U     0      0        
0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         201.3.196.254   0.0.0.0         UG    0      0        
0 ppp1
default         200.138.225.254 0.0.0.0         UG    0      0        
0 ppp0

But, in this case, the traffic coming from the lan don´t get 
load balanced... just go through the ppp0 (200.138.225.254), 
and looks very strange to me to have two "default gateway". 
Even if i keep the first configuration option, without using 
the "route add default gw 200.138.224.254" command, and 
keeping the lan disconnected (for test purposes) i can see 
that the traffic generated by the linux server use the 2 adsl 
lines, but it don´t make a "load balance"...if i make 
a "traceroute" it ALWAYS go through the first "NEXTHOP" ip 
configured on the "ip route add default equalize nexthop" 
command...
Even if i give a "ip route list cache" and catch a ip that on the 
cache route list go through the second nexthop ip, the 
traceroute go through the first nexthop ip... So i don´t 
understand: why the traceroute don´t use the cached route? I 
can only imagine that something is wrong in my 
configuration...
And worst: keeping the server running with two default 
gateways for a long time i can see that NEVER the traffic get 
more than 80 Kbytes/sec (640 Kbytes)...In a healthy system 
with correct configuration, running p2p services, with hundreds 
of simultaneous connections, the speeds should go near the 
1000 kbits (125 Kbytes/seg) even if i consider the adsl 
overhead...
Someone have some idea of where is the problem? Why i get 
a poor load balance that never gets more than 60% of the 
bandwidth of each adsl?
The internet have just a few load balance information... i read 
almost all the pages google could find and i still can´t figure 
out what´s the problem.. I´ll appreciate all help u can give 
me! 
Tks in advance!
Fernando Favero

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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