LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Lartc.org Routing for multiple uplinks/providers work some times... (https://www.linuxquestions.org/questions/linux-networking-3/lartc-org-routing-for-multiple-uplinks-providers-work-some-times-773839/)

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?

nimnull22 12-06-2009 05:19 PM

Quote:

Originally Posted by rrsilva (Post 3782013)

On the client machine browser, some pages open, some not.

What I am missing?

Do not check connectivity by browsers, try to ping, use telnet.

rrsilva 12-06-2009 08:35 PM

I solved my problem, my "ISP2" was disconnected.

I connected it again, and everything worked normally.

However, when the "ISP2" disconnects. The routing should not continue normally?


All times are GMT -5. The time now is 05:27 PM.