<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Raymond P. Burkholder - Things I Do - nftables</title>
    <link>http://blog.raymond.burkholder.net/</link>
    <description>In And Around Technology and The Arts</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.7.2 - http://www.s9y.org/</generator>
    <pubDate>Thu, 19 Apr 2018 00:50:21 GMT</pubDate>

    <image>
        <url>http://blog.raymond.burkholder.net/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Raymond P. Burkholder - Things I Do - nftables - In And Around Technology and The Arts</title>
        <link>http://blog.raymond.burkholder.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>nftables: connection tracker helpers</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/919-nftables-connection-tracker-helpers.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/919-nftables-connection-tracker-helpers.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=919</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=919</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;From a mailing list entry:

&lt;p&gt;Question:

&lt;blockquote&gt;
using nft from nftables, I created some IP filter rules inside a partially
virtualized (Linux Vserver, &lt;a href=&quot;http://www.linux-vserver.org&quot; target=_blank&gt;www.linux-vserver.org&lt;/a&gt;) machine. Almost all rules
are working as desired, but rules that need connection tracking helpers,
like ftp and tftp, do not . some ip packets are blocked though they should
be allowed. As the same tftp rules - I am sure that I made no mistake - work
on a real host, there is probably some requirement for these helpers to work
correctly and that is not fulfilled inside a Vserver.
&lt;/blockquote&gt;

&lt;p&gt;Answer:

&lt;blockquote&gt;
&lt;p&gt;In recent kernels no default assignments of helpers is done anymore,
iptables users need to use -j CT target, nft users need to add a helper
object:
&lt;pre&gt;
nft add ct helper inet filter bar &#039;{ type &quot;ftp&quot; protocol tcp; }&#039;
nft add rule inet filter output tcp dport 21 ct helper set &quot;bar&quot;
&lt;/pre&gt;
&lt;p&gt;The assignnment needs to be done in the direction that creates the
connections that need the helper.

&lt;p&gt;So for a local host (connecting to remote server), this needs to be output;
for a server (expecting ftp connections), input.

&lt;p&gt;For a gateway it can be in forward, or prerouting and output in case
its needed everywhere (local and forwarded).

&lt;p&gt;Also it makes sense to limit helper assignemnt to connections
that need it (e.g. ip saddr 192.168/16 or somesuch).
&lt;/blockquote&gt;

&lt;p&gt;With a later addendum:

&lt;blockquote&gt;
As I do not have the required nftables and kernel versions, I reactivated default assignment with
&lt;pre&gt;
echo 1 &gt; /proc/sys/net/netfilter/nf_conntrack_helper
&lt;/pre&gt;
&lt;p&gt;like described at the bottom of 
&lt;a href=&quot;https://wiki.nftables.org/wiki-nftables/index.php/Setting_packet_connection_tracking_metainformation&quot; target=_blank&gt;connection tracking meta-information&lt;/a&gt;
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Thu, 19 Apr 2018 00:45:08 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/919-guid.html</guid>
    
</item>
<item>
    <title>nftables: how to read a statement</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/875-nftables-how-to-read-a-statement.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/875-nftables-how-to-read-a-statement.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=875</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=875</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;Extracted from a mail list entry:

&lt;blockquote&gt;
&lt;p&gt;Each rule is evaluated left-to-right. Every element has a &quot;truth&quot; value,
a boolean pass-fail. So things like &quot;counter&quot; and &quot;log&quot; are &quot;always
true&quot; (it has no &quot;test-like action&quot;).

&lt;p&gt;Other elements like &quot;tcp dport http&quot; are multiple tests in one, where
first it has to be &quot;tcp&quot; and, now that the tcp-ness is established the
packet is known to have a destination port, so the port number can be
compared to 80 (the http well known port) for equality.

&lt;p&gt;The first time you hit something that is &quot;false&quot; the rest of the line is
skipped.

&lt;p&gt;So mentally put the words &quot;and then&quot; between each directive.

&lt;p&gt;So :: counter and then limit rate 10 kbytes/minute and then counter and
then tcp sport http and then counter and then log prefix &quot;whatever&quot;
flags all and then counter

&lt;p&gt;A very few things break this rule. Like &quot;accept&quot; and &quot;drop&quot; are terminal
to the rule, and the chain, once you &quot;accept&quot; then the rest of the rule
and the rest of the chain just don&#039;t matter.

&lt;p&gt;So limit comes before action if you want that action to be limited by
that limit.

&lt;p&gt;Same for literally everything else.

&lt;p&gt;Now what this means is that order is important, but unlike iptables, you
can stack the non-terminal actions several deep in a rule, even
returning adding extra tests after one action and before the next.

&lt;p&gt;So you can make long and complex rules that get progressively more picky
about the packets that get to that point.

&lt;p&gt;The carriage return is like a &quot;start-from-scratch&quot; where the previous
rule is done and the condition is reset to &quot;true&quot;.

&lt;p&gt;That is, any rule could be mentally rewritten as &quot;true and then (rest of
rule).

&lt;p&gt;This is why you can just have a log statement as the whole rule if you
want to log every packet that hasn&#039;t yet hit a terminal like accept or
drop. Indeed a bare log rule at the end of a chain is a great way to log
all the packets that are about to hit the &quot;policy&quot; of the chain, or
which have otherwise gotten to the end of a sub-chain when you were
expecting to handle every possibility.

&lt;p&gt;So just relax and understand that the whole thing is &quot;as you read&quot;,
while iptables was &quot;test-and-do&quot;.

&lt;p&gt;So no, the limit isn&#039;t limiting &quot;all packets that enter the rule&quot;, it
limits all packets that &quot;get as far along the rule as the limit statement&quot;.

&lt;p&gt;So ...

&lt;p&gt;limit rate 10 kbytes/minute tcp dport http log &quot;whatever&quot; flags all
&lt;p&gt;and
&lt;p&gt;tcp dport http limit rate 10 kbytes/minute log &quot;whatever&quot; flags all

&lt;p&gt;produce completely different results.

&lt;p&gt;In the first one you are only considering 10 kilobytes a minute of
packets, then of that limited set you are logging the http requests.

&lt;p&gt;In the second one you are considering the first 10 kilobytes of http
requests per minute.

&lt;p&gt;So in the first rule the ssh and ftp and sip and dhcp and all the other
traffic are being considered in the limit, and then only the http is
being logged. This is almost certianly not what you want.

&lt;p&gt;In the second the http-ness is considered first, and then you limit the
logging rate.

&lt;p&gt;And of course it is not &quot;10 kbytes of log&quot; it&#039;s 10 kbytes of data&quot; so if
you are sending large requests, and the Mtu is the nominal 1500 bytes
per packet, your ten kbytes is probably seven or eight packets a minute
total.

&lt;p&gt;See... thing, and then thing, and then thing... as you read.

&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Mon, 25 Dec 2017 16:39:30 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/875-guid.html</guid>
    
</item>
<item>
    <title>nftables pearls of wisdom</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/874-nftables-pearls-of-wisdom.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/874-nftables-pearls-of-wisdom.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=874</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=874</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://wiki.nftables.org/wiki-nftables/index.php/Scripting&quot; target=_blank&gt;nftables scripting&lt;/a&gt;

&lt;p&gt;Using &lt;b&gt;iif&lt;/b&gt; vs &lt;b&gt;iifname&lt;/b&gt;:

&lt;blockquote&gt;
&lt;p&gt;iifname does a string comparison of the interface name so
is slower than iif which does a numeric comparison of the interface index.

&lt;p&gt;You can only use iif on interfaces with a fixed index number and which exist
(i.e. pretty much hardware interfaces e.g. wlan0 &amp;amp; eth0, but not ppp0 or
virbr0).
&lt;/blockquote&gt;

&lt;p&gt;Using interface group numbers to &quot;get the numeric comparison speed and you can cover groups of
interfaces without elaboration or sets&quot;:

&lt;blockquote&gt;&lt;pre&gt;
#In startup scripts, for example
ip link set dev ppp0 group 1
&lt;/pre&gt;
Then
&lt;pre&gt;
#in the nftables file
iifgroup gt 1 counter accept
iifgroup 1 tcp dport {ssh,http} ct state new counter accept
&lt;/pre&gt;
&lt;p&gt;I use group 1 for ingress ports, 2 for local bridges, 3 for bridge
members and so on. Now I have a greater-than one domain for interior and
equal-to 1 for configured interfaces.

&lt;p&gt;When an interface is being built it&#039;s group is &quot;default&quot; (as in zero) so
it starts life as blocked by the drop policies until it&#039;s assigned its
correct group.
&lt;/blockquote&gt;

&lt;p&gt;More from Robert White:

&lt;blockquote&gt;
&lt;p&gt;The whole set of
all group numbers is available even when no interfaces are assigned to
the numbers.

&lt;p&gt;so

&lt;p&gt;&quot;iif&quot; and &quot;oif&quot; is the interface by unique number, and can not be
predicted by the kernel as it&#039;s driver initialization order dependent.
It also varies by the addition and removal of temporary endpoints like
VPNs and tunnels. The &quot;nft&quot; command simply looks up the number of the
interface when you use a name after the opcode. That means &quot;iif ppp4&quot;
can only be resolved if ppp4 exists when the nft command is run.

&lt;p&gt;&quot;iifname&quot; and &quot;oifname&quot; simply preserve the string you provide and do a
string compare at runtime. You can add and remove the named interface
and the rule set just doesn&#039;t care. But it&#039;s slow because you are doing
string compares.

&lt;p&gt;Both also suffer from scaling issues as if you have a hundred interfaces
(not likely, but not impossible) then you need to have rules for all 100.

&lt;p&gt;Sets let you cut that down by a bunch.

&lt;p&gt;But what _I_ do is use interface _group_ numbers.

&lt;p&gt;Interfaces are instantiated in the &quot;default&quot; group, which is zero.

&lt;p&gt;You assign a group number to an interface with the ip command. But the
syntax is poorly documented. The manual pages define &quot;group DEVNUM&quot; as a
_selector_, just like &quot;dev DEVNAME&quot;. It&#039;s a selector in that if you do
something like &quot;ip set group 5 down&quot; all the interfaces in group 5 will
be shut down. (This is a feature). But when you use &quot;ip set dev DEVNAME
group DEVNUM&quot; then the &quot;group&quot; stanza is an assignment.

&lt;p&gt;So I run a fairly simple site, where I picked one (1) as the group for
all my ingress/egress ports, and all the numbers greater than one
represent internal purposes. Group 2 is all my raw internal ports. Group
3 is my bridges. and so on (in my other post I swapped 2 and 3 by accident).

&lt;p&gt;The important point is there is a fixed numeric break between the low
&quot;untrusted&quot; port group numbers, and the higher &quot;trusted&quot; port group numbers.

&lt;p&gt;In a complex site, like if you offer PPP service, you might want the
break number to be higher. with 1 for PPP (the least trustworthy) and 2
for wired public interfaces, and your trusted domain starting at 3. That
way you can filter things like DCHP to be legal on 2 and above, but
preventing your PPP clients from trying to inject DCHP packets (or
whatever).

&lt;p&gt;Anyway, you can now write a concise set of rules using just the group
numbers and, most importantly, load those rules before any interfaces
are active at all.

&lt;p&gt;You can now load a fixed and static set of rules that are much simpler.
&lt;pre&gt;
iifgroup 1 tcp port {http,ssh} counter accept
iifgroup gt 2 counter accept

etc.
&lt;/pre&gt;
&lt;p&gt;You can also design the rules to explicitly or implicitly just
block/drop/reject any interface in group 0.

&lt;p&gt;Then in your various interface up and down scripts you use the ip
command to put the interfaces into their groups at the point you
consider them &quot;ready&quot;.

&lt;p&gt;You can even migrate an interface between groups at will. Like maybe
pppX before and after some validation event. (It&#039;s also a good way to do
bad things like redirect a soft PPP link to a login page and then bump
it into full service after the login is validated.)

&lt;p&gt;In general, if you pick the numbers wisely you can get a lot of very
good results with extremely high performance and none of the mess.

&lt;p&gt;ASIDE: Group numbers work equally well in iptables, and I&#039;ve been using
them there for years. I&#039;m still migrating to nft.

&lt;p&gt;It&#039;s also a great help to shutting down or stopping an intrusion and
such since &quot;ip link set group 1 down&quot; closes many doors all at once.

&lt;p&gt;So proper use of interface groups can make things way more simple and
quite a lot faster for your task.
&lt;/blockquote&gt;

&lt;p&gt;Command line lookups:

&lt;blockquote&gt;&lt;pre&gt;
# nft describe tcp dport
payload expression, datatype inet_service (internet network service) (basetype integer), 16 bits

pre-defined symbolic constants (in decimal):
        tcpmux                                             1
        echo                                               7
        discard                                            9
        systat                                            11
        daytime                                           13
        netstat                                           15
        qotd                                              17
        msp                                               18
        chargen                                           19
        ftp-data                                          20
        ftp                                               21
        ssh                                               22
        telnet                                            23
        ...
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;2018/03/29:  from netfilter@vger.kernel.org:
&lt;blockquote&gt;
You can write aliases for networks into /etc/networks and use the
network names in your ruleset.

But note, from a reply:   Alas, that doesn&#039;t work with IPv6. I tried. 
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Sun, 24 Dec 2017 19:00:23 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/874-guid.html</guid>
    
</item>
<item>
    <title>nftables network namespace logging</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/787-nftables-network-namespace-logging.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/787-nftables-network-namespace-logging.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=787</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=787</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;From a recent netfilter mailing list message:

&lt;blockquote&gt;
&lt;p&gt;Logging from network namespaces other than init has been disabled since
kernel 3.10 in order to prevent host kernel log flooding from inside
a container.

&lt;p&gt;If you have kernel &gt;= 4.11 or one with commit 2851940ffee3 (&quot;netfilter:
allow logging from non-init namespaces&quot;) backported, you can enable
netfilter logging from other network namespaces by
&lt;pre&gt;
 echo 1 &gt;/proc/sys/net/netfilter/nf_log_all_netns
&lt;/pre&gt;
&lt;p&gt;(the command must be issued from init_net).

&lt;p&gt;Logging via NFLOG target and ulogd2 should work even without the sysctl
mentioned above, IIRC.
&lt;/blockquote&gt;
 
    </content:encoded>

    <pubDate>Wed, 09 Aug 2017 21:58:10 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/787-guid.html</guid>
    
</item>
<item>
    <title>nftables connection tracking helpers</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/786-nftables-connection-tracking-helpers.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/786-nftables-connection-tracking-helpers.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=786</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=786</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;From the netfilter mailing list:

&lt;blockquote&gt;
&lt;p&gt;... connection tracking helpers assignation can only be used with
nft 0.8 and Linux 4.12.

&lt;p&gt;You can set automatic assignment with:
&lt;pre&gt;echo 1 &gt; /proc/sys/net/netfilter/nf_conntrack_helper 
&lt;/pre&gt;
&lt;/blockquote&gt; 
    </content:encoded>

    <pubDate>Wed, 09 Aug 2017 21:30:59 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/786-guid.html</guid>
    
</item>
<item>
    <title>nftables, strongswan, nat</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/774-nftables,-strongswan,-nat.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/774-nftables,-strongswan,-nat.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=774</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=774</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;Here are some brain triggers for modifications to nftables when working with Strongswan IPSEC policies.  Included are rules for NAT.

&lt;p&gt;&lt;a href=&quot;http://blog.fraggod.net/2016/09/25/nftables-re-injected-ipsec-matching-without-xt_policy.html&quot; target=_blank&gt;fraggod&lt;/a&gt; offered up the secret sauce to work around the lack of a direct replacement of iptables xt_policy module in nftables.

&lt;p&gt;Wiki for nftables says that both nat prerouting and nat postrouting need to be in place in order to ensure connection tracking and nat processing work properly, even if only outbound nat rules or only inbound nat rules are configured
&lt;blockquote&gt;&lt;pre&gt;
add chain ip nat prerouting { type nat hook prerouting priority 0; policy accept; }
add chain ip nat postrouting { type nat hook postrouting priority 0; policy accept; }
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Given that 172.16.6.0/24 is a subnet on the left side to be encrypted, and 172.16.5.0/24 is a subnet on the right side to be encrypted, they need to bypass the nat rules on the edge interface.  The two rules here are for the left hand side.  The accept statement is used to bypass nat.  The masquerade statement will nat everything else from that subnet.  The order of the two rules is important.
&lt;blockquote&gt;&lt;pre&gt;
add rule ip nat postrouting oifname eth0 ip saddr 172.16.6.0/24 ip daddr 172.16.5.0/24 accept
add rule ip nat postrouting oifname eth0 ip saddr 172.16.6.0/24 masquerade
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;IPSEC processing on the receive side is a two stage affair:  decrypt, then normal connection tracking processing.  The idea here is to mark esp packets, the content of which is unknown.  That mark is then used at a later stage to accept the traffic through the connection tracker once decrypted.
&lt;blockquote&gt;&lt;pre&gt;
define markIpsecInput = 0x101
add rule ip filter input ip protocol esp mark set mark or $markIpsecInput
add rule ip filter input mark and $markIpsecInput == $markIpsecInput accept
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;A filter to drop invalid stuff, then to accept established (tcp flag based) and related (special connection tracker modules) traffic.  
&lt;blockquote&gt;&lt;pre&gt;
add rule ip filter input ct state invalid log prefix &quot;BB:ctinput:DROP:&quot; group 0 counter drop
add rule ip filter input ct state established,related counter accept
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Rules are needed for accepting encapsulated traffic:
&lt;blockquote&gt;&lt;pre&gt;
add rule ip filter outside_local udp sport 500 udp dport 500 counter accept
add rule ip filter outside_local udp sport 4500 udp dport 4500 counter accept

add rule ip filter outside_local ip protocol esp counter accept
add rule ip filter outside_local ip protocol ah counter accept
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Other nftables side-tracks:

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes&quot; target=_blank&gt;quick reference&lt;/a&gt;: nftables in 10 minutes
  &lt;li&gt;&lt;a href=&quot;http://git.netfilter.org/nft-sync&quot; target=_blank&gt;nft sync&lt;/a&gt;: redundant firewalls
  &lt;li&gt;&lt;a href=&quot;http://www.netdevconf.org/1.1/proceedings/slides/leblond-longo-suricata-idps-linux.pdf&quot; target=_blank&gt;Suricata IDPS&lt;/a&gt;: Suricata is designed to work with nftables as an IPS via nfqueue drop/accept statements.
  &lt;li&gt;&lt;a href=&quot;http://www.netdevconf.org/1.1/proceedings/slides/garcia-load-banlancing-nftables.pdf&quot; target=_blank&gt;Load Balancing&lt;/a&gt;: notes on using nftables for some load balancing scenarios (compared to iptables and lvs).
  &lt;li&gt;&lt;a href=&quot;http://www.netdevconf.org/1.1/proceedings/slides/pablo-neira-nft-ingress.pdf&quot; target=_blank&gt;nftables from ingress&lt;/a&gt;: has interesting commands and use cases and decision trees
  &lt;li&gt;&lt;a href=&quot;http://www.netdevconf.org/1.1/proceedings/slides/pablo-neira-nft-switchdev.pdf&quot; target=_blank&gt;switchdev&lt;/a&gt; can be used to hardware offload notables rules
  &lt;li&gt;&lt;a href=&quot;https://home.regit.org/2017/07/nftables-port-knocking/&quot; target=_blank&gt;port knocking&lt;/a&gt; with nftables -- no extra user space or kernel space utilities required
  &lt;li&gt;&lt;a href=&quot;https://home.regit.org/netfilter-en/using-nfqueue-and-libnetfilter_queue/&quot; target=_blank&gt;NFQUEUE and libnetfilter_queue&lt;/a&gt;: In userspace, a software must used libnetfilter_queue to connect to queue 0 (the default one) and get the messages from kernel. It then must issue a verdict on the packet.
  &lt;li&gt;&lt;a href=&quot;https://home.regit.org/netfilter-en/secure-use-of-helpers/&quot; target=_blank&gt;Secure use of iptables and connection tracking helpers&lt;/a&gt;: can the rules be ported to nftables?
  &lt;li&gt;2018/04/09 &lt;a href=&quot;https://doc.lagout.org/network/2014_nftables.pdf&quot; target=_blank&gt;nftables, one year later&lt;/a&gt; - written 2014/09/25 - provides some interesting table and related lookup examples
  &lt;/ul&gt; 
    </content:encoded>

    <pubDate>Fri, 21 Jul 2017 14:38:33 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/774-guid.html</guid>
    
</item>
<item>
    <title>nftables rate limit logging and then drop</title>
    <link>http://blog.raymond.burkholder.net/index.php?/archives/670-nftables-rate-limit-logging-and-then-drop.html</link>
            <category>nftables</category>
    
    <comments>http://blog.raymond.burkholder.net/index.php?/archives/670-nftables-rate-limit-logging-and-then-drop.html#comments</comments>
    <wfw:comment>http://blog.raymond.burkholder.net/wfwcomment.php?cid=670</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=670</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    From &lt;a href=&quot;http://www.spinics.net/lists/netfilter/msg56506.html&quot; target=_blank&gt;netfilter mailing list&lt;/a&gt;: 

&lt;p&gt;How do I implement something like this in nftables:
 
&lt;pre&gt;&lt;blockquote&gt;
iptables -A INPUT -m conntrack --ctstate INVALID -m limit --limit 3/m --limit-burst 5 -j LOG --log-level debug --log-prefix &quot;INVALID DROP: &quot;
iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
&lt;/blockquote&gt;&lt;/pre&gt;

The translation is:

&lt;pre&gt;&lt;blockquote&gt;
nft add rule filter input ct state invalid \
        limit rate 3/minute burst 5 packets \
        log level debug prefix \&quot;INVALID DROP: \&quot; counter
nft add rule filter input ct state invalid counter drop
&lt;/blockquote&gt;&lt;/pre&gt;

&lt;p&gt;Note that rule counters are optional in nftables, unlikely iptables
where we always have them on.
 
    </content:encoded>

    <pubDate>Fri, 08 Apr 2016 10:07:03 +0000</pubDate>
    <guid isPermaLink="false">http://blog.raymond.burkholder.net/index.php?/archives/670-guid.html</guid>
    
</item>

</channel>
</rss>
