<?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=Hauptmann</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=Hauptmann"/>
	<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php/Special:Contributions/Hauptmann"/>
	<updated>2026-04-05T19:48:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1057</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1057"/>
		<updated>2021-12-08T22:53:28Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: Pages using deprecated source tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following example rulesets have been tested with Linux kernel 4.19 and nftables 1.0.0.&lt;br /&gt;
&lt;br /&gt;
Before you configure your ruleset policy, do not forget to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable IPv4 forwarding in your router or enable it through /etc/sysctl.conf for persistency&lt;br /&gt;
&lt;br /&gt;
= Simple router using ppp interface =&lt;br /&gt;
&lt;br /&gt;
This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Router with LAN and WLAN segments using VLAN interface to the Internet =&lt;br /&gt;
&lt;br /&gt;
A similar example with a Wireless LAN network segment and using a VLAN device to go out to the Internet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_LAN = eth1&lt;br /&gt;
define DEV_WLAN = wlan0&lt;br /&gt;
define DEV_WORLD = eth0.20&lt;br /&gt;
# LAN is 192.168.2.0/24 and WLAN is 192.168.3.0/24, hence 192.168.2.0/23 contains both network segments&lt;br /&gt;
define NET_PRIVATE = 192.168.2.0/23&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport 22 accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_lan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the wired private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_wlan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP and DNS from the private wireless network&lt;br /&gt;
        ip protocol . th dport vmap { udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_LAN : jump inbound_private_lan, $DEV_WLAN : jump inbound_private_wlan }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet: wlan to lan and lan to wlan not allowed&lt;br /&gt;
        meta iifname . meta oifname { $DEV_LAN . $DEV_WORLD, $DEV_WLAN . $DEV_WORLD, $DEV_WORLD . $DEV_LAN, $DEV_WORLD . $DEV_WLAN } accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE meta oifname $DEV_WORLD counter masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_server&amp;diff=1056</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=1056"/>
		<updated>2021-12-08T22:52:23Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: Pages using deprecated source tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s a very basic example for a web server, you can load the ruleset file with &#039;&#039;nft -f&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= nftables.conf =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset                                                                    &lt;br /&gt;
                                                                                 &lt;br /&gt;
