All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Karol Babioch <karol@babioch.de>
Cc: netfilter@vger.kernel.org
Subject: Re: nftables: DNAT state in connection tracking?
Date: Tue, 15 Mar 2016 01:51:11 +0100	[thread overview]
Message-ID: <20160315005111.GA23518@salvia> (raw)
In-Reply-To: <56D81A2B.2010704@babioch.de>

On Thu, Mar 03, 2016 at 12:04:11PM +0100, Karol Babioch wrote:
> Hi,
> 
> in my old iptables setup I've used something like this in the FORWARD
> chain to allow traffic that has been redirected through DNAT beforehand
> (i.e. in the NAT PREROUTING table).
> 
> iptables -A FORWARD -m conntrack --ctstate DNAT -j ACCEPT
>
> This way I don't have to specify rules twice, which is not only a
> massive overhead, but also prone to errors. Apparently nftables does not
> know anything about the "DNAT" and "SNAT" states.
> 
> Is there a way to simulate something like this? Marking all packages
> that are redirected using DNAT in the nat table, and allowing all marked
> packages through in the forwarding chain, should work, shouldn't it? Is
> this in any way different to the iptables approach?

I think:

        nft add rule filter forward ct status dnat accept

should do the trick for you.

      reply	other threads:[~2016-03-15  0:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 11:04 nftables: DNAT state in connection tracking? Karol Babioch
2016-03-15  0:51 ` Pablo Neira Ayuso [this message]

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=20160315005111.GA23518@salvia \
    --to=pablo@netfilter.org \
    --cc=karol@babioch.de \
    --cc=netfilter@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.