From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nataniel Klug" Date: Wed, 19 Oct 2005 12:41:30 +0000 Subject: [LARTC] Load balance (two links in one server): why is this not Message-Id: <000a01c5d4aa$6ec68540$57001eac@NATANIEL> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0842577385==" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. --===============0842577385== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C5D499.AA3063F0" This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C5D499.AA3063F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=3D"/usr/local/sbin/iptables" IP=3D"/sbin/ip" # #---- # ENTRADA DE LINKS #---- IF1=3D'eth0' IF2=3D'eth3' # #---- # Declara as redes #---- P1_NET=3D'200.163.208.0/25' P2_NET=3D'10.1.1.0/24' # #---- # Declara IPs #---- IP1=3D'200.163.208.6' IP2=3D'10.1.1.10' # #---- # Declara gateway das conexoes #---- P1=3D'200.163.208.1' P2=3D'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 ------=_NextPart_000_0007_01C5D499.AA3063F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
    Hello,
 
    I am trying to make a load = balance at my=20 box using two conections. I have compile my kernel with this patch=20 routes-2.6.13-12.diff (tha I get from this website: http://www.lin= uxvirtualserver.org/~julian/#routes).
 
    The problem is that when I try to = balance=20 using weight sintaxe (i will put the script bellow) some conectios just = drop. So=20 I can enter some pages but other I could not... What can I = do?
 
    I am using this script (and = reading this=20 howto, again, to see if I missed something: http://www.ssi.bg/~ja/nano.txt):
 
--- SCRIPT ---
#!/bin/sh
#-------------------------
# = Configuracao de=20 redirecionamento de portas para os links
# Balanceamento de carga = entre=20 pontos de rede
#-------------------------
#----
# Variaveis de=20 sistema
#----
IPTABLES=3D"/usr/local/sbin/iptables"
IP=3D"/sbin/= ip"
#
#----
#=20 ENTRADA DE = LINKS
#----
IF1=3D'eth0'
IF2=3D'eth3'
#
#----
# = Declara=20 as=20 redes
#----
P1_NET=3D'200.163.208.0/25'
P2_NET=3D'10.1.1.0/24'#
#----
#=20 Declara=20 IPs
#----
IP1=3D'200.163.208.6'
IP2=3D'10.1.1.10'
#
#----<= BR>#=20 Declara gateway das=20 conexoes
#----
P1=3D'200.163.208.1'
P2=3D'10.1.1.1'
#
#---= -
#=20 Mascara as redes e marca os pacotes
#----
$IPTABLES -t nat -A = POSTROUTING=20 -o $IF1 -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -o $IF2 -j=20 MASQUERADE
#
#----
# Declaracao de rotas padrao para os=20 links
#----
$IP route add $P1_NET dev $IF1 src $IP1 table = T1
$IP route=20 add default via $P1 table T1
$IP route add $P2_NET dev $IF2 src $IP2 = table=20 T2
$IP route add default via $P1 table T2
#
$IP route add = $P1_NET dev=20 $IF1 src $IP1
$IP route add $P2_NET dev $IF2 src $IP2
#
$IP = route add=20 default scope global nexthop via $P1 dev $IF1 weight 4 nexthop via $P2 = dev $IF2=20 weight 1
#
$IP rule add from $IP1 table T1
$IP rule add from = $IP2 table=20 T2
#
#----
# Atualiza tabela de cache
#----
$IP route = flush=20 cache
--- SCRIPT ---
 
Att,
 
Nataniel Klug
------=_NextPart_000_0007_01C5D499.AA3063F0-- --===============0842577385== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============0842577385==--