LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 12-06-2009, 04:29 PM   #1
rrsilva
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
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?

Last edited by rrsilva; 12-06-2009 at 04:39 PM. Reason: Last show table for 20 not 10
 
Old 12-06-2009, 06:19 PM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Quote:
Originally Posted by rrsilva View Post

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.

Last edited by nimnull22; 12-06-2009 at 06:20 PM.
 
Old 12-06-2009, 09:35 PM   #3
rrsilva
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Original Poster
Rep: Reputation: 0
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] problem with Routing for multiple uplinks/providers on RH9 2.4.36.2 ciuly Linux - Networking 3 07-24-2009 06:00 PM
Routing for Multiple uplinks / providers sarthor Linux - Networking 6 02-23-2009 10:00 AM
Possible to setup multiple uplinks with 3G usb modem? Niceman2005 Linux - Networking 0 06-05-2008 09:13 PM
Iptables and multiple uplinks reggie Linux - Networking 3 12-09-2007 03:51 PM
multiple uplinks posixjunkie Linux - Networking 1 04-25-2006 02:16 PM


All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration