XTABLES-NFT - Online Linux Manual PageSection : 8
Updated : June 2018

NAMExtables-nft — iptables using nftables kernel api

DESCRIPTIONxtables-nft are versions of iptables that use the nftables API. This is a set of tools to help the system administrator migrate the ruleset from iptables(8), ip6tables(8), arptables(8), and ebtables(8) to nftables(8). The xtables-nft set is composed of several commands: • iptables−nft • iptables−nft−save • iptables−nft−restore • ip6tables−nft • ip6tables−nft−save • ip6tables−nft−restore • arptables−nft • ebtables−nft These tools use the libxtables framework extensions and hook to the nf_tables kernel subsystem using the nft_compat module.

USAGEThe xtables-nft tools allow you to manage the nf_tables backend using the native syntax of iptables(8), ip6tables(8), arptables(8), and ebtables(8). You should use the xtables-nft tools exactly the same way as you would use the corresponding original tools. Adding a rule will result in that rule being added to the nf_tables kernel subsystem instead. Listing the ruleset will use the nf_tables backend as well. When these tools were designed, the main idea was to replace each legacy binary with a symlink to the xtables-nft program, for example: /sbin/iptables -> /usr/sbin/iptables−nft−multi /sbin/ip6tables -> /usr/sbin/ip6tables−nft−multi /sbin/arptables -> /usr/sbin/arptables−nft−multi /sbin/ebtables -> /usr/sbin/ebtables−nft−multiThe iptables version string will indicate whether the legacy API (get/setsockopt) or the new nf_tables api is used: iptables −V iptables v1.7 (nf_tables)

DIFFERENCES TO LEGACY IPTABLESBecause the xtables-nft tools use the nf_tables kernel API, rule additions and deletions are always atomic. Unlike iptables-legacy, iptables-nft −A .. will NOT need to retrieve the current ruleset from the kernel, change it, and re-load the altered ruleset. Instead, iptables-nft will tell the kernel to add one rule. For this reason, the iptables-legacy −−wait option is a no-op in iptables-nft. Use of the xtables-nft tools allow monitoring ruleset changes using the xtables−monitor(8) command. When using −j TRACE to debug packet traversal to the ruleset, note that you will need to use xtables−monitor(8) in −−trace mode to obtain monitoring trace events.

EXAMPLESOne basic example is creating the skeleton ruleset in nf_tables from the xtables-nft tools, in a fresh machine: root@machine:~# iptables−nft −L [...] root@machine:~# ip6tables−nft −L [...] root@machine:~# arptables−nft −L [...] root@machine:~# ebtables−nft −L [...] root@machine:~# nft list ruleset table ip filter { chain INPUT { type filter hook input priority 0; policy accept; } chain FORWARD { type filter hook forward priority 0; policy accept; } chain OUTPUT { type filter hook output priority 0; policy accept; } } table ip6 filter { chain INPUT { type filter hook input priority 0; policy accept; } chain FORWARD { type filter hook forward priority 0; policy accept; } chain OUTPUT { type filter hook output priority 0; policy accept; } } table bridge filter { chain INPUT { type filter hook input priority −200; policy accept; } chain FORWARD { type filter hook forward priority −200; policy accept; } chain OUTPUT { type filter hook output priority −200; policy accept; } } table arp filter { chain INPUT { type filter hook input priority 0; policy accept; } chain FORWARD { type filter hook forward priority 0; policy accept; } chain OUTPUT { type filter hook output priority 0; policy accept; } }(please note that in fresh machines, listing the ruleset for the first time results in all tables an chain being created). To migrate your complete filter ruleset, in the case of iptables(8), you would use: root@machine:~# iptables−legacy−save > myruleset # reads from x_tables root@machine:~# iptables−nft−restore myruleset # writes to nf_tablesor root@machine:~# iptables−legacy−save | iptables-translate-restore | lessto see how rules would look like in the nft nft(8) syntax.

LIMITATIONSYou should use Linux kernel >= 4.17. The CLUSTERIP target is not supported. To get up-to-date information about this, please head to http://wiki.nftables.org/.

SEE ALSOnft(8), xtables−translate(8), xtables−monitor(8)

AUTHORSThe nftables framework is written by the Netfilter project (https://www.netfilter.org). This manual page was written by Arturo Borrero Gonzalez <arturo@debian.org> for the Debian project, but may be used by others. This documentation is free/libre under the terms of the GPLv2+.
0
Johanes Gumabo
Data Size   :   13,795 byte
man-ip6tables-nft-restore.8Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 191,633
Visitor ID   :     :  
Visitor IP   :   3.148.108.174   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.