From: Chris Friesen <chris.friesen@genband.com>
To: Joe Buehler <aspam@cox.net>
Cc: netdev@vger.kernel.org
Subject: Re: source route ignored in favor of local interface
Date: Tue, 01 Mar 2011 13:05:20 -0600 [thread overview]
Message-ID: <4D6D4370.5040308@genband.com> (raw)
In-Reply-To: <loom.20110301T154947-689@post.gmane.org>
On 03/01/2011 08:57 AM, Joe Buehler wrote:
> I have a LINUX box talking on many different networks at the same time. Since
> IP addresses on the networks can overlap (they are completely different
> networks) we use source routing and NAT to get packets going in and out of the
> right interfaces.
>
> Everything works great, with one exception. If I try to talk to a remote host
> that happens to have the same IP address as one of my interfaces, the kernel
> routes the packet to the local interface.
>
> It looks to me as though the problem is that the source routes are lower
> priority than the local interfaces. As soon as the kernel sees a destination
> address that matches a local interface it routes to the local interface and pays
> no attention to the source route.
>
> I consider this a bug. Is there any way to change this behavior?
How exactly do you expect it to handle this case? You've explicitly
told your host that its address is X, so why would it expect to find
that address assigned to another machine on the network? Suppose you
have an app listening on INADDR_ANY, and it gets a packet from that
adddres--how does it know whether the packet is destined to the local
machine or the remote one?
If you really want to modify things, have you looked at your ip rules?
"ip ru" will dump them. Typically it looks something like
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
The last item in each row is the name of the routing table. As you can
see, the first rule is for local interfaces, and a later rule deals with
the main and default routing tables.
You could move the local lookup to rule 1 and add in a new rule 0
specifically dealing with your situation.
Chris
--
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com
next prev parent reply other threads:[~2011-03-01 19:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 14:57 source route ignored in favor of local interface Joe Buehler
2011-03-01 19:05 ` Chris Friesen [this message]
2011-03-01 19:31 ` Joe Buehler
2011-03-02 18:55 ` Ben Greear
2011-06-09 16:27 ` Joe Buehler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D6D4370.5040308@genband.com \
--to=chris.friesen@genband.com \
--cc=aspam@cox.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.