netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: laforge@netfilter.org, netfilter-devel@lists.netfilter.org,
	rusty@rustcorp.com.au, netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru
Subject: Re: [RFC] MASQUERADE / policy routing ("Route send us somewhere else")
Date: Mon, 30 Aug 2004 22:39:20 -0700	[thread overview]
Message-ID: <20040830223920.1db0d5ae.davem@davemloft.net> (raw)
In-Reply-To: <E1C1yRs-00086x-00@gondolin.me.apana.org.au>

On Tue, 31 Aug 2004 12:32:40 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> This is what happens:
> 
> * Forwarded packet is routed to iface1.
> * Packet hits MASQUERADE.
> * Routing lookup returns iface2 with different source address.
> 
> So if iface2's source address is not valid when the packet leaves on
> iface1, then the packet won't go very far.
> 
> If you're wondering why the second lookup is returning a different
> interface at all, it's because the routing lookup in MASQUERADE is
> done as if the packet was generated by localhost.  This is obviously
> going to differ from the normal routing lookup if the packet was
> forwarded.

I understand this description.

Would it be enough to set 'out' to rt->u.dst.dev after the call to
ip_route_output_key() in ipt_MASQUERADE.c?

  reply	other threads:[~2004-08-31  5:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-30 20:19 [RFC] MASQUERADE / policy routing ("Route send us somewhere else") Harald Welte
2004-08-30 21:07 ` David S. Miller
2004-08-31  1:38   ` Harald Welte
2004-08-31  2:19     ` David S. Miller
2004-08-31  2:32       ` Herbert Xu
2004-08-31  5:39         ` David S. Miller [this message]
2004-08-31  6:43           ` Herbert Xu
2004-08-31  7:00             ` Herbert Xu
2004-08-31  8:23               ` Herbert Xu
2004-08-31  9:41                 ` Julian Anastasov
2004-08-31 10:12                   ` Herbert Xu
2004-08-31 10:54                     ` Julian Anastasov
2004-08-31 11:15                       ` Herbert Xu
2004-08-31 12:33                         ` Julian Anastasov
2004-08-31 21:28                           ` Herbert Xu
2004-08-31 21:33                             ` Herbert Xu
2004-09-01  5:04                               ` Julian Anastasov
2004-08-31  6:48           ` Julian Anastasov
2004-08-31 12:16             ` Harald Welte
2004-08-31  2:20     ` Herbert Xu
2004-08-31  2:24       ` David S. Miller
2004-08-31  2:33         ` Herbert Xu
2004-08-31 10:24     ` Henrik Nordstrom
2004-08-31 11:29       ` Herbert Xu
2004-08-31 12:31       ` Harald Welte

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=20040830223920.1db0d5ae.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=laforge@netfilter.org \
    --cc=netdev@oss.sgi.com \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=rusty@rustcorp.com.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).