Nataniel Klug
2005-Oct-19 12:41 UTC
Load balance (two links in one server): why is this not working?
Hello, I am trying to make a load balance at my box using two conections. I have compile my kernel with this patch routes-2.6.13-12.diff (tha I get from this website: http://www.linuxvirtualserver.org/~julian/#routes). The problem is that when I try to balance using weight sintaxe (i will put the script bellow) some conectios just drop. So I can enter some pages but other I could not... What can I do? I am using this script (and reading this howto, again, to see if I missed something: http://www.ssi.bg/~ja/nano.txt): --- SCRIPT --- #!/bin/sh #------------------------- # Configuracao de redirecionamento de portas para os links # Balanceamento de carga entre pontos de rede #------------------------- #---- # Variaveis de sistema #---- IPTABLES="/usr/local/sbin/iptables" IP="/sbin/ip" # #---- # ENTRADA DE LINKS #---- IF1=''eth0'' IF2=''eth3'' # #---- # Declara as redes #---- P1_NET=''200.163.208.0/25'' P2_NET=''10.1.1.0/24'' # #---- # Declara IPs #---- IP1=''200.163.208.6'' IP2=''10.1.1.10'' # #---- # Declara gateway das conexoes #---- P1=''200.163.208.1'' P2=''10.1.1.1'' # #---- # Mascara as redes e marca os pacotes #---- $IPTABLES -t nat -A POSTROUTING -o $IF1 -j MASQUERADE $IPTABLES -t nat -A POSTROUTING -o $IF2 -j MASQUERADE # #---- # Declaracao de rotas padrao para os links #---- $IP route add $P1_NET dev $IF1 src $IP1 table T1 $IP route add default via $P1 table T1 $IP route add $P2_NET dev $IF2 src $IP2 table T2 $IP route add default via $P1 table T2 # $IP route add $P1_NET dev $IF1 src $IP1 $IP route add $P2_NET dev $IF2 src $IP2 # $IP route add default scope global nexthop via $P1 dev $IF1 weight 4 nexthop via $P2 dev $IF2 weight 1 # $IP rule add from $IP1 table T1 $IP rule add from $IP2 table T2 # #---- # Atualiza tabela de cache #---- $IP route flush cache --- SCRIPT --- Att, Nataniel Klug _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Marek Kierdelewicz
2005-Oct-19 13:51 UTC
Re: Load balance (two links in one server): why is this not working?
> Hello,Hi there.> > I am trying to make a load balance at my box using two > conections. I have compile my kernel with this patch > routes-2.6.13-12.diff (tha I get from this website: > http://www.linuxvirtualserver.org/~julian/#routes). > ....I''ve tried to implement similar setup some time ago. The problem was that there was no way to assure that active connection won''t be routed throu different gateways (route cache entries timeout...). I''ve failed to overcome this problem with a help of route patches. I was able to balance traffic over few connections with connmark+nth iptables patches. Think of it as an alternative if route patches won''t work as advertised. Marek Kierdelewicz KoBa ISP
Nataniel Klug
2005-Oct-19 14:57 UTC
Re: Load balance (two links in one server): why is this notworking?
Marek, I made a test to route some kind of trafic throu one link and other kind throu other using L7-Filter compiled into kernel and iptables. It worked properly. So now I will put P2P and messenger trafic throu one link and all other trafic thou other link. Thanks. Att, Nataniel Klug ----- Original Message ----- From: Marek Kierdelewicz To: lartc@mailman.ds9a.nl Sent: Wednesday, October 19, 2005 11:51 AM Subject: Re: [LARTC] Load balance (two links in one server): why is this notworking? > Hello, Hi there. > > I am trying to make a load balance at my box using two > conections. I have compile my kernel with this patch > routes-2.6.13-12.diff (tha I get from this website: > http://www.linuxvirtualserver.org/~julian/#routes). > .... I''ve tried to implement similar setup some time ago. The problem was that there was no way to assure that active connection won''t be routed throu different gateways (route cache entries timeout...). I''ve failed to overcome this problem with a help of route patches. I was able to balance traffic over few connections with connmark+nth iptables patches. Think of it as an alternative if route patches won''t work as advertised. Marek Kierdelewicz KoBa ISP _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc