README.Debian 2.24 KB
Newer Older
1
2
nftables & iptables
===================
3

4
5
nftables is the replacement of iptables by the Netfilter project.
You are encouraged to migrate now to nftables.
6

7
8
9
10
If you are developing a new firewall or network service, then writting a
nftables ruleset from the beginnig should be fine.
If you would like to migrate or translate your previous
iptables/ip6tables/arptables/ebtables rulesets to nftables then keep reading.
11

12
There are some tools in place to help you moving from iptables to nftables,
13
following 2 basic approaches:
14
15
16
17
18
19

 * command line translation
   (iptables-translate, iptables-restore-translate,
   ip6tables-translate, ip6tables-restore-translate)

 * syntax reuse with nf_tables backend
20
21
22
   (iptables-nft, iptables-nft-restore, iptables-nft-save,
   ip6tables-nft, ip6tables-nft-restore, ip6tables-nft-save,
   arptables-nft, ebtables-nft)
23
24
25

Documentation on how to use these tools can be found at:

26
 * https://wiki.debian.org/Moving_from_iptables_to_nftables
27
 * https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables
28
 * xtables-nft(8) manpage
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 * xtables-translate(8) manpage

alternatives
============

The legacy binaries are now installed as:

 * /sbin/iptables-legacy
 * /sbin/iptables-legacy-restore
 * /sbin/iptables-legacy-save
 * /sbin/ip6tables-legacy
 * /sbin/ip6tables-legacy-restore
 * /sbin/ip6tables-legacy-save
 * /sbin/arptables-legacy (in the arptables Debian package)
 * /sbin/ebtables-legacy (in the ebtables Debian package)

45
The nft-based tools (tools which accepts the legacy syntax but use the nf_tables
46
47
kernel subsystem) are installed as:

48
49
50
51
52
53
54
55
56
57
58
 * /sbin/iptables-nft
 * /sbin/iptables-nft-restore
 * /sbin/iptables-nft-save
 * /sbin/ip6tables-nft
 * /sbin/ip6tables-nft-restore
 * /sbin/ip6tables-nft-save
 * /sbin/arptables-nft
 * /sbin/ebtables-nft

The iptables Debian package install both and gives the nft version more
priority by default in the update-alternatives system. This means that if you
59
install that package, you will be using the nft tools instead of the legacy
60
61
62
63
64
65
66
ones.
Remember, you can change this at runtime using the `update-alternatives`
command.

NOTE: make sure you don't mix iptables-legacy and iptables-nft rulesets in the
same machine at the same time just for sanity and to avoid unexpected
behaviours in your network.