LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-04-2004, 01:41 PM   #1
jszmajda
LQ Newbie
 
Registered: May 2004
Location: North Adams, MA
Distribution: fedora
Posts: 4

Rep: Reputation: 0
multipath routing problem


Hi All,

I have a linux router, configured with two internet connections and two lan segments. I've setup multipath routing as described in the linux advanced routing howto (lartc.org)

My problem (I think) is that somehow the router will randomly choose incorrect routing paths for different hosts, for example: on my workstation (192.168.1.20), I ssh to a server I have on an external network (157.238.135.60), and my connection locally hangs. On the router, I search the routing cache:

# ip route show cache | grep 157.238.135.60
157.238.135.60 via 207.180.31.137 dev eth0 src 207.180.31.140
157.238.135.60 from 192.168.1.20 tos 0x10 via 10.14.1.1 dev ppp0 src
192.168.1.1
157.238.135.60 from 192.168.1.20 via 207.180.31.137 dev eth0 src
192.168.1.1
192.168.1.20 from 157.238.135.60 dev eth3 src 207.180.31.140

Compare this to cache entries for a host that does work (157.238.135.90):
# ip route show cache | grep 157.238.135.90
192.168.1.20 from 157.238.135.90 tos 0x10 dev eth3 src 207.180.31.140
157.238.135.90 via 10.14.1.1 dev ppp0 src 151.203.160.233
192.168.1.20 from 157.238.135.90 dev eth3 src 207.180.31.140
157.238.135.90 from 192.168.1.20 via 10.14.1.1 dev ppp0 src 192.168.1.1
157.238.135.90 from 192.168.1.20 tos 0x10 via 10.14.1.1 dev ppp0 src
192.168.1.1

My question is: why does this happen? what can I do to fix it?

Thanks in advance!

Here's some information from my router:

# ip route
10.14.1.1 dev ppp0 scope link src 151.203.160.233
207.180.31.136/29 dev eth0 scope link src 207.180.31.140
192.168.1.0/24 dev eth3 scope link src 192.168.1.1
10.0.0.0/16 dev eth2 scope link src 10.0.0.1
127.0.0.0/8 dev lo scope link
default
nexthop via 207.180.31.137 dev eth0 weight 2
nexthop via 10.14.1.1 dev ppp0 weight 1

# ip rule show
0: from all lookup local
32764: from 151.203.160.233 lookup T2
32765: from 207.180.31.140 lookup T1
32766: from all lookup main
32767: from all lookup 253

# ip route show table T1
207.180.31.136/29 dev eth0 scope link src 207.180.31.140
192.168.1.0/24 dev eth3 scope link src 192.168.1.1
10.0.0.0/16 dev eth2 scope link src 10.0.0.1
127.0.0.0/8 dev lo scope link
default via 207.180.31.137 dev eth0 src 207.180.31.140

# ip route show table T2
10.14.1.1 dev ppp0 scope link src 151.203.160.233
192.168.1.0/24 dev eth3 scope link src 192.168.1.1
10.0.0.0/16 dev eth2 scope link src 10.0.0.1
127.0.0.0/8 dev lo scope link
default via 10.14.1.1 dev ppp0 src 151.203.160.233

Thanks Again,

-Josh
 
Old 05-04-2004, 03:52 PM   #2
greggiepoo
LQ Newbie
 
Registered: May 2004
Location: Baton Rouge, LA
Distribution: Fedora Core 1
Posts: 19

Rep: Reputation: 0
Hi Josh,

Can you post your `ifconfig -a` listing? Or maybe just post something like which networks are going through which interfaces? That would help me to more comprehend your networking setup. I'll definitely help out if I can.

Thanks,

Greg
 
Old 05-04-2004, 04:01 PM   #3
jszmajda
LQ Newbie
 
Registered: May 2004
Location: North Adams, MA
Distribution: fedora
Posts: 4

Original Poster
Rep: Reputation: 0
Hey Greg, sure thing

eth1 is slaved to ppp0, so that's why it dosen't have an address.

I also chopped out the stuff with how much data was sent over which interface, as it was unrelated.

# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:5A:82:98:95
inet addr:207.180.31.140 Bcast:207.180.31.143 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth1 Link encap:Ethernet HWaddr 00:04:5A:82:99:05
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth2 Link encap:Ethernet HWaddr 00:04:5A:82:98:E2
inet addr:10.0.0.1 Bcast:10.0.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth3 Link encap:Ethernet HWaddr 00:04:5A:82:99:29
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1

ppp0 Link encap:Point-to-Point Protocol
inet addr:151.203.160.233 P-t-P:10.14.1.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
 
Old 05-04-2004, 05:03 PM   #4
greggiepoo
LQ Newbie
 
Registered: May 2004
Location: Baton Rouge, LA
Distribution: Fedora Core 1
Posts: 19

Rep: Reputation: 0
Is there no route between 207.180.31.140 and 157.238.135.60?

If anything, you can add a static route to 157.238.135.60 through dev ppp0. I know this is probably not the solution you're looking for, but it should be a quick fix for the time being.

I'm sure you've tried to clear the routing cache? Are you running any kind of dynamic discovery protocol like RIP? With two Internet interfaces, you may want to look into that.

Greg
 
Old 05-05-2004, 08:15 AM   #5
jszmajda
LQ Newbie
 
Registered: May 2004
Location: North Adams, MA
Distribution: fedora
Posts: 4

Original Poster
Rep: Reputation: 0
actually 157.238.135.60 was routable through the 'default' multipath route of eth0 and ppp0. I've actually recieved a pretty good solution from Julian Anastasov (he's written some patches for the linux kernel to help with routing) I'll copy and paste his reply here:

Hello Joshua,

On Tue, 4 May 2004, Joshua Szmajda wrote:

>> I have a question I thought you could answer. I have a linux router,
>> configured with two internet connections and two lan segments. I've
>> setup multipath routing as described in
>> http://lartc.org/howto/lartc.rpdb.multiple-links.html
>>
>> My problem (I think) is that somehow the router will randomly choose
>> incorrect routing paths for different hosts, for example:
>> on my workstation (192.168.1.20), I ssh to a server I have on an
>> external network (157.238.135.60), and my connection locally hangs. On
>> the router, I search the routing cache:

Yes, Netfilter NAT does not use correctly the routing
and does not bind each NAT connection to particular path (nexthop).
As result, a routing cache flush or entry expiration leads to
rerouting which can select another path. ssh can further exploit
this by providing different TOS values during the connection life
causing different packets to use different paths.

So, all current kernels are unusable in their default code, you
need the extra CONNMARK netfilter module or the "routes" patch.

>> My question is: why does this happen? what can I do to fix it? Would
>> your patches help?

Yes, the patches can help, you can check nano.txt, you
will need some user space script(s) that will monitor the gateways'
status.

Regards

--
Julian Anastasov


So I'm going to try his patches to the kernel and see if that helps. Thanks for your help!
 
  


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
multipath routing questions (as usual) eantoranz Linux - Networking 1 07-20-2005 11:58 AM
problems with multipath routing eantoranz Linux - Networking 1 07-16-2005 01:00 PM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:40 AM.

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
Open Source Consulting | Domain Registration