<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://it-arts.net/index.php?action=history&amp;feed=atom&amp;title=NFT_-_Guide</id>
	<title>NFT - Guide - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://it-arts.net/index.php?action=history&amp;feed=atom&amp;title=NFT_-_Guide"/>
	<link rel="alternate" type="text/html" href="https://it-arts.net/index.php?title=NFT_-_Guide&amp;action=history"/>
	<updated>2026-05-02T18:38:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://it-arts.net/index.php?title=NFT_-_Guide&amp;diff=1060&amp;oldid=prev</id>
		<title>Admin: Text replacement - &quot;Category:Wiki&quot; to &quot;Category:Wiki

&#039;&#039;&#039;&#039;&#039;[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]&#039;&#039;&#039;&#039;&#039;
&quot;</title>
		<link rel="alternate" type="text/html" href="https://it-arts.net/index.php?title=NFT_-_Guide&amp;diff=1060&amp;oldid=prev"/>
		<updated>2026-01-17T08:52:34Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;&lt;a href=&quot;/index.php/Category:Wiki&quot; title=&quot;Category:Wiki&quot;&gt;Category:Wiki&lt;/a&gt;&amp;quot; to &amp;quot;&lt;a href=&quot;/index.php/Category:Wiki&quot; title=&quot;Category:Wiki&quot;&gt;Category:Wiki&lt;/a&gt;  &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:52, 17 January 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Wiki]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Wiki]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&#039;&#039;[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]&#039;&#039;&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Organizing Configuration Files ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Organizing Configuration Files ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://it-arts.net/index.php?title=NFT_-_Guide&amp;diff=499&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;Category:Wiki  == Organizing Configuration Files ==  A good practice is to organize `nft` configuration files into logical sections to ensure clarity and maintainability. Avoid putting all rules into a single file. Instead, create different files for different contexts (e.g., input, output, forward, etc.) and then include them in a master configuration file.  Example:  &lt;nowiki&gt; # Main configuration file table inet filter {     include &quot;/etc/nftables/ipv4.rules&quot;     i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://it-arts.net/index.php?title=NFT_-_Guide&amp;diff=499&amp;oldid=prev"/>
		<updated>2025-12-14T08:07:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php/Category:Wiki&quot; title=&quot;Category:Wiki&quot;&gt;Category:Wiki&lt;/a&gt;  == Organizing Configuration Files ==  A good practice is to organize `nft` configuration files into logical sections to ensure clarity and maintainability. Avoid putting all rules into a single file. Instead, create different files for different contexts (e.g., input, output, forward, etc.) and then include them in a master configuration file.  Example:  &amp;lt;nowiki&amp;gt; # Main configuration file table inet filter {     include &amp;quot;/etc/nftables/ipv4.rules&amp;quot;     i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Wiki]]&lt;br /&gt;
