netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Herz <andi@geekosphere.org>
To: Patrick Schaaf <bof@bof.de>
Cc: netfilter-devel@vger.kernel.org,
	"Maciej Żenczykowski" <zenczykowski@gmail.com>
Subject: Re: function for getting the source ip defined in the routing table
Date: Thu, 22 May 2014 12:31:48 +0200	[thread overview]
Message-ID: <20140522103148.GA10939@kvmbude> (raw)
In-Reply-To: <CAJ26g5T1Ugfy-tfeFUBWABLrwuNkG26V7u=SvF6cr9pFwkGobA@mail.gmail.com>

On 22/05/14 at 11:41, Patrick Schaaf wrote:
> Am 22.05.2014 11:15 schrieb "Andreas Herz" <andi@geekosphere.org>:
> >
> > I will try your hint to use ip_route_output_key twice.
> 
> A second call with input src set to 0 will match a _different_ set of
> rules, so that will probably not work.

That's correct, the wrong rule will match again and the same issue with
calling it without src ip in the first place.

> > Although i still wonder why my requirement is so special :)
> 
> Combining MASQUERADE with policy routing is probably a bit rare :)

Is it? We have several scenarios in that we have more IPs on one
interface and different routes and want to specify the source IP.
Especially in cluster scenarios.

> You could work around with a set of rules using SNAT while matching
> outgoing interface and source/destination IPs - basically duplicating your
> extra routing table in the nat POSTROUTING chains. But that is certainly a
> pain to maintain...

That's the reason why we ported MASQUERADE from 2.6.9 to the newer
kernels to keep it to less rules.

Since rt->src got removed i wanted to find a way to update the module,
but for now it looks like i have to patch the kernel itself :/

Thanks so far.

-- 
Andreas Herz

  parent reply	other threads:[~2014-05-22 10:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 12:46 function for getting the source ip defined in the routing table Andreas Herz
2014-05-20 14:03 ` Jan Engelhardt
2014-05-20 14:18   ` Andreas Herz
2014-05-20 15:38     ` Maciej Żenczykowski
2014-05-21  8:36       ` Andreas Herz
2014-05-21 17:06         ` Maciej Żenczykowski
2014-05-21 17:07           ` Maciej Żenczykowski
2014-05-22  9:11           ` Andreas Herz
     [not found]             ` <CAJ26g5T1Ugfy-tfeFUBWABLrwuNkG26V7u=SvF6cr9pFwkGobA@mail.gmail.com>
2014-05-22 10:31               ` Andreas Herz [this message]
2014-06-03  7:55   ` Andreas Herz

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=20140522103148.GA10939@kvmbude \
    --to=andi@geekosphere.org \
    --cc=bof@bof.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=zenczykowski@gmail.com \
    /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).