Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Dominique MARTINET <dominique.martinet@atmark-techno.com>
To: netfilter@vger.kernel.org
Subject: Re: Requirements for nft nat pre/postrouting chains?
Date: Wed, 27 Jul 2022 21:04:15 +0900	[thread overview]
Message-ID: <YuEpv1o07HjUZgLk@atmark-techno.com> (raw)
In-Reply-To: <YuDxVBz7FVqk+FHz@atmark-techno.com>

Dominique MARTINET wrote on Wed, Jul 27, 2022 at 05:03:32PM +0900:
> I've boiled down the reproducer to this:
> 
> ---
> nft add table ip test
> nft chain ip test test '{ type nat hook prerouting priority -100; policy accept; }'
> nft add rule ip test test log prefix "test-pre-" counter packets 0 bytes 0
> 
> # at this point do some network activity;
> # since there is no match specified new connections should trigger
> # the log and increment counters for the rule
> nft list table test
> 
> # (and cleanup)
> nft delete table test
> ---

Florian Westphal replied off list (thanks!)

After a couple of mails the problem just boils down to conntrack not
being loaded by a log rule.
Adding a ct state rule in filter or any masquerade/redirect/snat/dnat in
here enables it and everything works well.

I was just double-confused because my initial test machine, which had
dnat rules was down to the other problem of older kernels:
> (I've also seen on the internet that for older kernels iptable_nat is
> incompatible with nft nat chains and tried taking it out, but that
> shouldn't be relevant anymore)


So all is cleared up now,
thanks!
-- 
Dominique

      reply	other threads:[~2022-07-27 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27  8:03 Requirements for nft nat pre/postrouting chains? Dominique MARTINET
2022-07-27 12:04 ` Dominique MARTINET [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=YuEpv1o07HjUZgLk@atmark-techno.com \
    --to=dominique.martinet@atmark-techno.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox