From: favero@grad.ufsc.br Date: Fri, 20 Aug 2004 04:29:08 +0000 Subject: [LARTC] Load Balance adsl connections: a complete explanation of my case... Message-Id: <1092976148.41257e1496c32@webmail.grad.ufsc.br> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org I have a linux server running Mandrake 10, with the kernel=20 configured with "CONFIG_IP_ADVANCED_ROUTER=3Dy=20 CONFIG_IP_MULTIPLE_TABLES=3Dy=20 CONFIG_IP_ROUTE_MULTIPATH=3Dy" options, with 4 ethernet=20 cards: - 2 ethernet used to connect to my lan (eth0=192.168.1.x and=20 eth1=192.168.2.x) - 2 ethernet used to internet connection (2 adsl lines, both=20 with 600/300 kbtis) The two lan are used to share the internet connetion with my=20 friends. We run p2p services on the linux server, so all the=20 heavy traffic is generated directly by the linux server.=20 The main objective here is to load balance the traffic=20 generated by the p2p services running on the server and the=20 lan through the 2 adsl lines, and make the 2 adsl 600/300=20 kb/sec looks like a 1200/600 kb/sec connection... Here is a diagram of the network (i don=B4t know if it helps..=20 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,=20 then i put identical cbq rules on each ppp connection. My ideia=20 is that the packets go to the cbq qdiscs only after they was=20 routed to that ppp connection... is that right? If it is, this=20 might work... The load balance is a problem.. i tried to load balance using=20 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=20 dev ppp0 nexthop via 201.3.196.254 dev ppp1 But... when i use the above commands the lan can=B4t=20 communicate with the internet, just the linux server can see=20 the internet... so i need to put one of the ppp connection as=20 a "default gateway" to make the lan see the internet, using=20 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 =20 0 0 ppp0 201.3.196.254 * 255.255.255.255 UH 0 =20 0 0 ppp1 192.168.4.0 * 255.255.255.0 U 0 0 =20 0 eth3 192.168.2.0 * 255.255.255.0 U 0 0 =20 0 eth1 192.168.1.0 * 255.255.255.0 U 0 0 =20 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 =20 0 ppp1 default 200.138.225.254 0.0.0.0 UG 0 0 =20 0 ppp0 But, in this case, the traffic coming from the lan don=B4t get=20 load balanced... just go through the ppp0 (200.138.225.254),=20 and looks very strange to me to have two "default gateway".=20 Even if i keep the first configuration option, without using=20 the "route add default gw 200.138.224.254" command, and=20 keeping the lan disconnected (for test purposes) i can see=20 that the traffic generated by the linux server use the 2 adsl=20 lines, but it don=B4t make a "load balance"...if i make=20 a "traceroute" it ALWAYS go through the first "NEXTHOP" ip=20 configured on the "ip route add default equalize nexthop"=20 command... Even if i give a "ip route list cache" and catch a ip that on the=20 cache route list go through the second nexthop ip, the=20 traceroute go through the first nexthop ip... So i don=B4t=20 understand: why the traceroute don=B4t use the cached route? I=20 can only imagine that something is wrong in my=20 configuration... And worst: keeping the server running with two default=20 gateways for a long time i can see that NEVER the traffic get=20 more than 80 Kbytes/sec (640 Kbytes)...In a healthy system=20 with correct configuration, running p2p services, with hundreds=20 of simultaneous connections, the speeds should go near the=20 1000 kbits (125 Kbytes/seg) even if i consider the adsl=20 overhead... Someone have some idea of where is the problem? Why i get=20 a poor load balance that never gets more than 60% of the=20 bandwidth of each adsl? The internet have just a few load balance information... i read=20 almost all the pages google could find and i still can=B4t figure=20 out what=B4s the problem.. I=B4ll appreciate all help u can give=20 me!=20 Tks in advance! Fernando Favero _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/