LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 07-15-2005, 08:25 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,956
Blog Entries: 1

Rep: Reputation: 81
problems with multipath routing


I have this GNU/Linux box. It has three network connections. One is used for the LAN and the other two are used to connect to the internet.

Instead of having two separate default gateways....
Code:
# ip route show default
192.168.1.0/24 via 192.168.0.254 dev eth0
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.151
201.249.120.0/21 dev eth3  proto kernel  scope link  src 201.249.124.56
201.249.112.0/21 dev eth2  proto kernel  scope link  src 201.249.112.33
10.79.0.0/16 via 192.168.0.2 dev eth0
default via 201.249.112.1 dev eth2
default via 201.249.120.1 dev eth3
I deleted both of them and joined them in a single route:
Code:
# ip route del default
# ip route del default
# ip route add scope global default nexthop via 201.249.112.1 dev eth2 weight 2 nexthop via 201.249.120.1 dev eth3 weight 1
# ip route flush cache
# ip route show default
192.168.1.0/24 via 192.168.0.254 dev eth0
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.151
201.249.120.0/21 dev eth3  proto kernel  scope link  src 201.249.124.56
201.249.112.0/21 dev eth2  proto kernel  scope link  src 201.249.112.33
10.79.0.0/16 via 192.168.0.2 dev eth0
default
        nexthop via 201.249.112.1  dev eth2 weight 2
        nexthop via 201.249.120.1  dev eth3 weight 1
(they have different weights because the one on eth2 is 1536 Kbps and the other is 768)

Now.... having done that, according to my knowledge, all traffic should start going both ways, right?

Well... after I set that route, only some traffic seems to work (going through eth2), but other traffic just stalls (probably trying to go through eth3).

Is there something I have missed here?
 
Old 07-16-2005, 01:00 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,956
Blog Entries: 1

Original Poster
Rep: Reputation: 81
OK, OK.... I made a mistake.

After having spent some time trying to get that to work, I finally gave up and decided to do it just the way the lart guide says. Using a different routing table for each interface. But can anybody explain to me why it DOES work that way? Because I find those tables redundant. I must have something wrong with my theoretical or practical understanding of it.

After I rtan this script, the whole thing started to work:
Code:
tabla2=T2
tabla3=T3
net0=192.168.0.0
net2=201.249.112.0
net3=201.249.120.0
if0=eth0
if2=eth2
if3=eth3
ip2=201.249.112.33
ip3=201.249.124.56
gw2=201.249.112.1
gw3=201.249.120.1

echo 1; ip route add $net2 dev $if2 src $ip2 table $tabla2 # route to one of the providers
echo 2; ip route add $net0 dev $if0 table $tabla2 # ??? just in case
echo 3; ip route add $net3 dev $if3 table $tabla3 # ??? just in case
echo 4; ip route add 127.0.0.0/8 dev lo table $tabla2 # just inn case
echo 5; ip route add default via $gw2 table $tabla2 # default gw

echo 6; ip route add $net3 dev $if3 src $ip3 table $tabla3 # route the the second provider
echo 7; ip route add $net0 dev $if0 table $tabla3 # just in case
echo 8; ip route add $net2 dev $if2 table $tabla2 # just in case
echo 9; ip route add 127.0.0.0/8 dev lo table $tabla3 # just in case
echo 10; ip route add default via $gw3 table $tabla3 # setting the default gw

echo 11; ip rule add from $ip2 table $tabla2
echo 12; ip rule add from $ip3 table $tabla3
But so... can anybody explain to me (even with some examples) what's going on with the outgoing/incoming traffic?
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
multipath routing questions (as usual) eantoranz Linux - Networking 1 07-20-2005 11:58 AM
why does squid fail with a multipath DG? eantoranz Linux - Networking 0 07-13-2005 02:06 PM
what distribution comes with multipath support? eantoranz Linux - Distributions 0 06-03-2005 10:37 AM
Emulex FC - Brocade switches - Hitachi SAN - multipath Rimmon Linux - Enterprise 1 06-30-2004 11:44 AM
multipath routing problem jszmajda Linux - Networking 4 05-05-2004 08:15 AM


All times are GMT -5. The time now is 01:36 AM.

Main Menu
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