Linux Netfilter discussions
 help / color / mirror / Atom feed
* nftables: DNAT state in connection tracking?
@ 2016-03-03 11:04 Karol Babioch
  2016-03-15  0:51 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Karol Babioch @ 2016-03-03 11:04 UTC (permalink / raw)
  To: netfilter


[-- Attachment #1.1: Type: text/plain, Size: 760 bytes --]

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?

Thanks!

Best regards,
Karol Babioch


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: nftables: DNAT state in connection tracking?
  2016-03-03 11:04 nftables: DNAT state in connection tracking? Karol Babioch
@ 2016-03-15  0:51 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-03-15  0:51 UTC (permalink / raw)
  To: Karol Babioch; +Cc: netfilter

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-15  0:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 11:04 nftables: DNAT state in connection tracking? Karol Babioch
2016-03-15  0:51 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox