LWN: Comments on "Nftables reaches 1.0" https://lwn.net/Articles/867185/ This is a special feed containing comments posted to the individual LWN article titled "Nftables reaches 1.0". en-us Sat, 04 Oct 2025 09:42:53 +0000 Sat, 04 Oct 2025 09:42:53 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Nftables reaches 1.0 https://lwn.net/Articles/868704/ https://lwn.net/Articles/868704/ chaispaquichui <div class="FormattedComment"> Very useful, thanks !<br> </div> Thu, 09 Sep 2021 04:48:06 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868703/ https://lwn.net/Articles/868703/ splitice <div class="FormattedComment"> I&#x27;m in a similar camp. As someone who maintains and has developed alot of iptables modules I can certainly see the room for improvement, but I can&#x27;t help but think that nftables made just as many steps forward as it did steps backwards.<br> <p> Fingers crossed bpfilter will hit the mark better.<br> </div> Thu, 09 Sep 2021 04:13:25 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868331/ https://lwn.net/Articles/868331/ Chousuke <div class="FormattedComment"> Maybe picking on iproute2 was a bit unfair; I just remembered spending a lot of time trying to decipher the dense synopsis notation way back when. Taking another look, they&#x27;re definitely better than what nft has<br> <p> Lately I&#x27;ve felt a bit spoiled by OpenBSD manual pages. If you want to know what good documentation with man pages can look like, you can take a look at some of them. If everything were documented to the same standard I would never need Google...<br> <p> For example, If I want a quick overview on how OSPF works, I can just &quot;man ospfd&quot; on OpenBSD. The explanation may not strictly speaking have much to do with configuring ospfd itself, but well-placed context &quot;fluff&quot; is a huge quality-of-life improvement as it helps me understand the kinds of problems I can solve with the software.<br> </div> Fri, 03 Sep 2021 19:10:47 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868137/ https://lwn.net/Articles/868137/ ecree <div class="FormattedComment"> Regarding bpfilter and its stagnation, I have a little story to tell. Back when bpfilter was new, Davem asked me if I&#x27;d lend a hand with the code generator (in the user-mode blob that translates iptables rulesets to BPF programs); I replied that I&#x27;d like to but that I couldn&#x27;t find the documentation of the iptables uAPI/ABI and I didn&#x27;t know it well enough to work without docs. (include/uapi/linux/netfilter_ipv4/ip_tables.h is… unenlightening.)<br> <p> I heard nothing back, leading me to suspect that maybe the problem is that no-one *else* can remember all the corners of iptables either. &#x27;The implementation is the spec&#x27; is fine until you want to replace the implementation.<br> </div> Thu, 02 Sep 2021 14:01:38 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868103/ https://lwn.net/Articles/868103/ carORcdr <div class="FormattedComment"> I can appreciate the concern for the lack of examples, but if you actually look at all the manual pages for the 100+ programs (arpd...tipc-socket) there are actually a significant number of examples. If I decide to list them I will update this comment.<br> <p> There are many non-iproute2 programs, including significant ones, that have far fewer examples. Some have null.<br> <p> My definition of an example in the context of a program is a command string--<br> <p> $|# program argument[s] file|filepath<br> <p> I realize some may limit the definition of string to alphabetic characters. I do not. My definition of string is a string of characters--alphabetic, numeric and/or symbolic. <br> <p> </div> Thu, 02 Sep 2021 05:19:36 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868056/ https://lwn.net/Articles/868056/ Chousuke <div class="FormattedComment"> Replying to myself since I can&#x27;t edit to give an actual example:<br> <p> I tried finding the relevant documentation from the wiki page but I can&#x27;t; I&#x27;ve forgotten where I found it the last time. The manual page says &quot;Expressions can be combined using binary, logical, relational and other types of expressions&quot;, but *nowhere* does it detail what those expressions &quot;binary&quot;, &quot;logical&quot; or &quot;relational&quot; expressions are. It doesn&#x27;t even contain the word &quot;operator&quot;.<br> <p> I did find out that man libnftables-json at least lists &quot;binary operations&quot;, but there&#x27;s no context.<br> <p> Just in case someone ends up needing it, you can do stuff like this:<br> <p> ip daddr 10.240.1.0/24 dnat to ip daddr &amp; 0.0.0.255 | 10.140.7.0;<br> <p> I don&#x27;t even remember how I figured that out the first time, but it wasn&#x27;t thanks to the documentation.<br> <p> <p> </div> Wed, 01 Sep 2021 19:27:51 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868049/ https://lwn.net/Articles/868049/ Chousuke <div class="FormattedComment"> Unfortunately the nft manual page seems to take after the iproute2 suite of tools in being extremely light on examples and leaving the reader to figure out how to put things togethers from rather loosely organized grammar descriptions and tables. You basically have to guess how to use it.<br> <p> For example, if you wanted to know how to perform a 1:1 nat for an entire IP prefix, the manual page would not help because it doesn&#x27;t even mention that you can use bitwise operators (&amp;, |) with netmasks to perform calculations and modifications on packet fields.<br> <p> I know there&#x27;s a partial sentence somewhere on the wiki page that indirectly hints at this being possible because I found it some time ago when I had to do prefix translation, but I can&#x27;t find it anymore.<br> <p> nftables is capable, but its documentation makes me sad. It&#x27;s unbeliveably bad.<br> </div> Wed, 01 Sep 2021 18:58:18 +0000 Nftables reaches 1.0 https://lwn.net/Articles/868037/ https://lwn.net/Articles/868037/ flussence <div class="FormattedComment"> I want to like nftables, honestly, but after years of using it it&#x27;s still incredibly sharp and brittle for something that&#x27;s supposed to someday supplant the firewall everyone currently uses.<br> <p> I&#x27;d write out a laundry list of the snags I hit regularly but it turns out one already exists (<a href="https://bugzilla.netfilter.org/show_bug.cgi?id=1461">https://bugzilla.netfilter.org/show_bug.cgi?id=1461</a>). I&#x27;ve got a fail2ban setup that barely works; sometimes after a few hours of operation it refuses to add an address to a set that doesn&#x27;t contain it (this smells like unhandled hash collision... bug 1392?) — much worse is that sometimes adding a /32 is randomly and silently corrupted into a range covering half the ipv4 internet (bug 1438 - note that it&#x27;s happened to me even though I&#x27;m not setting auto-merge). I&#x27;ve found that appending a literal &quot;/32&quot; to the input prevents the latter, but I don&#x27;t understand why.<br> <p> In spite of that I&#x27;ll continue to use it because it&#x27;s easier to reason about rules that look like C instead of COBOL. The fundamental design at least seems sound and none of my gripes are unsolvable, I just wish I didn&#x27;t have to handhold it so much.<br> </div> Wed, 01 Sep 2021 18:17:05 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867820/ https://lwn.net/Articles/867820/ armijn <div class="FormattedComment"> Yes, this timeline is right. McHardy&#x27;s contributions took a very sharp dive around September 2011 and he was only sporadically active in the years after that, with almost nothing happening in 2012. Pablo&#x27;s contributions didn&#x27;t start increasing until after McHardy dropped out.<br> </div> Mon, 30 Aug 2021 19:59:06 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867763/ https://lwn.net/Articles/867763/ nybble41 <div class="FormattedComment"> The full list of commands is in the nft(8) manual page; it would be too long to include in the --help output. If you&#x27;re using iptables-nft (which the default iptables backend in Debian starting with Buster) then you can list your current iptables rules in nft syntax with the command &quot;sudo nft -s list ruleset&quot;.<br> </div> Mon, 30 Aug 2021 14:35:11 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867754/ https://lwn.net/Articles/867754/ pbonzini <div class="FormattedComment"> I have never done serious C++, but I think the issue there was that the error messages were overly precise and expanded the same template typenames over and over. At some point a couple tweaks were made, teaching the compiler about default template arguments and typedefs.<br> <p> In C, the problem was abysmal error recovery, causing dozens of cascaded errors for a single missing semicolon or fat-fingered type name (such as &quot;intt&quot; or &quot;unsgined char&quot;). With a recursive descent parser it&#x27;s relatively easy and maintainable to add heuristics that look ahead and insert missing tokens or fix things up as necessary. For example if you see two consecutive unknown identifiers, it&#x27;s likely that the first is a misspelled type and the second is a variable name. With some luck, that will remove a lot of errors involving that variable, because the compiler now knows about it and treats it as declared.<br> </div> Mon, 30 Aug 2021 13:22:44 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867752/ https://lwn.net/Articles/867752/ evgeny <div class="FormattedComment"> Writing and maintaining a complex FW config by hand is really a pain - especially when more than one firewall is involved and part of the rules must be kept in sync. Long ago, I started using fwbuilder. There is no support for nftables yet, but hopefully, that will change once nft becomes mainstream.<br> <p> </div> Mon, 30 Aug 2021 11:22:45 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867750/ https://lwn.net/Articles/867750/ taladar <div class="FormattedComment"> I just had a look at the CLI command nft and it still seems extremely unpolished<br> <p> When I call ntf --help I get<br> <p> <font class="QuotedText">&gt; Usage: nft [ options ] [ cmds... ]</font><br> <font class="QuotedText">&gt; [...]</font><br> <p> but not a single command is listed in the help output, nor another command/option that would display that information.<br> <p> When I try ntf help I get<br> <p> <font class="QuotedText">&gt; Operation not permitted (you must be root)</font><br> <font class="QuotedText">&gt; Error: syntax error, unexpected newline, expecting string</font><br> <font class="QuotedText">&gt; help</font><br> <font class="QuotedText">&gt; ^</font><br> <p> which seems like a weird mix of errors and also &quot;unexpected newline&quot; is an odd error to emit for commandline parameters, not to mention that it is far too low level in general.<br> <p> There is also no obvious option in the --help output to list the currently active ruleset.<br> <p> On top of that, since firewalls are quite complex we will be unlikely to maintain an iptables and an nftables version of our rulesets in our Puppet configuration management so a working and usable and fully featured version will have to be part of the oldest distros we use before it is even something to consider, so I would imagine nothing will happen before about 2030 since the current version doesn&#x27;t really look usable yet.<br> </div> Mon, 30 Aug 2021 09:13:42 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867748/ https://lwn.net/Articles/867748/ carORcdr <div class="FormattedComment"> &quot;The nftables project to replace the kernel&#x27;s packet-filtering subsystem has its origins in 2008, but is still not being used by most (or perhaps even many) production firewalls. &quot;<br> <p> Glad to see a substantive article on nftables and iptables. Do you have any numbers on the use in production firewalls?<br> <p> In Rusty&#x27;s words:<br> <p> When your Linux box is the only thing between the chaos of the Internet and your nice, orderly network, it&#x27;s nice to know you can restrict what comes tromping in your door.<br> <p> Rusty Russel, Linux IPCHAINS-HOWTO, v1.0.8 (2000-07-04)<br> <p> </div> Mon, 30 Aug 2021 06:46:27 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867725/ https://lwn.net/Articles/867725/ moorray <div class="FormattedComment"> <font class="QuotedText">&gt; McHardy decided he had more interesting opportunities to pursue in courtrooms. In 2013, though, Pablo Neira Ayuso restarted the project</font><br> <p> Is this timeline right? I remember wondering if Patric got unhinged *because* Pablo’s implementation got picked over his.. The quote makes it sound like Pablo came after. It was before my time tho.<br> </div> Sun, 29 Aug 2021 13:49:17 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867716/ https://lwn.net/Articles/867716/ johill <div class="FormattedComment"> I don&#x27;t think that&#x27;s how it works - it wants to compile iptables (not nftables) _rules_, but as far as I can tell it has a separate userspace etc. that does all of that, rather than doing a sort of &quot;VM to VM&quot; translation in the kernel I was thinking of (NFT VM to BPF VM)<br> </div> Sun, 29 Aug 2021 07:43:22 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867715/ https://lwn.net/Articles/867715/ nilsmeyer <div class="FormattedComment"> According to the LWN bpfilter article this is already possible with iptables:<br> <a href="https://lwn.net/Articles/747551/">https://lwn.net/Articles/747551/</a><br> <p> Under: &quot;Bringing in BPF&quot;<br> <font class="QuotedText">&gt; One of the core design features for bpfilter is the ability to translate existing iptables rules into BPF programs. </font><br> </div> Sun, 29 Aug 2021 07:12:41 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867713/ https://lwn.net/Articles/867713/ josh <div class="FormattedComment"> I definitely like nftables better than iptables, both for atomicity and for syntax.<br> <p> But I do wish the documentation was much better, especially the documentation for the kernel-to-userspace interfaces.<br> </div> Sun, 29 Aug 2021 03:59:26 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867701/ https://lwn.net/Articles/867701/ Paf <div class="FormattedComment"> My experience with C++ errors around 2010-2011 (with whatever was in Ubuntu at the time) was there was a lot of multi-page spew when using even fairly simple templates?<br> </div> Sat, 28 Aug 2021 21:24:48 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867697/ https://lwn.net/Articles/867697/ pbonzini <div class="FormattedComment"> <font class="QuotedText">&gt; gcc error messages from the era before llvm, </font><br> <p> Ahah, that&#x27;s actually a coincidence. GCC error messages for C were bad mostly due to the usage of yacc for the parser. When the parser was rewritten as recursive decent in 2004 by Joseph Myers that laid the foundation for improving error recovery. They then finally improved when GCC developers including myself got fed up of a few particularly egregious cases[1][2].<br> <p> But competition with llvm wasn&#x27;t particularly involved. In fact for C++ (which used recursive descent since before clang was started) error message quality has always been comparable to clang.<br> <p> More recently (and long after I had stopped working on GCC), David Malcolm did a huge amount of work on caret diagnostics, where GCC&#x27;s front ends were indeed lagging behind. But that&#x27;s a different story.<br> <p> [1] <a href="https://gcc.gnu.org/legacy-ml/gcc-patches/2010-10/msg02619.html">https://gcc.gnu.org/legacy-ml/gcc-patches/2010-10/msg0261...</a><br> <p> [2] <a href="https://gcc.gnu.org/legacy-ml/gcc-patches/2010-11/msg01808.html">https://gcc.gnu.org/legacy-ml/gcc-patches/2010-11/msg0180...</a><br> </div> Sat, 28 Aug 2021 20:25:34 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867690/ https://lwn.net/Articles/867690/ hailfinger <div class="FormattedComment"> I had the questionable idea to set up a nftables based packet filter on various Debian Buster systems in 2020/2021 because nftables was declared to be the future. Lessons learned:<br> - The syntax is nice once you get used to it and I think most of it is more easily readable due to the structure<br> - The documentation was incomplete, especially for NAT<br> - If the documentation says that two ways to specify a rule are equivalent you should verify that instead of blindly rewriting working rules<br> - Concatenations are cool, but rarely work<br> - Order within in a single rule matters sometimes<br> - Combining the same rule from &quot;table ip nat&quot; and &quot;table ip6 nat&quot; into &quot;table inet nat&quot; only works in some cases<br> - If your kernel and the nftables userspace are not the same age you will run into problems, so either upgrade both or none, this may be different now that 1.0 is released<br> - Kernel 5.10 is roughly where most of the interesting functions start working if your userspace is new enough and nftables 0.9.6 (Buster Backports) is similarly a point where things start working better<br> - On Debian Buster without backports the whole thing is really painful, it&#x27;s manageable with backports<br> - Priorities as keywords (introduced in 0.9.6) instead of priorities as numbers helps a lot with readability compared to older versions<br> - Error messages exist, but in netfilter 0.9.6 (from 2020) they were as helpful as gcc error messages (&quot;error: expected ‘asm’ or ‘__attribute__’&quot; instead of &quot;missing semicolon&quot;) from the era before llvm, they are a bit better now<br> <p> Overall, I think nftables has a nice future ahead and I&#x27;m looking forward to testing nftables 1.0.<br> </div> Sat, 28 Aug 2021 15:41:36 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867683/ https://lwn.net/Articles/867683/ wtarreau <div class="FormattedComment"> In my opinion it has significantly improved over the years. I&#x27;m using it at home as well and it&#x27;s way better than iptables. There are some places where you still can&#x27;t merge IPv4 and IPv6 rules, resulting in some duplication effort but I found that it remained reasonable (though more unification would always be welcome of course).<br> <p> The really nice thing compared to iptables is the instant and atomic load of the rules. No more situation where the nat table loads while the filter table fails etc. And the ability to define objects supporting lists about everywhere (ports, hosts etc) is great. I used to do that using scripts requiring a more complex language to automatically produce iterations. Now it is natural in the config language.<br> <p> What still really annoys me is the lack of command-line help. I promised Pablo I would some day send him a patch for this but still failed to find sufficient time to work on it. Having to go to the wiki to figure you need to type &quot;nft list rulesets&quot; after not having used it for 2 months is pretty annoying, especially when you&#x27;ve been used to &quot;iptables -h&quot; providing very detailed syntax information. But this minor user-interface aspect aside, nftables is a great technology that is far closer from the spirit of traffic filtering than ipfwadm, ipchains or iptables could be, making it extremely user-friendly.<br> <p> It&#x27;s difficult to adopt it, but it&#x27;s really worth it. Most of the effort is to convert the existing config. I would strongly encourage new firewall deployments to start with nftables, as it will be much easier than iptables for the first setup, an will not require any conversion.<br> </div> Sat, 28 Aug 2021 06:47:14 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867678/ https://lwn.net/Articles/867678/ jkingweb <div class="FormattedComment"> I set up the firewall on my home server using nftables as a learning exercise circa 2016 or thereabouts after my ISP deployed IPv6 service, with no significant prior experience in packet filtering. I found the experience decent-but-finicky, with some disappointing duplication of effort to handle both IPv4 and IPv6. <br> <p> I&#x27;m not sure what documentation I was following at the time; it may have led me down suboptimal paths, or things may have improved in the years since. I&#x27;ll have to give it another look!<br> </div> Fri, 27 Aug 2021 22:54:53 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867651/ https://lwn.net/Articles/867651/ aszs <div class="FormattedComment"> As amusing as that would be, it doesn&#x27;t seem likely given <a href="https://lwn.net/Articles/858173/">https://lwn.net/Articles/858173/</a>, for better or worse...<br> </div> Fri, 27 Aug 2021 18:11:00 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867644/ https://lwn.net/Articles/867644/ johill <div class="FormattedComment"> Couldn&#x27;t you kind of compile NFT to BPF?<br> <p> Today NFT has a whole bunch of &#x27;eval&#x27; methods, so to compile to BPF you just need to have a function that returns a few BPF instructions instead. Where not implemented, provide a BPF helper function that calls the existing eval function from BPF.<br> <p> It doesn&#x27;t even seem that hard, and if you implement the most commonly used &#x27;eval&#x27; methods directly and then send the program through the compiler you&#x27;ll probably already win something?<br> </div> Fri, 27 Aug 2021 15:57:48 +0000 Nftables reaches 1.0 https://lwn.net/Articles/867643/ https://lwn.net/Articles/867643/ magfr <div class="FormattedComment"> I suppose it was inevitable. BPF is used for absolutely everything in the kernel with one exception:<br> Packet filtering.<br> </div> Fri, 27 Aug 2021 15:46:32 +0000