netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Thomas Graf <tgraf@suug.ch>,
	netfilter-devel@vger.kernel.org,
	Madhu Challa <challa@noironetworks.com>
Subject: Re: [PATCH nf-next] netfilter: conntrack: add support for flextuples
Date: Fri, 08 May 2015 11:45:29 +0200	[thread overview]
Message-ID: <554C85B9.2070206@iogearbox.net> (raw)
In-Reply-To: <20150507181004.GA3470@salvia>

Hi Pablo,

On 05/07/2015 08:10 PM, Pablo Neira Ayuso wrote:
> On Thu, May 07, 2015 at 02:01:11PM +0200, Daniel Borkmann wrote:
>> ...
>>>>> Another question is if it makes sense to have part of the flows using
>>>>> your flextuple idea while some others not, ie.
>>>>>
>>>>>          -s x.y.z.w/24 -j CT --flextuple original
>>>>>
>>>>> so shouldn't this be a global switch that includes the skb->mark
>>>>> only for packets coming in the original direction?
>>>>
>>>> I first thought about a global sysctl switch, but eventually found
>>>> this config possibility from iptables side much cleaner resp. better
>>>> integrated. I think if the environment is correctly configured for
>>>> that, such a partial flextuple scenario works, too.
>>>
>>> This is consuming two ct status bits, these are exposed to userspace,
>>> and we have a limited number of bits there. The one in the original
>>> direction might be justified for the SNAT case in the specific
>>> scenario that you show.
>>
>> Okay, agreed. I will respin the set with --flextuple ORIGINAL direction
>> allowed where we'd for now only consume a single status bit. If later
>> on there's a need to extend this for REPLY (or even hybrid), we still
>> have the option to extend it.
>
> I would like to know if it makes sense to add this later on. Would you
> elaborate a useful DNAT scenario where this can be useful?

What comes to mind in case of hybrid usage for firewalling would be that
flextuple in both directions would act similarly as zones, for example,
you could map things like tunnel id into u32 space and include that into
the match'er w/o many additional rules or memory overhead.

For the reply-only, case I was thinking about a case where you'd have
multiple containers behind the DNAT all with same ip/port each where a
server listens on and you'd select one of the containers e.g. via
xt_statistic module as a mark and do mark-based routing behind the DNAT,
but that itself still has the source in front of the DNAT unique, so it
wouldn't need a mark inclusion in the reply case. So for reply-only, I
currently don't find an intuitive use case.

Best,
Daniel

  reply	other threads:[~2015-05-08  9:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 10:23 [PATCH nf-next] netfilter: conntrack: add support for flextuples Daniel Borkmann
2015-05-04 10:34 ` Pablo Neira Ayuso
2015-05-04 11:59   ` Daniel Borkmann
2015-05-04 13:08     ` Pablo Neira Ayuso
2015-05-04 13:47       ` Thomas Graf
2015-05-06 14:27         ` Pablo Neira Ayuso
2015-05-06 18:00           ` Daniel Borkmann
2015-05-06 18:50             ` Pablo Neira Ayuso
2015-05-07 12:01               ` Daniel Borkmann
2015-05-07 18:10                 ` Pablo Neira Ayuso
2015-05-08  9:45                   ` Daniel Borkmann [this message]
2015-05-04 13:51       ` Daniel Borkmann

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=554C85B9.2070206@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=challa@noironetworks.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=tgraf@suug.ch \
    /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).