<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.nftables.org/wiki-nftables/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Glloyd</id>
	<title>nftables wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.nftables.org/wiki-nftables/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Glloyd"/>
	<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php/Special:Contributions/Glloyd"/>
	<updated>2026-05-12T13:35:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Talk:Rate_limiting_matchings&amp;diff=508</id>
		<title>Talk:Rate limiting matchings</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Talk:Rate_limiting_matchings&amp;diff=508"/>
		<updated>2020-06-16T18:51:41Z</updated>

		<summary type="html">&lt;p&gt;Glloyd: Adding some questions on ICMP, IGMP, and rate limiting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(1) I&#039;m not an expert so more examples on rate-limited ICMP rules would be very helpful.&lt;br /&gt;
&lt;br /&gt;
(2) Which ICMP packet types should be allowed?  All?  Or only certain types?&lt;br /&gt;
&lt;br /&gt;
(3) Is IGMP ok to allow all packets on?&lt;br /&gt;
&lt;br /&gt;
I&#039;ve seen rules like this but I don&#039;t know enough to understand what the impact would be. I also don&#039;t fully understand what &#039;meta l4proto&#039; is doing (From ArchWiki: https://wiki.archlinux.org/index.php/Nftables)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
meta l4proto ipv6-icmp icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-reduction, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept comment &amp;quot;Accept ICMPv6&amp;quot;&lt;br /&gt;
&lt;br /&gt;
meta l4proto icmp icmp type { destination-unreachable, router-solicitation, router-advertisement, time-exceeded, parameter-problem } accept comment &amp;quot;Accept ICMP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ip protocol igmp accept comment &amp;quot;Accept IGMP&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Glloyd</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Main_Page&amp;diff=507</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Main_Page&amp;diff=507"/>
		<updated>2020-06-16T18:04:46Z</updated>

		<summary type="html">&lt;p&gt;Glloyd: Add server example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the &#039;&#039;nftables&#039;&#039; HOWTO documentation page. Here you will find documentation on how to build, install, configure and use nftables.&lt;br /&gt;
