rrsilva |
12-06-2009 03:29 PM |
Lartc.org Routing for multiple uplinks/providers work some times...
I am following the script: http://lartc.org/howto/lartc.rpdb.multiple-links.html
My script:
Code:
ip=/sbin/ip
ipt=/usr/sbin/iptables
lan0=eth0
lan0_ip=192.168.3.1
lan0_nw=192.168.3.0
isp1=eth1
isp1_ip=192.168.1.64
isp1_gw=192.168.1.254
isp1_nw=192.168.1.0
isp1_t=10
isp2=eth2
isp2_ip=192.168.2.36
isp2_gw=192.168.2.1
isp2_nw=192.168.2.0
isp2_t=20
$ip route add $isp1_nw dev $isp1 src $isp1_ip table $isp1_t
$ip route add default via $isp1_gw table $isp1_t
$ip route add $isp2_nw dev $isp2 src $isp2_ip table $isp2_t
$ip route add default via $isp2_gw table $isp2_t
$ip route add $isp1_nw dev $isp1 src $isp1_ip
$ip route add $isp2_nw dev $isp2 src $isp2_ip
$ip rule add from $isp1_ip table $isp1_t
$ip rule add from $isp2_ip table $isp2_t
$ip route add $lan0_nw dev $lan0 table $isp1_t
$ip route add $isp2_nw dev $isp2 table $isp1_t
$ip route add 127.0.0.0/8 dev lo table $isp1_t
$ip route add $lan0_nw dev $lan0 table $isp2_t
$ip route add $isp1_nw dev $isp1 table $isp2_t
$ip route add 127.0.0.0/8 dev lo table $isp2_t
$ip route add scope global \
nexthop via $isp1_gw dev $isp1 weight 1 \
nexthop via $isp2_gw dev $isp2 weight 1
$ip route flush cache
$ipt -A INPUT -i lo -j ACCEPT
$ipt -A OUTPUT -o lo -j ACCEPT
$ipt -t nat -A POSTROUTING -o $isp1 -j MASQUERADE
$ipt -t nat -A POSTROUTING -o $isp2 -j MASQUERADE
ip route show
Code:
192.168.1.0 dev eth1 scope link src 192.168.1.64
192.168.2.0 dev eth2 scope link src 192.168.2.36
192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.36
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.64
127.0.0.0/8 dev lo scope link
default
nexthop via 192.168.1.254 dev eth1 weight 1
nexthop via 192.168.2.1 dev eth2 weight 1
ip route show table 10 (ISP1)
Code:
192.168.3.0 dev eth0 scope link
192.168.1.0 dev eth1 scope link src 192.168.1.64
192.168.2.0 dev eth2 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.1.254 dev eth1
ip route show table 20 (ISP2)
Code:
192.168.1.0 dev eth1 scope link
192.168.3.0 dev eth0 scope link
192.168.2.0 dev eth2 scope link src 192.168.2.36
127.0.0.0/8 dev lo scope link
default via 192.168.2.1 dev eth2
On the client machine browser, some pages open, some not.
What I am missing?
|