<?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=Arushi</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=Arushi"/>
	<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php/Special:Contributions/Arushi"/>
	<updated>2026-04-11T09:07:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Moving_from_iptables_to_nftables&amp;diff=323</id>
		<title>Moving from iptables to nftables</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Moving_from_iptables_to_nftables&amp;diff=323"/>
		<updated>2018-06-14T15:29:48Z</updated>

		<summary type="html">&lt;p&gt;Arushi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A common situation is the need to move from an existing iptables ruleset to nftables.&lt;br /&gt;
The Netfilter team has created some tools and mechanisms to ease in this move.&lt;br /&gt;
&lt;br /&gt;
Please, make sure to check the links below:&lt;br /&gt;
* [[Supported features compared to xtables]]&lt;br /&gt;
* [[List of available translations via iptables-translate tool]]&lt;br /&gt;
&lt;br /&gt;
After the migration process, you are encouraged to implement new nftables mechanisms such as sets, maps, dictionaries, concatenations and more. &lt;br /&gt;
&lt;br /&gt;
== command translation ==&lt;br /&gt;
&lt;br /&gt;
You can generate a translation of an iptables/ip6tables command to know the nftables equivalent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% iptables-translate -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT&lt;br /&gt;
nft add rule ip filter INPUT tcp dport 22 ct state new counter accept&lt;br /&gt;
&lt;br /&gt;
% ip6tables-translate -A FORWARD -i eth0 -o eth3 -p udp -m multiport --dports 111,222 -j ACCEPT&lt;br /&gt;
nft add rule ip6 filter FORWARD iifname eth0 oifname eth3 meta l4proto udp udp dport { 111,222} counter accept&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of translating command by command, you can translate your whole ruleset in a single run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% iptables-save &amp;gt; save.txt&lt;br /&gt;
% cat save.txt&lt;br /&gt;
# Generated by iptables-save v1.6.0 on Sat Dec 24 14:26:40 2016&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [5166:1752111]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [5058:628693]&lt;br /&gt;
-A FORWARD -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT&lt;br /&gt;
COMMIT&lt;br /&gt;
# Completed on Sat Dec 24 14:26:40 2016&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% iptables-restore-translate -f save.txt&lt;br /&gt;
# Translated by iptables-restore-translate v1.6.0 on Sat Dec 24 14:26:59 2016&lt;br /&gt;
add table ip filter&lt;br /&gt;
add chain ip filter INPUT { type filter hook input priority 0; }&lt;br /&gt;
add chain ip filter FORWARD { type filter hook forward priority 0; }&lt;br /&gt;
add chain ip filter OUTPUT { type filter hook output priority 0; }&lt;br /&gt;
add rule ip filter FORWARD tcp dport 22 ct state new counter accept&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be able to directly give this to nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% iptables-restore-translate -f save.txt &amp;gt; ruleset.nft&lt;br /&gt;
% nft -f ruleset.nft&lt;br /&gt;
&lt;br /&gt;
% nft list ruleset&lt;br /&gt;
table ip filter {&lt;br /&gt;
	chain INPUT {&lt;br /&gt;
		type filter hook input priority 0; policy accept;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	chain FORWARD {&lt;br /&gt;
		type filter hook forward priority 0; policy accept;&lt;br /&gt;
		tcp dport ssh ct state new counter packets 0 bytes 0 accept&lt;br /&gt;
	}&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;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These translate tools are included in the iptables source tarball and works for iptables and ip6tables.&lt;br /&gt;
&lt;br /&gt;
== using the nf_tables compat backend ==&lt;br /&gt;
&lt;br /&gt;
There is support to use the iptables/ip6tables/arptables/ebtables old syntax with the nf_tables kernel backend.&lt;br /&gt;
You will need the *-compat tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% iptables-compat -A FORWARD -p icmp -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
% iptables-compat-save &lt;br /&gt;
# Generated by xtables-save v1.6.0 on Sat Dec 24 14:38:08 2016&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [62:3777]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [62:4074]&lt;br /&gt;
-A FORWARD -p icmp -j ACCEPT&lt;br /&gt;
COMMIT&lt;br /&gt;
# Completed on Sat Dec 24 14:38:08 2016&lt;br /&gt;
&lt;br /&gt;
% nft list ruleset&lt;br /&gt;
table ip filter {&lt;br /&gt;
	chain INPUT {&lt;br /&gt;
		type filter hook input priority 0; policy accept;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	chain FORWARD {&lt;br /&gt;
		type filter hook forward priority 0; policy accept;&lt;br /&gt;
		ip protocol icmp counter packets 0 bytes 0 accept&lt;br /&gt;
	}&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;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that translation to native nftables syntax is done if available.&lt;br /&gt;
&lt;br /&gt;
In the case of some missing translation, you will see a commented rule in nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% ebtables-compat -L&lt;br /&gt;
Bridge table: filter&lt;br /&gt;
&lt;br /&gt;
Bridge chain: INPUT, entries: 0, policy: ACCEPT&lt;br /&gt;
&lt;br /&gt;
Bridge chain: FORWARD, entries: 2, policy: ACCEPT&lt;br /&gt;
--802_3-type 0x0001 -j CONTINUE&lt;br /&gt;
--mark 0x1 -j CONTINUE&lt;br /&gt;
&lt;br /&gt;
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT&lt;br /&gt;
&lt;br /&gt;
% nft list ruleset&lt;br /&gt;
table bridge filter {&lt;br /&gt;
	chain INPUT {&lt;br /&gt;
		type filter hook input priority -200; policy accept;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	chain FORWARD {&lt;br /&gt;
		type filter hook forward priority -200; policy accept;&lt;br /&gt;
		#--802_3-type 0x0001  counter packets 0 bytes 0&lt;br /&gt;
		#--mark 0x1  counter packets 0 bytes 0&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	chain OUTPUT {&lt;br /&gt;
		type filter hook output priority -200; policy accept;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With these tools, the workflow could be saving the old iptables ruleset and then loading it with iptables-compat:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
% iptables-save  &amp;gt; iptables.txt&lt;br /&gt;
% iptables-compat-restore &amp;lt; iptables.txt&lt;br /&gt;
&lt;br /&gt;
% iptables-compat-save &lt;br /&gt;
# Generated by xtables-save v1.6.0 on Sat Dec 24 14:51:41 2016&lt;br /&gt;
*filter&lt;br /&gt;
:INPUT ACCEPT [19:1283]&lt;br /&gt;
:FORWARD ACCEPT [0:0]&lt;br /&gt;
:OUTPUT ACCEPT [18:2487]&lt;br /&gt;
-A FORWARD -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT&lt;br /&gt;
COMMIT&lt;br /&gt;
# Completed on Sat Dec 24 14:51:41 2016&lt;br /&gt;
&lt;br /&gt;
% nft list ruleset&lt;br /&gt;
table ip filter {&lt;br /&gt;
	chain INPUT {&lt;br /&gt;
		type filter hook input priority 0; policy accept;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	chain FORWARD {&lt;br /&gt;
		type filter hook forward priority 0; policy accept;&lt;br /&gt;
		ip protocol tcp tcp dport 22 ct state new counter packets 0 bytes 0 accept&lt;br /&gt;
	}&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;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beware of using both the compat and the standard tool at the same time. That means using both x_tables and nf_tables kernel subsystems at the same time, and could lead to unexpected results.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Moving from ipset to nftables]]&lt;/div&gt;</summary>
		<author><name>Arushi</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=129</id>
		<title>Building and installing nftables from sources</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=129"/>
		<updated>2017-03-30T17:10:11Z</updated>

		<summary type="html">&lt;p&gt;Arushi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;nftables requires several userspace libraries, the &#039;nft&#039; userspace command line utility and the kernel modules.&lt;br /&gt;
&lt;br /&gt;
If you are using a major linux distribution, you may consider using [[nftables from distributions]].&lt;br /&gt;
&lt;br /&gt;
= Installing userspace libraries =&lt;br /&gt;
&lt;br /&gt;
You have to install the following userspace libraries:&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libmnl libmnl ], this library provides the interfaces to communicate kernel and userspace via Netlink. &#039;&#039;It is very likely that your distribution already provides a package for libmnl that you can use&#039;&#039;. If you decide to use your distributor package, make sure you install the development package as well.&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libnftnl libnftnl] (formerly known as libnftables), this library provides the low-level API to transform netlink messages to objects.&lt;br /&gt;
&lt;br /&gt;
You also need &#039;&#039;libgmp&#039;&#039; and &#039;&#039;libreadline&#039;&#039;, most distributions already provide packages for these two libraries, so make sure you install the development extensions of this packages to successfully compile &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you plan to give a test to &#039;&#039;nftables&#039;&#039;, we recommend you to use git snapshots for &#039;&#039;libnftnl&#039;&#039; and &#039;&#039;nft&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from git ==&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;libnftnl&#039;&#039;, to can type these magic spells:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.netfilter.org/libnftnl&lt;br /&gt;
$ cd libnftnl&lt;br /&gt;
$ sh autogen.sh&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you are working behind proxy than it might possible that you are not able to clone using git protocol so try to clone using &amp;quot;http/https:&amp;quot; instead &amp;quot;git:&amp;quot;&lt;br /&gt;
&amp;lt;br &amp;gt; Reasons:- 1) The git protocol, by default, uses the port 9418. It might possible that your traffic is blocked on that port.&lt;br /&gt;
&amp;lt;br &amp;gt; 2) Also take help and can relate from the [http://stackoverflow.com/a/28494985 solution] &lt;br /&gt;
&lt;br /&gt;
If you have any compilation problem, please report them to the [https://www.netfilter.org/mailinglists.html netfilter developer mailing list] providing as much detailed information as possible.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from snapshots ==&lt;br /&gt;
&lt;br /&gt;
You can retrieve daily snapshots of this library from the [ftp://ftp.netfilter.org/pub/libnftnl/snapshot/ Netfilter FTP]. Then, to install it you have to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget ftp://ftp.netfilter.org/pub/libnftnl/snapshot/libnftnl-20140217.tar.bz2&lt;br /&gt;
$ tar xvjf libnftnl-20140217.tar.bz2&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing userspace nft command line utility =&lt;br /&gt;
&lt;br /&gt;
This is the command line utility that provides a user interface to configure &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
Just type these commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% git clone git://git.netfilter.org/nftables&lt;br /&gt;
% cd nftables&lt;br /&gt;
% sh autogen.sh&lt;br /&gt;
% ./configure&lt;br /&gt;
% make&lt;br /&gt;
% make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should check that &#039;&#039;nft&#039;&#039; is installed in your system by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft&lt;br /&gt;
nft: no command specified&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means &#039;&#039;nft&#039;&#039; has been correctly installed.&lt;br /&gt;
&lt;br /&gt;
= Installing Linux kernel with nftables support =&lt;br /&gt;
&lt;br /&gt;
Prerequisites: nftables is available in Linux kernels since version 3.13 but this is software under development, so we encourage you to run the latest stable kernel.&lt;br /&gt;
&lt;br /&gt;
== Validating your installation ==&lt;br /&gt;
&lt;br /&gt;
You can validate that your installation is working by checking if you can install the &#039;nf_tables&#039; kernel module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can check that&#039;s actually there via &#039;&#039;lsmod&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables              42349  0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dmesg should show the following message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% dmesg&lt;br /&gt;
...&lt;br /&gt;
[13939.468020] nf_tables: (c) 2007-2009 Patrick McHardy &amp;lt;kaber@trash.net&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you also have loaded the family support, eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;lsmod&#039;&#039; command should show something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables_ipv4         12869  0 &lt;br /&gt;
nf_tables              42349  1 nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other family modules are &#039;&#039;nf_tables_ipv6&#039;&#039;, &#039;&#039;nf_tables_bridge&#039;&#039;, &#039;&#039;nf_tables_arp&#039;&#039; and (since Linux kernel &amp;gt;= 3.14) &#039;&#039;nf_tables_inet&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These modules provide the corresponding [[Configuring_tables|table]] and the filter [[Configuring_chains|chain]] support for the given family.&lt;br /&gt;
&lt;br /&gt;
You could also check which modules are supported by your current kernel. How to to do this, depends on your distro:&lt;br /&gt;
* on debian, look in /boot/config-XXX-YYY, where XXX is your kernel package version, and YYY is your arch, e.g. /boot/config-4.2.0-1-amd64&lt;br /&gt;
* on Arch, look in /proc/config.gz. As this is compressed, use a command such as zcat or zgrep.&lt;br /&gt;
&lt;br /&gt;
In the debian example below, CONFIG_NFT_REDIR_IPV4 and CONFIG_NFT_REDIR_IPV6 are not set, so you can&#039;t use [http://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Redirect redirect] in the ruleset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% grep CONFIG_NFT_ /boot/config-4.2.0-1-amd64&lt;br /&gt;
CONFIG_NFT_EXTHDR=m&lt;br /&gt;
CONFIG_NFT_META=m&lt;br /&gt;
CONFIG_NFT_CT=m&lt;br /&gt;
CONFIG_NFT_RBTREE=m&lt;br /&gt;
CONFIG_NFT_HASH=m&lt;br /&gt;
CONFIG_NFT_COUNTER=m&lt;br /&gt;
CONFIG_NFT_LOG=m&lt;br /&gt;
CONFIG_NFT_LIMIT=m&lt;br /&gt;
CONFIG_NFT_MASQ=m&lt;br /&gt;
CONFIG_NFT_REDIR=m&lt;br /&gt;
CONFIG_NFT_NAT=m&lt;br /&gt;
CONFIG_NFT_QUEUE=m&lt;br /&gt;
CONFIG_NFT_REJECT=m&lt;br /&gt;
CONFIG_NFT_REJECT_INET=m&lt;br /&gt;
CONFIG_NFT_COMPAT=m&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV4=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV4=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV4=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV4=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV4 is not set&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV6=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV6=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV6=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV6=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV6 is not set&lt;br /&gt;
CONFIG_NFT_BRIDGE_META=m&lt;br /&gt;
CONFIG_NFT_BRIDGE_REJECT=m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
This is slower as you will retrieve the Linux kernel git tree for nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After retrieving the git tree, you have to follow the same steps that described in the installation from sources.&lt;br /&gt;
&lt;br /&gt;
But you will get the most recent changes for the &#039;&#039;nftables&#039;&#039; kernel code there.&lt;br /&gt;
&lt;br /&gt;
When configuring the kernel, be sure to enable all the nftables modules (choose &#039;m&#039; or &#039;y&#039;). This is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ make oldconfig&lt;br /&gt;
&lt;br /&gt;
Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES) [M/y/?] m&lt;br /&gt;
Netfilter nf_tables support (NF_TABLES) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables payload module (NFT_PAYLOAD) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables IPv6 exthdr module (NFT_EXTHDR) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables meta module (NFT_META) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables conntrack module (NFT_CT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables rbtree set module (NFT_RBTREE) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables hash set module (NFT_HASH) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables counter module (NFT_COUNTER) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables log module (NFT_LOG) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables limit module (NFT_LIMIT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables nat module (NFT_NAT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter x_tables over nf_tables module (NFT_COMPAT) [N/m/?] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv4 nf_tables support (NF_TABLES_IPV4) [N/m] (NEW) m&lt;br /&gt;
  nf_tables IPv4 reject support (NFT_REJECT_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables nat chain support (NFT_CHAIN_NAT_IPV4) [N/m] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv6 nf_tables support (NF_TABLES_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables nat chain support (NFT_CHAIN_NAT_IPV6) [M/n] m&lt;br /&gt;
&lt;br /&gt;
Ethernet Bridge nf_tables support (NF_TABLES_BRIDGE) [N/m/y] (NEW) m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arushi</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=128</id>
		<title>Building and installing nftables from sources</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=128"/>
		<updated>2017-03-30T17:08:22Z</updated>

		<summary type="html">&lt;p&gt;Arushi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;nftables requires several userspace libraries, the &#039;nft&#039; userspace command line utility and the kernel modules.&lt;br /&gt;
&lt;br /&gt;
If you are using a major linux distribution, you may consider using [[nftables from distributions]].&lt;br /&gt;
&lt;br /&gt;
= Installing userspace libraries =&lt;br /&gt;
&lt;br /&gt;
You have to install the following userspace libraries:&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libmnl libmnl ], this library provides the interfaces to communicate kernel and userspace via Netlink. &#039;&#039;It is very likely that your distribution already provides a package for libmnl that you can use&#039;&#039;. If you decide to use your distributor package, make sure you install the development package as well.&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libnftnl libnftnl] (formerly known as libnftables), this library provides the low-level API to transform netlink messages to objects.&lt;br /&gt;
&lt;br /&gt;
You also need &#039;&#039;libgmp&#039;&#039; and &#039;&#039;libreadline&#039;&#039;, most distributions already provide packages for these two libraries, so make sure you install the development extensions of this packages to successfully compile &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you plan to give a test to &#039;&#039;nftables&#039;&#039;, we recommend you to use git snapshots for &#039;&#039;libnftnl&#039;&#039; and &#039;&#039;nft&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from git ==&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;libnftnl&#039;&#039;, to can type these magic spells:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.netfilter.org/libnftnl&lt;br /&gt;
$ cd libnftnl&lt;br /&gt;
$ sh autogen.sh&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you are working behind proxy than it might possible that you are not able to clone using git protocol so try to clone using &amp;quot;http/https:&amp;quot; instead &amp;quot;git:&amp;quot;&lt;br /&gt;
Reasons:- 1) The git protocol, by default, uses the port 9418. It might possible that your traffic is blocked on that port.&lt;br /&gt;
2) Also take help and can relate from the [http://stackoverflow.com/a/28494985 solution] &lt;br /&gt;
&lt;br /&gt;
If you have any compilation problem, please report them to the [https://www.netfilter.org/mailinglists.html netfilter developer mailing list] providing as much detailed information as possible.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from snapshots ==&lt;br /&gt;
&lt;br /&gt;
You can retrieve daily snapshots of this library from the [ftp://ftp.netfilter.org/pub/libnftnl/snapshot/ Netfilter FTP]. Then, to install it you have to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget ftp://ftp.netfilter.org/pub/libnftnl/snapshot/libnftnl-20140217.tar.bz2&lt;br /&gt;
$ tar xvjf libnftnl-20140217.tar.bz2&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing userspace nft command line utility =&lt;br /&gt;
&lt;br /&gt;
This is the command line utility that provides a user interface to configure &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
Just type these commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% git clone git://git.netfilter.org/nftables&lt;br /&gt;
% cd nftables&lt;br /&gt;
% sh autogen.sh&lt;br /&gt;
% ./configure&lt;br /&gt;
% make&lt;br /&gt;
% make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should check that &#039;&#039;nft&#039;&#039; is installed in your system by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft&lt;br /&gt;
nft: no command specified&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means &#039;&#039;nft&#039;&#039; has been correctly installed.&lt;br /&gt;
&lt;br /&gt;
= Installing Linux kernel with nftables support =&lt;br /&gt;
&lt;br /&gt;
Prerequisites: nftables is available in Linux kernels since version 3.13 but this is software under development, so we encourage you to run the latest stable kernel.&lt;br /&gt;
&lt;br /&gt;
== Validating your installation ==&lt;br /&gt;
&lt;br /&gt;
You can validate that your installation is working by checking if you can install the &#039;nf_tables&#039; kernel module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can check that&#039;s actually there via &#039;&#039;lsmod&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables              42349  0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dmesg should show the following message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% dmesg&lt;br /&gt;
...&lt;br /&gt;
[13939.468020] nf_tables: (c) 2007-2009 Patrick McHardy &amp;lt;kaber@trash.net&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you also have loaded the family support, eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;lsmod&#039;&#039; command should show something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables_ipv4         12869  0 &lt;br /&gt;
nf_tables              42349  1 nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other family modules are &#039;&#039;nf_tables_ipv6&#039;&#039;, &#039;&#039;nf_tables_bridge&#039;&#039;, &#039;&#039;nf_tables_arp&#039;&#039; and (since Linux kernel &amp;gt;= 3.14) &#039;&#039;nf_tables_inet&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These modules provide the corresponding [[Configuring_tables|table]] and the filter [[Configuring_chains|chain]] support for the given family.&lt;br /&gt;
&lt;br /&gt;
You could also check which modules are supported by your current kernel. How to to do this, depends on your distro:&lt;br /&gt;
* on debian, look in /boot/config-XXX-YYY, where XXX is your kernel package version, and YYY is your arch, e.g. /boot/config-4.2.0-1-amd64&lt;br /&gt;
* on Arch, look in /proc/config.gz. As this is compressed, use a command such as zcat or zgrep.&lt;br /&gt;
&lt;br /&gt;
In the debian example below, CONFIG_NFT_REDIR_IPV4 and CONFIG_NFT_REDIR_IPV6 are not set, so you can&#039;t use [http://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Redirect redirect] in the ruleset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% grep CONFIG_NFT_ /boot/config-4.2.0-1-amd64&lt;br /&gt;
CONFIG_NFT_EXTHDR=m&lt;br /&gt;
CONFIG_NFT_META=m&lt;br /&gt;
CONFIG_NFT_CT=m&lt;br /&gt;
CONFIG_NFT_RBTREE=m&lt;br /&gt;
CONFIG_NFT_HASH=m&lt;br /&gt;
CONFIG_NFT_COUNTER=m&lt;br /&gt;
CONFIG_NFT_LOG=m&lt;br /&gt;
CONFIG_NFT_LIMIT=m&lt;br /&gt;
CONFIG_NFT_MASQ=m&lt;br /&gt;
CONFIG_NFT_REDIR=m&lt;br /&gt;
CONFIG_NFT_NAT=m&lt;br /&gt;
CONFIG_NFT_QUEUE=m&lt;br /&gt;
CONFIG_NFT_REJECT=m&lt;br /&gt;
CONFIG_NFT_REJECT_INET=m&lt;br /&gt;
CONFIG_NFT_COMPAT=m&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV4=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV4=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV4=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV4=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV4 is not set&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV6=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV6=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV6=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV6=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV6 is not set&lt;br /&gt;
CONFIG_NFT_BRIDGE_META=m&lt;br /&gt;
CONFIG_NFT_BRIDGE_REJECT=m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
This is slower as you will retrieve the Linux kernel git tree for nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After retrieving the git tree, you have to follow the same steps that described in the installation from sources.&lt;br /&gt;
&lt;br /&gt;
But you will get the most recent changes for the &#039;&#039;nftables&#039;&#039; kernel code there.&lt;br /&gt;
&lt;br /&gt;
When configuring the kernel, be sure to enable all the nftables modules (choose &#039;m&#039; or &#039;y&#039;). This is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ make oldconfig&lt;br /&gt;
&lt;br /&gt;
Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES) [M/y/?] m&lt;br /&gt;
Netfilter nf_tables support (NF_TABLES) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables payload module (NFT_PAYLOAD) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables IPv6 exthdr module (NFT_EXTHDR) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables meta module (NFT_META) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables conntrack module (NFT_CT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables rbtree set module (NFT_RBTREE) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables hash set module (NFT_HASH) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables counter module (NFT_COUNTER) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables log module (NFT_LOG) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables limit module (NFT_LIMIT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables nat module (NFT_NAT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter x_tables over nf_tables module (NFT_COMPAT) [N/m/?] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv4 nf_tables support (NF_TABLES_IPV4) [N/m] (NEW) m&lt;br /&gt;
  nf_tables IPv4 reject support (NFT_REJECT_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables nat chain support (NFT_CHAIN_NAT_IPV4) [N/m] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv6 nf_tables support (NF_TABLES_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables nat chain support (NFT_CHAIN_NAT_IPV6) [M/n] m&lt;br /&gt;
&lt;br /&gt;
Ethernet Bridge nf_tables support (NF_TABLES_BRIDGE) [N/m/y] (NEW) m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arushi</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=127</id>
		<title>Building and installing nftables from sources</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=127"/>
		<updated>2017-03-30T17:08:01Z</updated>

		<summary type="html">&lt;p&gt;Arushi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;nftables requires several userspace libraries, the &#039;nft&#039; userspace command line utility and the kernel modules.&lt;br /&gt;
&lt;br /&gt;
If you are using a major linux distribution, you may consider using [[nftables from distributions]].&lt;br /&gt;
&lt;br /&gt;
= Installing userspace libraries =&lt;br /&gt;
&lt;br /&gt;
You have to install the following userspace libraries:&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libmnl libmnl ], this library provides the interfaces to communicate kernel and userspace via Netlink. &#039;&#039;It is very likely that your distribution already provides a package for libmnl that you can use&#039;&#039;. If you decide to use your distributor package, make sure you install the development package as well.&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libnftnl libnftnl] (formerly known as libnftables), this library provides the low-level API to transform netlink messages to objects.&lt;br /&gt;
&lt;br /&gt;
You also need &#039;&#039;libgmp&#039;&#039; and &#039;&#039;libreadline&#039;&#039;, most distributions already provide packages for these two libraries, so make sure you install the development extensions of this packages to successfully compile &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you plan to give a test to &#039;&#039;nftables&#039;&#039;, we recommend you to use git snapshots for &#039;&#039;libnftnl&#039;&#039; and &#039;&#039;nft&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from git ==&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;libnftnl&#039;&#039;, to can type these magic spells:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.netfilter.org/libnftnl&lt;br /&gt;
$ cd libnftnl&lt;br /&gt;
$ sh autogen.sh&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you are working behind proxy than it might possible that you are not able to clone using git protocol so try to clone using &amp;quot;http/https:&amp;quot; instead &amp;quot;git:&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Reasons:- 1) The git protocol, by default, uses the port 9418. It might possible that your traffic is blocked on that port.&lt;br /&gt;
&lt;br /&gt;
2) Also take help and can relate from the [http://stackoverflow.com/a/28494985 solution] &lt;br /&gt;
&lt;br /&gt;
If you have any compilation problem, please report them to the [https://www.netfilter.org/mailinglists.html netfilter developer mailing list] providing as much detailed information as possible.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from snapshots ==&lt;br /&gt;
&lt;br /&gt;
You can retrieve daily snapshots of this library from the [ftp://ftp.netfilter.org/pub/libnftnl/snapshot/ Netfilter FTP]. Then, to install it you have to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget ftp://ftp.netfilter.org/pub/libnftnl/snapshot/libnftnl-20140217.tar.bz2&lt;br /&gt;
$ tar xvjf libnftnl-20140217.tar.bz2&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing userspace nft command line utility =&lt;br /&gt;
&lt;br /&gt;
This is the command line utility that provides a user interface to configure &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
Just type these commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% git clone git://git.netfilter.org/nftables&lt;br /&gt;
% cd nftables&lt;br /&gt;
% sh autogen.sh&lt;br /&gt;
% ./configure&lt;br /&gt;
% make&lt;br /&gt;
% make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should check that &#039;&#039;nft&#039;&#039; is installed in your system by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft&lt;br /&gt;
nft: no command specified&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means &#039;&#039;nft&#039;&#039; has been correctly installed.&lt;br /&gt;
&lt;br /&gt;
= Installing Linux kernel with nftables support =&lt;br /&gt;
&lt;br /&gt;
Prerequisites: nftables is available in Linux kernels since version 3.13 but this is software under development, so we encourage you to run the latest stable kernel.&lt;br /&gt;
&lt;br /&gt;
== Validating your installation ==&lt;br /&gt;
&lt;br /&gt;
You can validate that your installation is working by checking if you can install the &#039;nf_tables&#039; kernel module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can check that&#039;s actually there via &#039;&#039;lsmod&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables              42349  0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dmesg should show the following message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% dmesg&lt;br /&gt;
...&lt;br /&gt;
[13939.468020] nf_tables: (c) 2007-2009 Patrick McHardy &amp;lt;kaber@trash.net&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you also have loaded the family support, eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;lsmod&#039;&#039; command should show something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables_ipv4         12869  0 &lt;br /&gt;
nf_tables              42349  1 nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other family modules are &#039;&#039;nf_tables_ipv6&#039;&#039;, &#039;&#039;nf_tables_bridge&#039;&#039;, &#039;&#039;nf_tables_arp&#039;&#039; and (since Linux kernel &amp;gt;= 3.14) &#039;&#039;nf_tables_inet&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These modules provide the corresponding [[Configuring_tables|table]] and the filter [[Configuring_chains|chain]] support for the given family.&lt;br /&gt;
&lt;br /&gt;
You could also check which modules are supported by your current kernel. How to to do this, depends on your distro:&lt;br /&gt;
* on debian, look in /boot/config-XXX-YYY, where XXX is your kernel package version, and YYY is your arch, e.g. /boot/config-4.2.0-1-amd64&lt;br /&gt;
* on Arch, look in /proc/config.gz. As this is compressed, use a command such as zcat or zgrep.&lt;br /&gt;
&lt;br /&gt;
In the debian example below, CONFIG_NFT_REDIR_IPV4 and CONFIG_NFT_REDIR_IPV6 are not set, so you can&#039;t use [http://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Redirect redirect] in the ruleset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% grep CONFIG_NFT_ /boot/config-4.2.0-1-amd64&lt;br /&gt;
CONFIG_NFT_EXTHDR=m&lt;br /&gt;
CONFIG_NFT_META=m&lt;br /&gt;
CONFIG_NFT_CT=m&lt;br /&gt;
CONFIG_NFT_RBTREE=m&lt;br /&gt;
CONFIG_NFT_HASH=m&lt;br /&gt;
CONFIG_NFT_COUNTER=m&lt;br /&gt;
CONFIG_NFT_LOG=m&lt;br /&gt;
CONFIG_NFT_LIMIT=m&lt;br /&gt;
CONFIG_NFT_MASQ=m&lt;br /&gt;
CONFIG_NFT_REDIR=m&lt;br /&gt;
CONFIG_NFT_NAT=m&lt;br /&gt;
CONFIG_NFT_QUEUE=m&lt;br /&gt;
CONFIG_NFT_REJECT=m&lt;br /&gt;
CONFIG_NFT_REJECT_INET=m&lt;br /&gt;
CONFIG_NFT_COMPAT=m&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV4=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV4=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV4=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV4=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV4 is not set&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV6=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV6=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV6=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV6=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV6 is not set&lt;br /&gt;
CONFIG_NFT_BRIDGE_META=m&lt;br /&gt;
CONFIG_NFT_BRIDGE_REJECT=m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
This is slower as you will retrieve the Linux kernel git tree for nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After retrieving the git tree, you have to follow the same steps that described in the installation from sources.&lt;br /&gt;
&lt;br /&gt;
But you will get the most recent changes for the &#039;&#039;nftables&#039;&#039; kernel code there.&lt;br /&gt;
&lt;br /&gt;
When configuring the kernel, be sure to enable all the nftables modules (choose &#039;m&#039; or &#039;y&#039;). This is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ make oldconfig&lt;br /&gt;
&lt;br /&gt;
Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES) [M/y/?] m&lt;br /&gt;
Netfilter nf_tables support (NF_TABLES) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables payload module (NFT_PAYLOAD) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables IPv6 exthdr module (NFT_EXTHDR) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables meta module (NFT_META) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables conntrack module (NFT_CT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables rbtree set module (NFT_RBTREE) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables hash set module (NFT_HASH) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables counter module (NFT_COUNTER) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables log module (NFT_LOG) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables limit module (NFT_LIMIT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables nat module (NFT_NAT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter x_tables over nf_tables module (NFT_COMPAT) [N/m/?] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv4 nf_tables support (NF_TABLES_IPV4) [N/m] (NEW) m&lt;br /&gt;
  nf_tables IPv4 reject support (NFT_REJECT_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables nat chain support (NFT_CHAIN_NAT_IPV4) [N/m] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv6 nf_tables support (NF_TABLES_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables nat chain support (NFT_CHAIN_NAT_IPV6) [M/n] m&lt;br /&gt;
&lt;br /&gt;
Ethernet Bridge nf_tables support (NF_TABLES_BRIDGE) [N/m/y] (NEW) m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arushi</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=126</id>
		<title>Building and installing nftables from sources</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=126"/>
		<updated>2017-03-30T17:06:05Z</updated>

		<summary type="html">&lt;p&gt;Arushi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;nftables requires several userspace libraries, the &#039;nft&#039; userspace command line utility and the kernel modules.&lt;br /&gt;
&lt;br /&gt;
If you are using a major linux distribution, you may consider using [[nftables from distributions]].&lt;br /&gt;
&lt;br /&gt;
= Installing userspace libraries =&lt;br /&gt;
&lt;br /&gt;
You have to install the following userspace libraries:&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libmnl libmnl ], this library provides the interfaces to communicate kernel and userspace via Netlink. &#039;&#039;It is very likely that your distribution already provides a package for libmnl that you can use&#039;&#039;. If you decide to use your distributor package, make sure you install the development package as well.&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libnftnl libnftnl] (formerly known as libnftables), this library provides the low-level API to transform netlink messages to objects.&lt;br /&gt;
&lt;br /&gt;
You also need &#039;&#039;libgmp&#039;&#039; and &#039;&#039;libreadline&#039;&#039;, most distributions already provide packages for these two libraries, so make sure you install the development extensions of this packages to successfully compile &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you plan to give a test to &#039;&#039;nftables&#039;&#039;, we recommend you to use git snapshots for &#039;&#039;libnftnl&#039;&#039; and &#039;&#039;nft&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from git ==&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;libnftnl&#039;&#039;, to can type these magic spells:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.netfilter.org/libnftnl&lt;br /&gt;
$ cd libnftnl&lt;br /&gt;
$ sh autogen.sh&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you are working behind proxy than it might possible that you are not able to clone using git protocol so try to clone using &amp;quot;http/https:&amp;quot; instead &amp;quot;git:&amp;quot;&lt;br /&gt;
Reasons:- 1) The git protocol, by default, uses the port 9418. It might possible that your traffic is blocked on that port.&lt;br /&gt;
2) Also take help and can relate from the [http://stackoverflow.com/a/28494985 solution] &lt;br /&gt;
&lt;br /&gt;
If you have any compilation problem, please report them to the [https://www.netfilter.org/mailinglists.html netfilter developer mailing list] providing as much detailed information as possible.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from snapshots ==&lt;br /&gt;
&lt;br /&gt;
You can retrieve daily snapshots of this library from the [ftp://ftp.netfilter.org/pub/libnftnl/snapshot/ Netfilter FTP]. Then, to install it you have to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget ftp://ftp.netfilter.org/pub/libnftnl/snapshot/libnftnl-20140217.tar.bz2&lt;br /&gt;
$ tar xvjf libnftnl-20140217.tar.bz2&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing userspace nft command line utility =&lt;br /&gt;
&lt;br /&gt;
This is the command line utility that provides a user interface to configure &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
Just type these commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% git clone git://git.netfilter.org/nftables&lt;br /&gt;
% cd nftables&lt;br /&gt;
% sh autogen.sh&lt;br /&gt;
% ./configure&lt;br /&gt;
% make&lt;br /&gt;
% make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should check that &#039;&#039;nft&#039;&#039; is installed in your system by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft&lt;br /&gt;
nft: no command specified&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means &#039;&#039;nft&#039;&#039; has been correctly installed.&lt;br /&gt;
&lt;br /&gt;
= Installing Linux kernel with nftables support =&lt;br /&gt;
&lt;br /&gt;
Prerequisites: nftables is available in Linux kernels since version 3.13 but this is software under development, so we encourage you to run the latest stable kernel.&lt;br /&gt;
&lt;br /&gt;
== Validating your installation ==&lt;br /&gt;
&lt;br /&gt;
You can validate that your installation is working by checking if you can install the &#039;nf_tables&#039; kernel module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can check that&#039;s actually there via &#039;&#039;lsmod&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables              42349  0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dmesg should show the following message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% dmesg&lt;br /&gt;
...&lt;br /&gt;
[13939.468020] nf_tables: (c) 2007-2009 Patrick McHardy &amp;lt;kaber@trash.net&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you also have loaded the family support, eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;lsmod&#039;&#039; command should show something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables_ipv4         12869  0 &lt;br /&gt;
nf_tables              42349  1 nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other family modules are &#039;&#039;nf_tables_ipv6&#039;&#039;, &#039;&#039;nf_tables_bridge&#039;&#039;, &#039;&#039;nf_tables_arp&#039;&#039; and (since Linux kernel &amp;gt;= 3.14) &#039;&#039;nf_tables_inet&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These modules provide the corresponding [[Configuring_tables|table]] and the filter [[Configuring_chains|chain]] support for the given family.&lt;br /&gt;
&lt;br /&gt;
You could also check which modules are supported by your current kernel. How to to do this, depends on your distro:&lt;br /&gt;
* on debian, look in /boot/config-XXX-YYY, where XXX is your kernel package version, and YYY is your arch, e.g. /boot/config-4.2.0-1-amd64&lt;br /&gt;
* on Arch, look in /proc/config.gz. As this is compressed, use a command such as zcat or zgrep.&lt;br /&gt;
&lt;br /&gt;
In the debian example below, CONFIG_NFT_REDIR_IPV4 and CONFIG_NFT_REDIR_IPV6 are not set, so you can&#039;t use [http://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Redirect redirect] in the ruleset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% grep CONFIG_NFT_ /boot/config-4.2.0-1-amd64&lt;br /&gt;
CONFIG_NFT_EXTHDR=m&lt;br /&gt;
CONFIG_NFT_META=m&lt;br /&gt;
CONFIG_NFT_CT=m&lt;br /&gt;
CONFIG_NFT_RBTREE=m&lt;br /&gt;
CONFIG_NFT_HASH=m&lt;br /&gt;
CONFIG_NFT_COUNTER=m&lt;br /&gt;
CONFIG_NFT_LOG=m&lt;br /&gt;
CONFIG_NFT_LIMIT=m&lt;br /&gt;
CONFIG_NFT_MASQ=m&lt;br /&gt;
CONFIG_NFT_REDIR=m&lt;br /&gt;
CONFIG_NFT_NAT=m&lt;br /&gt;
CONFIG_NFT_QUEUE=m&lt;br /&gt;
CONFIG_NFT_REJECT=m&lt;br /&gt;
CONFIG_NFT_REJECT_INET=m&lt;br /&gt;
CONFIG_NFT_COMPAT=m&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV4=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV4=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV4=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV4=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV4 is not set&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV6=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV6=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV6=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV6=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV6 is not set&lt;br /&gt;
CONFIG_NFT_BRIDGE_META=m&lt;br /&gt;
CONFIG_NFT_BRIDGE_REJECT=m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
This is slower as you will retrieve the Linux kernel git tree for nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After retrieving the git tree, you have to follow the same steps that described in the installation from sources.&lt;br /&gt;
&lt;br /&gt;
But you will get the most recent changes for the &#039;&#039;nftables&#039;&#039; kernel code there.&lt;br /&gt;
&lt;br /&gt;
When configuring the kernel, be sure to enable all the nftables modules (choose &#039;m&#039; or &#039;y&#039;). This is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ make oldconfig&lt;br /&gt;
&lt;br /&gt;
Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES) [M/y/?] m&lt;br /&gt;
Netfilter nf_tables support (NF_TABLES) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables payload module (NFT_PAYLOAD) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables IPv6 exthdr module (NFT_EXTHDR) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables meta module (NFT_META) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables conntrack module (NFT_CT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables rbtree set module (NFT_RBTREE) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables hash set module (NFT_HASH) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables counter module (NFT_COUNTER) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables log module (NFT_LOG) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables limit module (NFT_LIMIT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables nat module (NFT_NAT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter x_tables over nf_tables module (NFT_COMPAT) [N/m/?] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv4 nf_tables support (NF_TABLES_IPV4) [N/m] (NEW) m&lt;br /&gt;
  nf_tables IPv4 reject support (NFT_REJECT_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables nat chain support (NFT_CHAIN_NAT_IPV4) [N/m] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv6 nf_tables support (NF_TABLES_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables nat chain support (NFT_CHAIN_NAT_IPV6) [M/n] m&lt;br /&gt;
&lt;br /&gt;
Ethernet Bridge nf_tables support (NF_TABLES_BRIDGE) [N/m/y] (NEW) m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arushi</name></author>
	</entry>
	<entry>
		<id>http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=124</id>
		<title>Building and installing nftables from sources</title>
		<link rel="alternate" type="text/html" href="http://wiki.nftables.org/wiki-nftables/index.php?title=Building_and_installing_nftables_from_sources&amp;diff=124"/>
		<updated>2017-03-29T22:03:13Z</updated>

		<summary type="html">&lt;p&gt;Arushi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;nftables requires several userspace libraries, the &#039;nft&#039; userspace command line utility and the kernel modules.&lt;br /&gt;
&lt;br /&gt;
If you are using a major linux distribution, you may consider using [[nftables from distributions]].&lt;br /&gt;
&lt;br /&gt;
= Installing userspace libraries =&lt;br /&gt;
&lt;br /&gt;
You have to install the following userspace libraries:&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libmnl libmnl ], this library provides the interfaces to communicate kernel and userspace via Netlink. &#039;&#039;It is very likely that your distribution already provides a package for libmnl that you can use&#039;&#039;. If you decide to use your distributor package, make sure you install the development package as well.&lt;br /&gt;
&lt;br /&gt;
* [http://www.netfilter.org/projects/libnftnl libnftnl] (formerly known as libnftables), this library provides the low-level API to transform netlink messages to objects.&lt;br /&gt;
&lt;br /&gt;
You also need &#039;&#039;libgmp&#039;&#039; and &#039;&#039;libreadline&#039;&#039;, most distributions already provide packages for these two libraries, so make sure you install the development extensions of this packages to successfully compile &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you plan to give a test to &#039;&#039;nftables&#039;&#039;, we recommend you to use git snapshots for &#039;&#039;libnftnl&#039;&#039; and &#039;&#039;nft&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from git ==&lt;br /&gt;
&lt;br /&gt;
To install &#039;&#039;libnftnl&#039;&#039;, to can type these magic spells:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.netfilter.org/libnftnl&lt;br /&gt;
$ cd libnftnl&lt;br /&gt;
$ sh autogen.sh&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are working behind proxy than it might possible that you are not able to clone using git protocol so try to clone using &amp;quot;http/https:&amp;quot; instead &amp;quot;git:&amp;quot; &lt;br /&gt;
&lt;br /&gt;
If you have any compilation problem, please report them to the [https://www.netfilter.org/mailinglists.html netfilter developer mailing list] providing as much detailed information as possible.&lt;br /&gt;
&lt;br /&gt;
== Installing userspace libraries from snapshots ==&lt;br /&gt;
&lt;br /&gt;
You can retrieve daily snapshots of this library from the [ftp://ftp.netfilter.org/pub/libnftnl/snapshot/ Netfilter FTP]. Then, to install it you have to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget ftp://ftp.netfilter.org/pub/libnftnl/snapshot/libnftnl-20140217.tar.bz2&lt;br /&gt;
$ tar xvjf libnftnl-20140217.tar.bz2&lt;br /&gt;
$ ./configure&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing userspace nft command line utility =&lt;br /&gt;
&lt;br /&gt;
This is the command line utility that provides a user interface to configure &#039;&#039;nftables&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
Just type these commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% git clone git://git.netfilter.org/nftables&lt;br /&gt;
% cd nftables&lt;br /&gt;
% sh autogen.sh&lt;br /&gt;
% ./configure&lt;br /&gt;
% make&lt;br /&gt;
% make install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should check that &#039;&#039;nft&#039;&#039; is installed in your system by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% nft&lt;br /&gt;
nft: no command specified&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means &#039;&#039;nft&#039;&#039; has been correctly installed.&lt;br /&gt;
&lt;br /&gt;
= Installing Linux kernel with nftables support =&lt;br /&gt;
&lt;br /&gt;
Prerequisites: nftables is available in Linux kernels since version 3.13 but this is software under development, so we encourage you to run the latest stable kernel.&lt;br /&gt;
&lt;br /&gt;
== Validating your installation ==&lt;br /&gt;
&lt;br /&gt;
You can validate that your installation is working by checking if you can install the &#039;nf_tables&#039; kernel module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you can check that&#039;s actually there via &#039;&#039;lsmod&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables              42349  0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dmesg should show the following message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% dmesg&lt;br /&gt;
...&lt;br /&gt;
[13939.468020] nf_tables: (c) 2007-2009 Patrick McHardy &amp;lt;kaber@trash.net&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you also have loaded the family support, eg.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% modprobe nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;lsmod&#039;&#039; command should show something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# lsmod | grep nf_tables&lt;br /&gt;
nf_tables_ipv4         12869  0 &lt;br /&gt;
nf_tables              42349  1 nf_tables_ipv4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other family modules are &#039;&#039;nf_tables_ipv6&#039;&#039;, &#039;&#039;nf_tables_bridge&#039;&#039;, &#039;&#039;nf_tables_arp&#039;&#039; and (since Linux kernel &amp;gt;= 3.14) &#039;&#039;nf_tables_inet&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
These modules provide the corresponding [[Configuring_tables|table]] and the filter [[Configuring_chains|chain]] support for the given family.&lt;br /&gt;
&lt;br /&gt;
You could also check which modules are supported by your current kernel. How to to do this, depends on your distro:&lt;br /&gt;
* on debian, look in /boot/config-XXX-YYY, where XXX is your kernel package version, and YYY is your arch, e.g. /boot/config-4.2.0-1-amd64&lt;br /&gt;
* on Arch, look in /proc/config.gz. As this is compressed, use a command such as zcat or zgrep.&lt;br /&gt;
&lt;br /&gt;
In the debian example below, CONFIG_NFT_REDIR_IPV4 and CONFIG_NFT_REDIR_IPV6 are not set, so you can&#039;t use [http://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Redirect redirect] in the ruleset:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
% grep CONFIG_NFT_ /boot/config-4.2.0-1-amd64&lt;br /&gt;
CONFIG_NFT_EXTHDR=m&lt;br /&gt;
CONFIG_NFT_META=m&lt;br /&gt;
CONFIG_NFT_CT=m&lt;br /&gt;
CONFIG_NFT_RBTREE=m&lt;br /&gt;
CONFIG_NFT_HASH=m&lt;br /&gt;
CONFIG_NFT_COUNTER=m&lt;br /&gt;
CONFIG_NFT_LOG=m&lt;br /&gt;
CONFIG_NFT_LIMIT=m&lt;br /&gt;
CONFIG_NFT_MASQ=m&lt;br /&gt;
CONFIG_NFT_REDIR=m&lt;br /&gt;
CONFIG_NFT_NAT=m&lt;br /&gt;
CONFIG_NFT_QUEUE=m&lt;br /&gt;
CONFIG_NFT_REJECT=m&lt;br /&gt;
CONFIG_NFT_REJECT_INET=m&lt;br /&gt;
CONFIG_NFT_COMPAT=m&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV4=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV4=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV4=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV4=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV4 is not set&lt;br /&gt;
CONFIG_NFT_CHAIN_ROUTE_IPV6=m&lt;br /&gt;
CONFIG_NFT_REJECT_IPV6=m&lt;br /&gt;
CONFIG_NFT_CHAIN_NAT_IPV6=m&lt;br /&gt;
CONFIG_NFT_MASQ_IPV6=m&lt;br /&gt;
# CONFIG_NFT_REDIR_IPV6 is not set&lt;br /&gt;
CONFIG_NFT_BRIDGE_META=m&lt;br /&gt;
CONFIG_NFT_BRIDGE_REJECT=m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing from git ==&lt;br /&gt;
&lt;br /&gt;
This is slower as you will retrieve the Linux kernel git tree for nftables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After retrieving the git tree, you have to follow the same steps that described in the installation from sources.&lt;br /&gt;
&lt;br /&gt;
But you will get the most recent changes for the &#039;&#039;nftables&#039;&#039; kernel code there.&lt;br /&gt;
&lt;br /&gt;
When configuring the kernel, be sure to enable all the nftables modules (choose &#039;m&#039; or &#039;y&#039;). This is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ make oldconfig&lt;br /&gt;
&lt;br /&gt;
Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES) [M/y/?] m&lt;br /&gt;
Netfilter nf_tables support (NF_TABLES) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables payload module (NFT_PAYLOAD) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables IPv6 exthdr module (NFT_EXTHDR) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables meta module (NFT_META) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables conntrack module (NFT_CT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables rbtree set module (NFT_RBTREE) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables hash set module (NFT_HASH) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables counter module (NFT_COUNTER) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables log module (NFT_LOG) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables limit module (NFT_LIMIT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter nf_tables nat module (NFT_NAT) [N/m] (NEW) m&lt;br /&gt;
  Netfilter x_tables over nf_tables module (NFT_COMPAT) [N/m/?] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv4 nf_tables support (NF_TABLES_IPV4) [N/m] (NEW) m&lt;br /&gt;
  nf_tables IPv4 reject support (NFT_REJECT_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV4) [N/m] (NEW) m&lt;br /&gt;
  IPv4 nf_tables nat chain support (NFT_CHAIN_NAT_IPV4) [N/m] (NEW) m&lt;br /&gt;
&lt;br /&gt;
IPv6 nf_tables support (NF_TABLES_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables route chain support (NFT_CHAIN_ROUTE_IPV6) [M/n] m&lt;br /&gt;
  IPv6 nf_tables nat chain support (NFT_CHAIN_NAT_IPV6) [M/n] m&lt;br /&gt;
&lt;br /&gt;
Ethernet Bridge nf_tables support (NF_TABLES_BRIDGE) [N/m/y] (NEW) m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Arushi</name></author>
	</entry>
</feed>