o que vc quer está aqui:
Balanceamento de carga entre links com iproute2 - mini-howto
Linux: Firewall Linux - Roteamento avançado usando iproute2 e iptables (load balance) [Artigo]
divirta-se :)
Versão Imprimível
o que vc quer está aqui:
Balanceamento de carga entre links com iproute2 - mini-howto
Linux: Firewall Linux - Roteamento avançado usando iproute2 e iptables (load balance) [Artigo]
divirta-se :)
Galera,
Ajuda ae! :five:
VLW
Balanceamento de carga entre links com iproute2 - mini-howto
Se seguir a risca o que está escreito, funciona.
Você não está configurando as redes locais nas tabelas de rotemento.
Obrigado Pedro, mas ainda não consegui.
Veja o script que montei a partir do seu tutorial:
LNTW0='192.168.254.0/24'
LNTW1='192.168.10.0/24'
LIF0='eth0'
LIF1='eth1'
LIP0='192.168.254.3'
LIP1='192.168.10.1'
LGW0='192.168.254.254'
LGW1='192.168.10.200'
echo 10 tb0 >> /etc/iproute2/rt_tables
echo 11 tb1 >> /etc/iproute2/rt_tables
ip route add $LNTW0 dev $LIF0 src $LIP0 table tb0
ip route add to 0/0 via $LGW0 table tb0
ip route add $LNTW1 dev $LIF1 src $LIP1 table tb1
ip route add to 0/0 via $LGW1 table tb1
ip route add $LIP0 dev $LIF0 table tb0
ip route add $LIP1 dev $LIF1 table tb1
ip route add $LNTW0 dev $LIF0 src $LIP0
ip route add $LNTW1 dev $LIF1 src $LIP1
ip rule add from $LIP0 table tb0
ip rule add from $LIP1 table tb1
ip route add to 0/0 nexthop via $LGW0 dev $LIF0 weight 1 nexthop via $LGW1 dev $LIF1 weight 1
ip rule add from $LNTW0 table tb0
ip rule add from $LNTW1 table tb1
iptables -t mangle -A PREROUTING -i $LIP1 -p tcp --dport 80 -j MARK --set-mark 0x60
ip rule add fwmark 0x60 table tb0
Continuo acessando tudo via Embratel
traceroute to Under-Linux.Org O Portal do Administador de Sistemas (74.86.235.216), 30 hops max, 40 byte packets
1 192.168.10.200 2.707 ms 2.946 ms 1.825 ms
(...)
Comando route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.10.0 * 255.255.255.0 U 0 0 0 eth1
192.168.254.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.10.200 0.0.0.0 UG 0 0 0 eth1
Seria algum problema nas configurações do gw default de rede?
Se tiver algo errado aí, por favor corrija.
Grato.