Logo Hardware.com.br
The hell
The hell Membro Junior Registrado
188 Mensagens 0 Curtidas

balanceamento 2 links adsl

#1 Por The hell 05/11/2009 - 23:47
Boa noite colegas tenho um scripts que iria fazer o balanceamento dos links de adsl

#!/bin/sh

# Variáveis
ROTABRT="192.168.0.254"
ROTANET="10.1.1.1"
IPBRT="192.168.0.198"
IPGVT="10.1.1.35"
ETHB="eth5"
ETHG="eth4"
ROTADEL="route del default gw"

echo "Deleta rotas padrão"
$ROTADEL $ROTAGVT
$ROTADEL $ROTABRT
echo "OK"

ip route flush table gvt #Limpa as rotas no cache da tabela gvt
ip route flush table brt #Limpa as rotas no cache da tabela brt

ip route add 10.0.0.0/8 dev eth5 src 10.1.1.35 table NET
ip route add default via 10.1.1.1 table NET

ip route add 192.168.0.0/24 dev eth2 src 192.168.0.198 table BRT
ip route add default via 192.168.0.254 table BRT

ip rule add from 10.1.1.1 table NET
ip rule add from 192.168.0.254 table BRT

#A regra abaixo é responsável pelo balanceamento com peso 2:1, porque a gvt é 2x mais rápida que o link da brt
ip route add default scope global nexthop via 10.1.1.1 dev eth4 weight 2 nexthop via 192.168.0.254 dev eth5 weight 1

ip route flush cache #Limpa as rotas no cache

# Fundamental estar desabilitado para funcionar o roteamento com 2 links
echo "0" > /proc/sys/net/ipv4/conf/default/rp_filter

queria que os senhores verifica-se isso iria funcionar, segundo o autor teria que instalar um patch para que o firewall interpreta-se os pacotes de links diferente.. um patch .diff que esta neste link:
http://www.ssi.bg/~ja/#routes
© 1999-2024 Hardware.com.br. Todos os direitos reservados.
Imagem do Modal