&lt;br /&gt;
== Organizing Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
A good practice is to organize `nft` configuration files into logical sections to ensure clarity and maintainability. Avoid putting all rules into a single file. Instead, create different files for different contexts (e.g., input, output, forward, etc.) and then include them in a master configuration file.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
# Main configuration file&lt;br /&gt;
table inet filter {&lt;br /&gt;
    include &amp;quot;/etc/nftables/ipv4.rules&amp;quot;&lt;br /&gt;
    include &amp;quot;/etc/nftables/ipv6.rules&amp;quot;&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This approach allows easy updates and segregation of IPv4 and IPv6 rules.&lt;br /&gt;
&lt;br /&gt;
== Use of Tables, Chains, and Rules ==&lt;br /&gt;
&lt;br /&gt;
When setting up firewall rules, tables, chains, and rules should be logically named to clarify their purpose. Use meaningful names that represent the function of the table or chain, such as `filter`, `nat`, `mangle`, and `security`.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&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;
        iifname lo accept&lt;br /&gt;
        ip protocol icmp accept&lt;br /&gt;
    }&lt;br /&gt;
    chain output {&lt;br /&gt;
        type filter hook output priority 0; policy accept;&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, `input` and `output` chains are set up under the `filter` table, and rules are defined with appropriate conditions and actions.&lt;br /&gt;
&lt;br /&gt;
== Using State Matching for Connections ==&lt;br /&gt;
&lt;br /&gt;
One of the key features in firewall rule configuration is stateful inspection. Ensure that connection tracking is enabled by using the `ct state` match, which can help optimize performance and ensure that return traffic for established connections is properly handled.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
chain input {&lt;br /&gt;
    ct state established,related accept&lt;br /&gt;
    ip protocol tcp dport 22 accept&lt;br /&gt;
    ip protocol icmp accept&lt;br /&gt;
    drop&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This rule allows established or related connections to be accepted without re-checking the connection state for every packet.&lt;br /&gt;
&lt;br /&gt;
== Limiting Rule Scope for Performance ==&lt;br /&gt;
&lt;br /&gt;
A crucial best practice is to limit the scope of rules to the minimum necessary. Avoid overly broad rules that could slow down the system. For example, instead of allowing all traffic on a network interface, define more specific matches for each protocol or port.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
chain input {&lt;br /&gt;
    ip protocol tcp dport 80 accept&lt;br /&gt;
    ip protocol tcp dport 443 accept&lt;br /&gt;
    drop&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By narrowing the scope, the system will process fewer rules, improving performance.&lt;br /&gt;
&lt;br /&gt;
== Logging with Care ==&lt;br /&gt;
&lt;br /&gt;
While logging can be useful for debugging, avoid excessive logging as it can degrade performance and fill up system logs. Only log critical or suspicious traffic and ensure logging is done with specific criteria.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
chain input {&lt;br /&gt;
    ip daddr 192.168.1.10 log prefix &amp;quot;Suspicious IP: &amp;quot;&lt;br /&gt;
    drop&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logging suspicious IP addresses can help identify unauthorized access attempts without overwhelming the system with unnecessary log entries.&lt;br /&gt;
&lt;br /&gt;
== Using Sets for Efficient Matching ==&lt;br /&gt;
&lt;br /&gt;
Sets are a powerful feature of `nft` for managing large numbers of items, such as IP addresses or ports. Use sets when you need to match against many values, as they provide better performance than individual rules.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
set blocked_ips {&lt;br /&gt;
    type ipv4_addr&lt;br /&gt;
    elements = { 192.168.1.100, 192.168.1.101 }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
chain input {&lt;br /&gt;
    ip saddr @blocked_ips drop&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the set `blocked_ips` contains a list of blocked IP addresses. This approach is more efficient than writing individual drop rules for each address.&lt;br /&gt;
&lt;br /&gt;
== Regular Backups of Configuration ==&lt;br /&gt;
&lt;br /&gt;
Always back up your `nft` rules before making changes. You can dump the current rules to a file for safekeeping. This is especially important in production environments.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
nft list ruleset &amp;gt; /etc/nftables/rules.backup&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Regular backups help prevent accidental rule loss and enable easy restoration if issues arise.&lt;br /&gt;
&lt;br /&gt;
== Enable Persistent Configuration ==&lt;br /&gt;
&lt;br /&gt;
Ensure that the firewall configuration persists across system reboots. Most Linux distributions provide a mechanism to automatically apply `nft` rules at boot time. For example, on Debian-based systems, you can save your configuration and ensure it is loaded at boot using the following:&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
nft list ruleset &amp;gt; /etc/nftables.conf&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then enable `nftables` to load this file on boot:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
systemctl enable nftables&lt;br /&gt;
systemctl start nftables&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This ensures that your firewall rules are automatically applied each time the system starts.&lt;br /&gt;
&lt;br /&gt;
== Test Changes in a Staging Environment ==&lt;br /&gt;
&lt;br /&gt;
Before applying firewall changes to production systems, always test them in a controlled environment. Misconfigurations can lead to loss of connectivity or downtime, so it is essential to test all changes thoroughly before implementing them live.&lt;br /&gt;
&lt;br /&gt;
== IPv6 Best Practices ==&lt;br /&gt;
&lt;br /&gt;
When configuring `nft` for IPv6, be sure to include specific rules for handling IPv6 traffic. By default, IPv6 might not be covered by your IPv4 rules.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
table inet filter {&lt;br /&gt;
    chain input {&lt;br /&gt;
        ip6 protocol icmpv6 accept&lt;br /&gt;
        ip6 saddr fe80::/10 accept&lt;br /&gt;
        drop&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This configuration ensures that only essential IPv6 traffic (such as ICMPv6) is allowed, and other traffic is dropped.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Tips ==&lt;br /&gt;
&lt;br /&gt;
In case of connectivity issues, use the `nft` command to diagnose and troubleshoot:&lt;br /&gt;
&lt;br /&gt;
* List the active ruleset to verify the current firewall configuration:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
nft list ruleset&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Check if a specific rule is matched:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
nft monitor&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will display real-time packet flow and help identify where packets are being dropped or accepted.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>