Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jeff Kletsky <netfilter@allycomm.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Diagnosing "Error: NAT is only supported for IPv4/IPv6"
Date: Tue, 22 Aug 2017 19:33:15 +0200	[thread overview]
Message-ID: <20170822173315.GA18186@salvia> (raw)
In-Reply-To: <94b2bbfe-b72f-992f-b1c6-ec36e0aa4c1b@wagsky.com>

On Tue, Aug 22, 2017 at 09:55:10AM -0700, Jeff Kletsky wrote:
> Digging into the cause (and, for now ignoring the unhelpful error message),
> this appears to be a bug in nft
> 
> No matter what the documentation says, it appears that NAT statements can't
> be in an "inet" table
> 
> Parses and loads with "table ip"
> ================================
> 
> #!/usr/sbin/nft -f
> 
> flush ruleset
> 
> table ip global {
> 
>     chain nat_in {
>         type nat hook prerouting priority -100
>     continue
>     }
> 
>     chain nat_out {
>         type nat hook postrouting priority -100
>     continue
>     }
> 
> }
> 
> 
> Fails with "table inet"
> =======================
> 
> #!/usr/sbin/nft -f
> 
> flush ruleset
> 
> table inet global {
> 
>     chain nat_in {
>         type nat hook prerouting priority -100
>     continue
>     }
> 
>     chain nat_out {
>         type nat hook postrouting priority -100
>     continue
>     }
> 
> }
> 
> 
> The error messages here are different, but equally useless
> 
> $ sudo nft -f nftables.conf
> nftables.conf:3:1-14: Error: Could not process rule: No such file or
> directory
> flush ruleset
> ^^^^^^^^^^^^^^
> nftables.conf:3:1-14: Error: Could not process rule: No such file or
> directory
> flush ruleset
> ^^^^^^^^^^^^^^
> nftables.conf:3:1-14: Error: Could not process rule: No such file or
> directory
> flush ruleset
> ^^^^^^^^^^^^^^
> nftables.conf:3:1-14: Error: Could not process rule: No such file or
> directory
> flush ruleset
> ^^^^^^^^^^^^^^

This is working since:

commit 509671dfa03365bba727b8be5e522b737da93a6f
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Thu Jun 15 14:35:33 2017 +0200

    src: error reporting for nested ruleset representation

Would you give a try to nft.git snapshot to confirm this?

This will be included in the next release.

  reply	other threads:[~2017-08-22 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 21:42 Diagnosing "Error: NAT is only supported for IPv4/IPv6" Jeff Kletsky
2017-08-22 16:55 ` Jeff Kletsky
2017-08-22 17:33   ` Pablo Neira Ayuso [this message]
2017-08-22 19:48     ` Jeff Kletsky

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=20170822173315.GA18186@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter@allycomm.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