&lt;br /&gt;
If you have any suggestion to improve it, please send your comments to Netfilter users mailing list &amp;lt;netfilter@vger.kernel.org&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
* [[What is nftables?]]&lt;br /&gt;
* [[Why nftables?]]&lt;br /&gt;
* [[Main differences with iptables]]&lt;br /&gt;
* [[Netfilter hooks]] and integration with existing Netfilter components.&lt;br /&gt;
* [[Adoption]]&lt;br /&gt;
* [[Legacy xtables tools]]&lt;br /&gt;
* [[How to obtain help/support]]&lt;br /&gt;
&lt;br /&gt;
= Getting started =&lt;br /&gt;
&lt;br /&gt;
* [[Building and installing nftables from sources]]&lt;br /&gt;
* Using [[nftables from distributions]]&lt;br /&gt;
* [[Troubleshooting|Troubleshooting and FAQ]]&lt;br /&gt;
* [[Quick reference-nftables in 10 minutes|Quick reference, nftables in 10 minutes]]&lt;br /&gt;
* [[nftables families|Understanding nftables families]]&lt;br /&gt;
&lt;br /&gt;
= Basic operation =&lt;br /&gt;
&lt;br /&gt;
* [[Configuring tables]]&lt;br /&gt;
* [[Configuring chains]]&lt;br /&gt;
* [[Simple rule management]]&lt;br /&gt;
* [[Atomic rule replacement]]&lt;br /&gt;
* [[Error reporting from the command line]]&lt;br /&gt;
* [[Building rules through expressions]]&lt;br /&gt;
* [[Operations at ruleset level]]&lt;br /&gt;
* [[Monitoring ruleset updates]]&lt;br /&gt;
* [[Scripting]]&lt;br /&gt;
* [[Ruleset debug/tracing]]&lt;br /&gt;
* [[Moving from iptables to nftables]]&lt;br /&gt;
* [[Moving from ipset to nftables]]&lt;br /&gt;
&lt;br /&gt;
= Supported selectors for packet matching =&lt;br /&gt;
&lt;br /&gt;
* [[Matching packet header fields]]&lt;br /&gt;
* [[Matching packet metainformation]]&lt;br /&gt;
* [[Matching connection tracking stateful metainformation]]&lt;br /&gt;
* [[Rate limiting matchings]]&lt;br /&gt;
* [[Routing information]]&lt;br /&gt;
&lt;br /&gt;
= Possible actions on packets =&lt;br /&gt;
&lt;br /&gt;
* [[Accepting and dropping packets]]&lt;br /&gt;
* [[Jumping to chain]]&lt;br /&gt;
* [[Rejecting traffic]]&lt;br /&gt;
* [[Logging traffic]]&lt;br /&gt;
* [[Performing Network Address Translation (NAT)]]&lt;br /&gt;
* [[Setting packet metainformation]]&lt;br /&gt;
* [[Queueing to userspace]]&lt;br /&gt;
* [[Duplicating packets]]&lt;br /&gt;
* [[Mangle packet header fields]]&lt;br /&gt;
* [[Mangle TCP options]]&lt;br /&gt;
* [[Counters]]&lt;br /&gt;
* [[Load balancing]]&lt;br /&gt;
* [[Setting packet connection tracking metainformation]]&lt;br /&gt;
&lt;br /&gt;
Note that, unlike &#039;&#039;iptables&#039;&#039;, you can perform several actions in one single rule.&lt;br /&gt;
&lt;br /&gt;
= Advanced data structures for performance packet classification =&lt;br /&gt;
&lt;br /&gt;
You will have to redesign your rule-set to benefit from these new nice features:&lt;br /&gt;
&lt;br /&gt;
* [[Sets]]&lt;br /&gt;
* [[Dictionaries]]&lt;br /&gt;
* [[Intervals]]&lt;br /&gt;
* [[Maps]]&lt;br /&gt;
* [[Concatenations]]&lt;br /&gt;
* [[Meters|Metering]] (formerly known as flow tables before nftables 0.8.1 release)&lt;br /&gt;
* [[Updating sets from the packet path]]&lt;br /&gt;
* [[Element timeouts]]&lt;br /&gt;
* [[Math operations]]&lt;br /&gt;
* [[Stateful objects]]&lt;br /&gt;
* [[Flowtable]] (the fastpath network stack bypass)&lt;br /&gt;
&lt;br /&gt;
If you are already using [[ipset]] in your &#039;&#039;iptables&#039;&#039; rule-set, that transition may be a bit more simple to you.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
* [[Simple ruleset for a workstation]]&lt;br /&gt;
* [[Simple ruleset for a server]]&lt;br /&gt;
* [[Bridge filtering]]&lt;br /&gt;
* [[Multiple NATs using nftables maps]]&lt;br /&gt;
* [[Classic perimetral firewall example]]&lt;br /&gt;
* [[Port knocking example]]&lt;br /&gt;
* [[Classification to tc structure example]]&lt;br /&gt;
* [[Using configuration management systems]] (like puppet, ansible, etc)&lt;br /&gt;
* [[GeoIP matching]]&lt;br /&gt;
&lt;br /&gt;
= Development =&lt;br /&gt;
&lt;br /&gt;
Check [[Portal:DeveloperDocs|Portal:DeveloperDocs - documentation for netfilter developers]].&lt;br /&gt;
&lt;br /&gt;
Some hints on the general development progress:&lt;br /&gt;
&lt;br /&gt;
* [[List of updates since Linux kernel 3.13]]&lt;br /&gt;
* [[Supported features compared to xtables|Supported features compared to {ip,ip6,eb,arp}tables]]&lt;br /&gt;
* [[List of available translations via iptables-translate tool]]&lt;br /&gt;
&lt;br /&gt;
= External links =&lt;br /&gt;
&lt;br /&gt;
Watch some videos:&lt;br /&gt;
&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=FXTRRwXi3b4 Getting a grasp of nftables], thanks to [https://www.nluug.nl/index-en.html NLUUG association] for recording this.&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=CaYp0d2wiuU#t=1m47s The ultimate packet classifier for GNU/Linux], thanks to the FSFE for paying my trip to Barcelona and for recommending me as speaker to the KDE Spanish branch.&lt;br /&gt;
* [https://www.youtube.com/watch?v=Sy0JDX451ns Florian Westphal - Why nftables?]&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=qXVOA2MKA1s Netdev 2.1 - Netfilter workshop]&lt;br /&gt;
* Watch [https://youtu.be/iCj10vEKPrw Netdev 2.2 - Netf‌ilter mini-workshop]&lt;br /&gt;
* Watch [https://youtu.be/0hqfzp6tpZo Netdev 0x12 - Netf‌ilter mini-workshop]&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=0wQfSfDVN94 NLUUG - Goodbye iptables, Hello nftables]&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=Uf5ULkEWPL0 LCA2018 - nftables from a user perspective]&lt;br /&gt;
&lt;br /&gt;
Additional documentations and articles:&lt;br /&gt;
&lt;br /&gt;
* Tutorial [https://zasdfgbnm.github.io/2017/09/07/Extending-nftables/ Extending nftables by Xiang Gao]&lt;br /&gt;
* Article [http://ral-arturo.org/2017/05/05/debian-stretch-stable-nftables.html New in Debian stable Stretch: nftables]&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
To the NLnet foundation for initial sponsorship of this HOWTO:&lt;br /&gt;
&lt;br /&gt;
[https://nlnet.nl https://nlnet.nl/image/logo.gif]&lt;br /&gt;
&lt;br /&gt;
To Eric Leblond, for boostrapping the [https://home.regit.org/netfilter-en/nftables-quick-howto/ Nftables quick howto] in 2013.&lt;/div&gt;</summary>
		<author><name>Glloyd</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_server&amp;diff=506</id>
		<title>Simple ruleset for a server</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_server&amp;diff=506"/>
		<updated>2020-06-16T18:03:56Z</updated>

		<summary type="html">&lt;p&gt;Glloyd: Create page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s a very basic example of the nftables.conf file you might use on a web server.  In this example, we have the option to block off all incoming traffic from the server except from &amp;quot;safe&amp;quot; IP ranges. This is handy if your server is behind CloudFlare, Sucuri, or other similar traffic filtering services.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initially, this conf allows all inbound traffic until you comment/uncomment the &amp;quot;From approved IP ranges only&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
= nftables.conf =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/sbin/nft -f&lt;br /&gt;
&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
# List all IPs and IP ranges of your traffic filtering proxy source.&lt;br /&gt;
define SAFE_TRAFFIC_IPS = {&lt;br /&gt;
    x.x.x.x/xx,&lt;br /&gt;
    x.x.x.x/xx,&lt;br /&gt;
    x.x.x.x,&lt;br /&gt;
    x.x.x.x&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table inet firewall {&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
&lt;br /&gt;
    	# By default, drop all traffic unless it meets a filter&lt;br /&gt;
    	# criteria specified by the rules that follow below.&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets.&lt;br /&gt;
        ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
        # Drop invalid packets.&lt;br /&gt;
        ct state invalid drop&lt;br /&gt;
&lt;br /&gt;
        # Allow loopback traffic.&lt;br /&gt;
        iifname lo accept&lt;br /&gt;
&lt;br /&gt;
        # Allow all ICMP and IGMP traffic, but enforce a rate limit&lt;br /&gt;
        # to help prevent some types of flood attacks.&lt;br /&gt;
        ip protocol icmp limit rate 4/second accept&lt;br /&gt;
        ip6 nexthdr ipv6-icmp limit rate 4/second accept&lt;br /&gt;
        ip protocol igmp limit rate 4/second accept&lt;br /&gt;
&lt;br /&gt;
        # Allow SSH on port 22.&lt;br /&gt;
        tcp dport 22 accept&lt;br /&gt;
&lt;br /&gt;
        # Allow HTTP(S).&lt;br /&gt;
        # -- From anywhere&lt;br /&gt;
        tcp dport { http, https } accept&lt;br /&gt;
        udp dport { http, https } accept&lt;br /&gt;
        # -- From approved IP ranges only&lt;br /&gt;
        # tcp dport { http, https } ip saddr $SAFE_TRAFFIC_IPS accept&lt;br /&gt;
        # udp dport { http, https } ip saddr $SAFE_TRAFFIC_IPS accept&lt;br /&gt;
&lt;br /&gt;
        # Uncomment to allow incoming traffic on other ports.&lt;br /&gt;
        # -- Allow Jekyll dev traffic on port 4000.&lt;br /&gt;
        # tcp dport 4000 accept&lt;br /&gt;
        # -- Allow Hugo dev traffic on port 1313.&lt;br /&gt;
        # tcp dport 1313 accept&lt;br /&gt;
&lt;br /&gt;
        # Uncomment to enable logging of denied inbound traffic&lt;br /&gt;
        # log prefix &amp;quot;[nftables] Inbound Denied: &amp;quot; flags all counter drop&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
&lt;br /&gt;
        # Drop everything (assumes this device is not a router)&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Uncomment to enable logging of denied forwards&lt;br /&gt;
        # log prefix &amp;quot;[nftables] Forward Denied: &amp;quot; flags all counter drop&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain outbound {&lt;br /&gt;
&lt;br /&gt;
        # Allow all outbound traffic&lt;br /&gt;
        type filter hook output priority 0; policy accept;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Glloyd</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Sets&amp;diff=505</id>
		<title>Sets</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Sets&amp;diff=505"/>
		<updated>2020-06-16T17:50:04Z</updated>

		<summary type="html">&lt;p&gt;Glloyd: Add set syntax and examples for nftables.conf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;nftables&#039;&#039; comes with a built-in generic set infrastructure that allows you to use &#039;&#039;&#039;any&#039;&#039;&#039; supported selector to build sets. This infrastructure makes possible the representation of [[dictionaries]] and [[maps]].&lt;br /&gt;
&lt;br /&gt;
The set elements are internally represented using performance data structures such as hashtables and red-black trees.&lt;br /&gt;
&lt;br /&gt;
= Anonymous sets =&lt;br /&gt;
&lt;br /&gt;
Anonymous sets are those that are:&lt;br /&gt;
&lt;br /&gt;
* Bound to a rule, if the rule is removed, that set is released too.&lt;br /&gt;
* They have no specific name, the kernel internally allocates an identifier.&lt;br /&gt;
* They cannot be updated. So you cannot add and delete elements from it once it is bound to a rule.&lt;br /&gt;
&lt;br /&gt;
The following example shows how to create a simple set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add rule ip filter output tcp dport { 22, 23 } counter&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule above catches all traffic going to TCP ports 22 and 23, in case of matching the counters are updated.&lt;br /&gt;
&lt;br /&gt;
Eric Leblond in his [https://home.regit.org/2014/01/why-you-will-love-nftables/ Why you will love nftables] article shows a very simple example to compare iptables with nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ip6tables -A INPUT -p tcp -m multiport --dports 23,80,443 -j ACCEPT&lt;br /&gt;
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT&lt;br /&gt;
ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT&lt;br /&gt;
ip6tables -A INPUT -p icmpv6 --icmpv6-type router-advertisement -j ACCEPT&lt;br /&gt;
ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which can be expressed in &#039;&#039;nftables&#039;&#039; with a couple of rules that provide a set:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add rule ip6 filter input tcp dport {telnet, http, https} accept&lt;br /&gt;
% nft add rule ip6 filter input icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Named sets =&lt;br /&gt;
&lt;br /&gt;
You can create the named sets with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add set ip filter blackhole { type ipv4_addr\;}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;blackhole&#039;&#039; is the name of the set in this case. The &#039;&#039;type&#039;&#039; option indicates the data type that this set stores, which is an IPv4 address in this case. Current maximum name length is 16 characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add element ip filter blackhole { 192.168.3.4 }&lt;br /&gt;
% nft add element ip filter blackhole { 192.168.1.4, 192.168.1.5 }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can use it from the rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add rule ip filter input ip saddr @blackhole drop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Named sets can be updated anytime, so you can add and delete element from them.&lt;br /&gt;
&lt;br /&gt;
== nftables.conf syntax ==&lt;br /&gt;
&lt;br /&gt;
When working with nftables.conf, you can define sets in a number of ways. You can then reference those sets later on using &amp;lt;code&amp;gt;$VARIABLE_NAME&amp;lt;/code&amp;gt; notation.&lt;br /&gt;
&lt;br /&gt;
Here are some examples showing sets defined in one line, spanning multiple lines, and sets referencing other sets. The set is then used in a rule to allow incoming traffic from certain IP ranges.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
define SIMPLE_SET = { 192.168.1.1, 192.168.1.2 }&lt;br /&gt;
&lt;br /&gt;
define CDN_EDGE = {&lt;br /&gt;
    192.168.1.1,&lt;br /&gt;
    192.168.1.2,&lt;br /&gt;
    192.168.1.3,&lt;br /&gt;
    10.0.0.0/8&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define CDN_MONITORS = {&lt;br /&gt;
    192.168.1.10,&lt;br /&gt;
    192.168.1.20&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
define CDN = {&lt;br /&gt;
    $CDN_EDGE,&lt;br /&gt;
    $CDN_MONITORS&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Allow HTTP(S) from approved IP ranges only&lt;br /&gt;
tcp dport { http, https } ip saddr $CDN accept&lt;br /&gt;
udp dport { http, https } ip saddr $CDN accept&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Named sets specifications =&lt;br /&gt;
&lt;br /&gt;
Sets specifications are:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;type&#039;&#039;&#039;, is obligatory and determines the data type of the set elements. Supported data types currently are:&lt;br /&gt;
** &#039;&#039;ipv4_addr&#039;&#039;: IPv4 address&lt;br /&gt;
** &#039;&#039;ipv6_addr&#039;&#039;: IPv6 address.&lt;br /&gt;
** &#039;&#039;ether_addr&#039;&#039;: Ethernet address.&lt;br /&gt;
** &#039;&#039;inet_proto&#039;&#039;: Inet protocol type.&lt;br /&gt;
** &#039;&#039;inet_service&#039;&#039;: Internet service (read tcp port for example)&lt;br /&gt;
** &#039;&#039;mark&#039;&#039;: Mark type.&lt;br /&gt;
** &#039;&#039;ifname&#039;&#039;: Network interface name (eth0, eth1..)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;timeout&#039;&#039;&#039;, it determines how long an element stays in the set. The time string respects the format: &#039;&#039;&amp;quot;v&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;dv&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;hv&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;mv&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;s&amp;quot;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add table ip filter&lt;br /&gt;
% nft add set ip filter ports {type inet_service \; timeout 3h45s \;}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These commands create a table named &#039;&#039;filter&#039;&#039; and add a set named &#039;&#039;ports&#039;&#039; to it, where elements are deleted after 3 hours and 45 seconds of being added.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;flags&#039;&#039;&#039;, the available flags are:&lt;br /&gt;
** &#039;&#039;constant&#039;&#039; - set content may not change while bound&lt;br /&gt;
** &#039;&#039;interval&#039;&#039; - set contains intervals&lt;br /&gt;
** &#039;&#039;timeout&#039;&#039; - elements can be added with a timeout&lt;br /&gt;
&lt;br /&gt;
Multiple flags should be separated by comma:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add set ip filter flags_set {type ipv4_addr\; flags constant, interval\;}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;gc-interval&#039;&#039;&#039;, stands for garbage collection interval, can only be used if &#039;&#039;timeout&#039;&#039; or &#039;&#039;flags timeout&#039;&#039; are active. The interval follows the same format of &#039;&#039;timeouts&#039;&#039; time string &#039;&#039;&amp;quot;v&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;dv&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;hv&amp;lt;sub&amp;gt;3&amp;lt;/sub&amp;gt;mv&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;s&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;elements&#039;&#039;&#039;, initialize the set with some elements in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add set ip filter daddrs {type ipv4_addr \; flags timeout \; elements={192.168.1.1 timeout 10s, 192.168.1.2 timeout 30s} \;}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command creates a set name &#039;&#039;daddrs&#039;&#039; with elements &#039;&#039;192.168.1.1&#039;&#039;, which stays in it for 10s, and &#039;&#039;192.168.1.2&#039;&#039;, which stays for 30s.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;size&#039;&#039;&#039;, limits the maximum number of elements of the set. To create a set with maximum 2 elements type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft add set ip filter saddrs {type ipv4_addr \; size 2 \;}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;policy&#039;&#039;&#039;, determines set selection policy. Available values are:&lt;br /&gt;
** &#039;&#039;performance&#039;&#039; [default]&lt;br /&gt;
** &#039;&#039;memory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Listing named sets =&lt;br /&gt;
&lt;br /&gt;
You can list the content of a named set via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft list set ip filter myset&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Glloyd</name></author>
	</entry>
</feed>