table inet firewall {&lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain inbound_ipv4 {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept      &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_ipv6 {                                                         &lt;br /&gt;
        # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
        #&lt;br /&gt;
        icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
                                                                                 &lt;br /&gt;
        # accepting ping (icmpv6-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmpv6 type echo-request limit rate 5/second accept&lt;br /&gt;
    }&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, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop } &lt;br /&gt;
&lt;br /&gt;
        # Allow loopback traffic.&lt;br /&gt;
        iifname lo accept&lt;br /&gt;
&lt;br /&gt;
        # Jump to chain according to layer 3 protocol using a verdict map&lt;br /&gt;
        meta protocol vmap { ip : jump inbound_ipv4, ip6 : jump inbound_ipv6 }&lt;br /&gt;
&lt;br /&gt;
        # Allow SSH on port TCP/22 and allow HTTP(S) TCP/80 and TCP/443&lt;br /&gt;
        # for IPv4 and IPv6.&lt;br /&gt;
        tcp dport { 22, 80, 443} 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; counter drop&lt;br /&gt;
    }                                                                            &lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain forward {                                                              &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;
                                                                                 &lt;br /&gt;
    # no need to define output chain, default policy is accept if undefined.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1055</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1055"/>
		<updated>2021-12-08T22:51:34Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: Pages using deprecated source tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple set of rules that allows you to initiate communications from your workstation to the Internet but restricts any communication initiation to your workstation (that was not initiated by you).&lt;br /&gt;
&lt;br /&gt;
You can load this file with nft -f.&lt;br /&gt;
&lt;br /&gt;
= fw.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv4 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv6 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
For dual-stack IPv4/IPv6 workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise IPv6 connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1054</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1054"/>
		<updated>2021-12-08T22:45:43Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* Router with LAN and WLAN segments using VLAN interface to the Internet */ counter is dup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following example rulesets have been tested with Linux kernel 4.19 and nftables 1.0.0.&lt;br /&gt;
&lt;br /&gt;
Before you configure your ruleset policy, do not forget to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable IPv4 forwarding in your router or enable it through /etc/sysctl.conf for persistency&lt;br /&gt;
&lt;br /&gt;
= Simple router using ppp interface =&lt;br /&gt;
&lt;br /&gt;
This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Router with LAN and WLAN segments using VLAN interface to the Internet =&lt;br /&gt;
&lt;br /&gt;
A similar example with a Wireless LAN network segment and using a VLAN device to go out to the Internet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_LAN = eth1&lt;br /&gt;
define DEV_WLAN = wlan0&lt;br /&gt;
define DEV_WORLD = eth0.20&lt;br /&gt;
# LAN is 192.168.2.0/24 and WLAN is 192.168.3.0/24, hence 192.168.2.0/23 contains both network segments&lt;br /&gt;
define NET_PRIVATE = 192.168.2.0/23&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport 22 accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_lan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the wired private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_wlan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP and DNS from the private wireless network&lt;br /&gt;
        ip protocol . th dport vmap { udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_LAN : jump inbound_private_lan, $DEV_WLAN : jump inbound_private_wlan }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet: wlan to lan and lan to wlan not allowed&lt;br /&gt;
        meta iifname . meta oifname { $DEV_LAN . $DEV_WORLD, $DEV_WLAN . $DEV_WORLD, $DEV_WORLD . $DEV_LAN, $DEV_WORLD . $DEV_WLAN } accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE meta oifname $DEV_WORLD counter masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1033</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1033"/>
		<updated>2021-09-06T21:36:08Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: getestet mit Kernel 4.19 und nftables 1.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following example rulesets have been tested with Linux kernel 4.19 and nftables 1.0.0.&lt;br /&gt;
&lt;br /&gt;
Before you configure your ruleset policy, do not forget to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable IPv4 forwarding in your router or enable it through /etc/sysctl.conf for persistency&lt;br /&gt;
&lt;br /&gt;
= Simple router using ppp interface =&lt;br /&gt;
&lt;br /&gt;
This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Router with LAN and WLAN segments using VLAN interface to the Internet =&lt;br /&gt;
&lt;br /&gt;
A similar example with a Wireless LAN network segment and using a VLAN device to go out to the Internet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_LAN = eth1&lt;br /&gt;
define DEV_WLAN = wlan0&lt;br /&gt;
define DEV_WORLD = eth0.20&lt;br /&gt;
# LAN is 192.168.2.0/24 and WLAN is 192.168.3.0/24, hence 192.168.2.0/23 contains both network segments&lt;br /&gt;
define NET_PRIVATE = 192.168.2.0/23&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport 22 accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_lan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the wired private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_wlan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP and DNS from the private wireless network&lt;br /&gt;
        ip protocol . th dport vmap { udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_LAN : jump inbound_private_lan, $DEV_WLAN : jump inbound_private_wlan }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet: wlan to lan and lan to wlan not allowed&lt;br /&gt;
        meta iifname . meta oifname { $DEV_LAN . $DEV_WORLD, $DEV_WLAN . $DEV_WORLD, $DEV_WORLD . $DEV_LAN, $DEV_WORLD . $DEV_WLAN } accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE counter oifname $DEV_WORLD counter masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1032</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1032"/>
		<updated>2021-09-06T21:32:34Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* Router with LAN and WLAN segments using VLAN interface to the Internet */ ein Kommentar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before you configure your ruleset policy, do not forget to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable IPv4 forwarding in your router or enable it through /etc/sysctl.conf for persistency&lt;br /&gt;
&lt;br /&gt;
= Simple router using ppp interface =&lt;br /&gt;
&lt;br /&gt;
This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Router with LAN and WLAN segments using VLAN interface to the Internet =&lt;br /&gt;
&lt;br /&gt;
A similar example with a Wireless LAN network segment and using a VLAN device to go out to the Internet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_LAN = eth1&lt;br /&gt;
define DEV_WLAN = wlan0&lt;br /&gt;
define DEV_WORLD = eth0.20&lt;br /&gt;
# LAN is 192.168.2.0/24 and WLAN is 192.168.3.0/24, hence 192.168.2.0/23 contains both network segments&lt;br /&gt;
define NET_PRIVATE = 192.168.2.0/23&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport 22 accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_lan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the wired private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private_wlan {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP and DNS from the private wireless network&lt;br /&gt;
        ip protocol . th dport vmap { udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_LAN : jump inbound_private_lan, $DEV_WLAN : jump inbound_private_wlan }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet: wlan to lan and lan to wlan not allowed&lt;br /&gt;
        meta iifname . meta oifname { $DEV_LAN . $DEV_WORLD, $DEV_WLAN . $DEV_WORLD, $DEV_WORLD . $DEV_LAN, $DEV_WORLD . $DEV_WLAN } accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE counter oifname $DEV_WORLD counter masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1031</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1031"/>
		<updated>2021-09-06T21:26:57Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: add another example with WLAN&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before you configure your ruleset policy, do not forget to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable IPv4 forwarding in your router or enable it through /etc/sysctl.conf for persistency&lt;br /&gt;
&lt;br /&gt;
= Simple router using ppp interface =&lt;br /&gt;
&lt;br /&gt;
This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Router with LAN and WLAN segments using VLAN interface to the Internet =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_LAN = eth1&lt;br /&gt;
define DEV_WLAN = wlan0&lt;br /&gt;
define DEV_WORLD = eth0.20&lt;br /&gt;
define NET_PRIVATE = 192.168.2.0/23&lt;br /&gt;
&lt;br /&gt;
table ip global {&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport 22 accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_LAN : jump inbound_private, $DEV_WLAN : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet: wlan to lan and lan to wlan not allowed&lt;br /&gt;
        meta iifname . meta oifname { $DEV_LAN . $DEV_WORLD, $DEV_WLAN . $DEV_WORLD, $DEV_WORLD . $DEV_LAN, $DEV_WORLD . $DEV_WLAN } accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE counter oifname $DEV_WORLD counter masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_server&amp;diff=1016</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=1016"/>
		<updated>2021-08-11T07:33:13Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: remove burst, not required&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s a very basic example for a web server, you can load the ruleset file with &#039;&#039;nft -f&#039;&#039;.&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;
flush ruleset                                                                    &lt;br /&gt;
                                                                                 &lt;br /&gt;
table inet firewall {&lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain inbound_ipv4 {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept      &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_ipv6 {                                                         &lt;br /&gt;
        # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
        #&lt;br /&gt;
        icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
                                                                                 &lt;br /&gt;
        # accepting ping (icmpv6-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmpv6 type echo-request limit rate 5/second accept&lt;br /&gt;
    }&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, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop } &lt;br /&gt;
&lt;br /&gt;
        # Allow loopback traffic.&lt;br /&gt;
        iifname lo accept&lt;br /&gt;
&lt;br /&gt;
        # Jump to chain according to layer 3 protocol using a verdict map&lt;br /&gt;
        meta protocol vmap { ip : jump inbound_ipv4, ip6 : jump inbound_ipv6 }&lt;br /&gt;
&lt;br /&gt;
        # Allow SSH on port TCP/22 and allow HTTP(S) TCP/80 and TCP/443&lt;br /&gt;
        # for IPv4 and IPv6.&lt;br /&gt;
        tcp dport { 22, 80, 443} 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; counter drop&lt;br /&gt;
    }                                                                            &lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain forward {                                                              &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;
                                                                                 &lt;br /&gt;
    # no need to define output chain, default policy is accept if undefined.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1015</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1015"/>
		<updated>2021-08-11T06:40:53Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: ip_forward sysctl&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do not forget to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to enable IPv4 forwarding in your router or enable it through /etc/sysctl.conf for persistency&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1014</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1014"/>
		<updated>2021-08-11T06:38:18Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: remove IPSec rules&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1013</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1013"/>
		<updated>2021-08-11T06:30:22Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: dhcp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow IPSec&lt;br /&gt;
        udp dport 500 accept&lt;br /&gt;
        ip protocol { esp, ah } accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow DHCP, DNS and SSH from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept, udp . 67 : accept}&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1012</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1012"/>
		<updated>2021-08-11T06:26:27Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: missing Klammer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow IPSec&lt;br /&gt;
        udp dport 500 accept&lt;br /&gt;
        ip protocol { esp, ah } accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH and DNS from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1011</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1011"/>
		<updated>2021-08-11T06:25:04Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This example shows the configuration of an IPv4-only home router using a ppp interface to go out to the Internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow IPSec&lt;br /&gt;
        udp dport 500 accept&lt;br /&gt;
        ip protocol { esp, ah } accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from some well-known internet host&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        icmp type echo-request limit rate 5/second accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH and DNS from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1010</id>
		<title>Simple ruleset for a home router</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_home_router&amp;diff=1010"/>
		<updated>2021-08-11T06:17:56Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
define DEV_PRIVATE = eth1&lt;br /&gt;
define DEV_WORLD = ppp0&lt;br /&gt;
define NET_PRIVATE = 192.168.0.0/16&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
&lt;br /&gt;
    chain inbound_world {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second burst 5 packets accept&lt;br /&gt;
&lt;br /&gt;
        # allow IPSec&lt;br /&gt;
        udp dport 500 accept&lt;br /&gt;
        ip protocol { esp, ah } accept&lt;br /&gt;
&lt;br /&gt;
        # allow SSH connections from the private network and from some&lt;br /&gt;
        # well-known internet hosts&lt;br /&gt;
        ip saddr 81.209.165.42 tcp dport ssh accept&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_private {&lt;br /&gt;
        # allow SSH and DNS from the private network&lt;br /&gt;
        ip protocol . th dport vmap { tcp . 22 : accept, udp . 53 : accept, tcp . 53 : accept }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain input {&lt;br /&gt;
        type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # allow loopback traffic, anything else jump to chain for further evaluation&lt;br /&gt;
        iifname vmap { lo : accept, $DEV_WORLD : jump inbound_world, $DEV_PRIVATE : jump inbound_private }&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain forward {&lt;br /&gt;
        type filter hook forward priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
        # Allow traffic from established and related packets, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop }&lt;br /&gt;
&lt;br /&gt;
        # connections from the internal net to the internet or to other&lt;br /&gt;
        # internal nets are allowed&lt;br /&gt;
        iifname $DEV_PRIVATE accept&lt;br /&gt;
&lt;br /&gt;
        # the rest is dropped by the above policy&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain postrouting {&lt;br /&gt;
        type nat hook postrouting priority 100; policy accept;&lt;br /&gt;
&lt;br /&gt;
        # masquerade private IP addresses&lt;br /&gt;
        ip saddr $NET_PRIVATE oifname $DEV_WORLD masquerade&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Main_Page&amp;diff=1009</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=1009"/>
		<updated>2021-08-11T06:15:17Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* Examples */&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;
&lt;br /&gt;
= [[News]] =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
* [[What is nftables?]]&lt;br /&gt;
* [[How to obtain help/support]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
* [https://www.netfilter.org/projects/nftables/manpage.html man nft - netfilter website]&lt;br /&gt;
* [https://www.mankier.com/8/nft man nft - mankier.com]&lt;br /&gt;
* [[Quick reference-nftables in 10 minutes|Quick reference, nftables in 10 minutes]]&lt;br /&gt;
* [[Netfilter hooks]] and nftables integration with existing Netfilter components&lt;br /&gt;
* [[nftables families|Understanding nftables families]]&lt;br /&gt;
* [[Data_types|Data types]]&lt;br /&gt;
* [[Connection_Tracking_System|Connection tracking system (conntrack)]], used for stateful firewalling and NAT&lt;br /&gt;
* [[Troubleshooting|Troubleshooting and FAQ]]&lt;br /&gt;
* [[Further_documentation|Additional documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing nftables =&lt;br /&gt;
* [[nftables from distributions|Using nftables from distributions]]&lt;br /&gt;
* [[Building and installing nftables from sources]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Upgrading from xtables to nftables =&lt;br /&gt;
* [[Legacy xtables tools]]&lt;br /&gt;
* [[Moving from iptables to nftables]]&lt;br /&gt;
* [[Moving from ipset to nftables]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Basic operation =&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;
* [[Output text modifiers]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Expressions: Matching packets =&lt;br /&gt;
* [[Matching packet metainformation]]&lt;br /&gt;
* [[Matching packet headers]]&lt;br /&gt;
* [[Matching connection tracking stateful metainformation]]&lt;br /&gt;
* [[Matching routing information]]&lt;br /&gt;
* [[Rate limiting matchings]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Statements: Acting on packet matches =&lt;br /&gt;
* [[Accepting and dropping packets]]&lt;br /&gt;
* [[Rejecting traffic]]&lt;br /&gt;
* [[Jumping to chain]]&lt;br /&gt;
* [[Counters]]&lt;br /&gt;
* [[Logging traffic]]&lt;br /&gt;
* [[Performing Network Address Translation (NAT)]]&lt;br /&gt;
* [[Setting packet metainformation]]&lt;br /&gt;
* [[Setting packet connection tracking metainformation]]&lt;br /&gt;
* [[Mangling packet headers]] (including stateless NAT)&lt;br /&gt;
* [[Duplicating packets]]&lt;br /&gt;
* [[Load balancing]]&lt;br /&gt;
* [[Queueing to userspace]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Advanced data structures for performance packet classification =&lt;br /&gt;
* [[Intervals]]&lt;br /&gt;
* [[Concatenations]]&lt;br /&gt;
* [[Math operations]]&lt;br /&gt;
* [[Stateful objects]]&lt;br /&gt;
** [[Counters]]&lt;br /&gt;
** [[Quotas]]&lt;br /&gt;
** [[Limits]]&lt;br /&gt;
** [[Connlimits]] (&#039;&#039;ct count&#039;&#039;)&lt;br /&gt;
* Other objects&lt;br /&gt;
** [[Conntrack helpers]] (&#039;&#039;ct helper&#039;&#039;, Layer 7 ALG)&lt;br /&gt;
** [[Ct_timeout|Conntrack timeout policies]] (&#039;&#039;ct timeout&#039;&#039;)&lt;br /&gt;
** [[Ct_expectation|Conntrack expectations]] (&#039;&#039;ct expectation&#039;&#039;)&lt;br /&gt;
** [[Synproxy]]&lt;br /&gt;
** [[Secmark|Secmarks]]&lt;br /&gt;
* Generic set infrastructure&lt;br /&gt;
** [[Sets]]&lt;br /&gt;
** [[Element timeouts]]&lt;br /&gt;
** [[Updating sets from the packet path]]&lt;br /&gt;
** [[Maps]]&lt;br /&gt;
** [[Verdict_Maps_(vmaps) | Verdict maps]]&lt;br /&gt;
** [[Meters|Metering]] (formerly known as flow tables before nftables 0.8.1)&lt;br /&gt;
* [[Flowtables]] (the fastpath network stack bypass)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
* [[Simple ruleset for a workstation]]&lt;br /&gt;
* [[Simple ruleset for a server]]&lt;br /&gt;
* [[Simple ruleset for a home router]]&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;
* [[List of updates in the nft command line tool]]&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;
&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=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;
Watch videos to track updates:&lt;br /&gt;
&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=qXVOA2MKA1s Netdev 2.1 - Netfilter mini-workshop (2017)]&lt;br /&gt;
* Watch [https://youtu.be/iCj10vEKPrw Netdev 2.2 - Netf‌ilter mini-workshop (2018)]&lt;br /&gt;
* Watch [https://youtu.be/0hqfzp6tpZo Netdev 0x12 - Netf‌ilter mini-workshop (2019)]&lt;br /&gt;
* Watch [https://www.youtube.com/watch?v=GqGGo4svj7s&amp;amp;feature=youtu.be Netdev 0x14 - Netfilter mini-Workshop (2020)] &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;
* Article [https://ral-arturo.org/2020/11/22/python-nftables-tutorial.html How to use nftables from python] and git repository [https://github.com/aborrero/python-nftables-tutorial python-nftables-tutorial.git]&lt;br /&gt;
&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>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_server&amp;diff=1008</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=1008"/>
		<updated>2021-08-11T05:25:29Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* nftables.conf */ no echo-request in neighbour discovery rule&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s a very basic example for a web server, you can load the ruleset file with &#039;&#039;nft -f&#039;&#039;.&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;
flush ruleset                                                                    &lt;br /&gt;
                                                                                 &lt;br /&gt;
table inet firewall {&lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain inbound_ipv4 {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second burst 5 packets accept      &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_ipv6 {                                                         &lt;br /&gt;
        # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
        #&lt;br /&gt;
        icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
                                                                                 &lt;br /&gt;
        # accepting ping (icmpv6-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmpv6 type echo-request limit rate 5/second burst 5 packets accept&lt;br /&gt;
    }&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, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop } &lt;br /&gt;
&lt;br /&gt;
        # Allow loopback traffic.&lt;br /&gt;
        iifname lo accept&lt;br /&gt;
&lt;br /&gt;
        # Jump to chain according to layer 3 protocol using a verdict map&lt;br /&gt;
        meta protocol vmap { ip : jump inbound_ipv4, ip6 : jump inbound_ipv6 }&lt;br /&gt;
&lt;br /&gt;
        # Allow SSH on port TCP/22 and allow HTTP(S) TCP/80 and TCP/443&lt;br /&gt;
        # for IPv4 and IPv6.&lt;br /&gt;
        tcp dport { 22, 80, 443} 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; counter drop&lt;br /&gt;
    }                                                                            &lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain forward {                                                              &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;
                                                                                 &lt;br /&gt;
    # no need to define output chain, default policy is accept if undefined.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_server&amp;diff=1007</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=1007"/>
		<updated>2021-08-11T05:23:36Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s a very basic example for a web server, you can load the ruleset file with &#039;&#039;nft -f&#039;&#039;.&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;
flush ruleset                                                                    &lt;br /&gt;
                                                                                 &lt;br /&gt;
table inet firewall {&lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain inbound_ipv4 {&lt;br /&gt;
        # accepting ping (icmp-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmp type echo-request limit rate 5/second burst 5 packets accept      &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    chain inbound_ipv6 {                                                         &lt;br /&gt;
        # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
        #&lt;br /&gt;
        icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
                                                                                 &lt;br /&gt;
        # accepting ping (icmpv6-echo-request) for diagnostic purposes.&lt;br /&gt;
        # However, it also lets probes discover this host is alive.&lt;br /&gt;
        # This sample accepts them within a certain rate limit:&lt;br /&gt;
        #&lt;br /&gt;
        # icmpv6 type echo-request limit rate 5/second burst 5 packets accept&lt;br /&gt;
    }&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, drop invalid&lt;br /&gt;
        ct state vmap { established : accept, related : accept, invalid : drop } &lt;br /&gt;
&lt;br /&gt;
        # Allow loopback traffic.&lt;br /&gt;
        iifname lo accept&lt;br /&gt;
&lt;br /&gt;
        # Jump to chain according to layer 3 protocol using a verdict map&lt;br /&gt;
        meta protocol vmap { ip : jump inbound_ipv4, ip6 : jump inbound_ipv6 }&lt;br /&gt;
&lt;br /&gt;
        # Allow SSH on port TCP/22 and allow HTTP(S) TCP/80 and TCP/443&lt;br /&gt;
        # for IPv4 and IPv6.&lt;br /&gt;
        tcp dport { 22, 80, 443} 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; counter drop&lt;br /&gt;
    }                                                                            &lt;br /&gt;
                                                                                 &lt;br /&gt;
    chain forward {                                                              &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;
                                                                                 &lt;br /&gt;
    # no need to define output chain, default policy is accept if undefined.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1006</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1006"/>
		<updated>2021-08-11T05:14:56Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: add flush ruleset&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple set of rules that allows you to initiate communications from your workstation to the Internet but restricts any communication initiation to your workstation (that was not initiated by you).&lt;br /&gt;
&lt;br /&gt;
You can load this file with nft -f.&lt;br /&gt;
&lt;br /&gt;
= fw.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv4 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv6 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
For dual-stack IPv4/IPv6 workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flush ruleset&lt;br /&gt;
&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise IPv6 connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1005</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1005"/>
		<updated>2021-08-11T05:12:51Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: use policy and more comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very simple set of rules that allows you to initiate communications from your workstation to the Internet but restricts any communication initiation to your workstation (that was not initiated by you).&lt;br /&gt;
&lt;br /&gt;
= fw.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv4 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv6 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
For dual-stack IPv4/IPv6 workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0; policy drop;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise IPv6 connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1004</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1004"/>
		<updated>2021-08-11T05:08:15Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= fw.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv4 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
&lt;br /&gt;
          # count and drop any other traffic&lt;br /&gt;
          counter drop&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
For IPv6 only workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
For dual-stack IPv4/IPv6 workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise IPv6 connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1003</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1003"/>
		<updated>2021-08-11T04:42:20Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* fw.basic */ not here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= fw.basic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
&lt;br /&gt;
          # count and drop any other traffic&lt;br /&gt;
          counter drop&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
The inet table is available from Linux kernel 3.14 and allow to use a dual-stack IPv4/IPv6 table. There is mostly a&lt;br /&gt;
single change compared to previous ruleset which is the &#039;&#039;inet&#039;&#039; keyword.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 ip6 nexthdr icmpv6 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1002</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1002"/>
		<updated>2021-08-11T04:41:07Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* fw.basic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= fw.basic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
&lt;br /&gt;
          # accepting ping (icmp-echo-request) can be nice for diagnostic purposes.&lt;br /&gt;
          # However, it also lets probes discover this host is alive.&lt;br /&gt;
          # This sample accepts them within a certain rate limit:&lt;br /&gt;
          #&lt;br /&gt;
          # icmp type echo-request limit rate 5/second packets accept&lt;br /&gt;
&lt;br /&gt;
          # examples for opening service-specific ports:&lt;br /&gt;
          # ct state new tcp dport 22 accept&lt;br /&gt;
          # ct state new tcp dport { 80,443 } accept&lt;br /&gt;
&lt;br /&gt;
          # count and drop any other traffic&lt;br /&gt;
          counter drop&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
The inet table is available from Linux kernel 3.14 and allow to use a dual-stack IPv4/IPv6 table. There is mostly a&lt;br /&gt;
single change compared to previous ruleset which is the &#039;&#039;inet&#039;&#039; keyword.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 ip6 nexthdr icmpv6 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1001</id>
		<title>Simple ruleset for a workstation</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Simple_ruleset_for_a_workstation&amp;diff=1001"/>
		<updated>2021-08-11T04:39:25Z</updated>

		<summary type="html">&lt;p&gt;Hauptmann: /* fw.basic */ von https://github.com/QueuingKoala/netfilter-samples/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= fw.basic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip filter {&lt;br /&gt;
     chain input {&lt;br /&gt;
          type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
          # accept traffic originated from us&lt;br /&gt;
          ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
          # accept any localhost traffic&lt;br /&gt;
          iif lo accept&lt;br /&gt;
&lt;br /&gt;
          # Accepting ping (icmp-echo-request) can be nice for diagnostic purposes.&lt;br /&gt;
          # However, it also lets probes discover this host is alive.&lt;br /&gt;
          # This sample accepts them within a certain rate limit:&lt;br /&gt;
          # icmp type echo-request limit rate 5/second packets accept&lt;br /&gt;
&lt;br /&gt;
          # count and drop any other traffic&lt;br /&gt;
          counter drop&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw6.basic =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table ip6 filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= fw.inet.basic =&lt;br /&gt;
&lt;br /&gt;
The inet table is available from Linux kernel 3.14 and allow to use a dual-stack IPv4/IPv6 table. There is mostly a&lt;br /&gt;
single change compared to previous ruleset which is the &#039;&#039;inet&#039;&#039; keyword.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
table inet filter {&lt;br /&gt;
        chain input {&lt;br /&gt;
                 type filter hook input priority 0;&lt;br /&gt;
&lt;br /&gt;
                 # accept any localhost traffic&lt;br /&gt;
                 iif lo accept&lt;br /&gt;
&lt;br /&gt;
                 # accept traffic originated from us&lt;br /&gt;
                 ct state established,related accept&lt;br /&gt;
&lt;br /&gt;
                 # accept neighbour discovery otherwise connectivity breaks&lt;br /&gt;
                 ip6 nexthdr icmpv6 icmpv6 type { nd-neighbor-solicit, echo-request, nd-router-advert, nd-neighbor-advert } accept&lt;br /&gt;
&lt;br /&gt;
                 # count and drop any other traffic&lt;br /&gt;
                 counter drop&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hauptmann</name></author>
	</entry>
</feed>