File: xtables-compat.8

package info (click to toggle)
iptables 1.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,220 kB
  • sloc: ansic: 55,460; sh: 5,794; makefile: 208; yacc: 187; python: 83; lex: 54
file content (177 lines) | stat: -rw-r--r-- 4,920 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
.\"
.\" (C) Copyright 2016-2017, Arturo Borrero Gonzalez <arturo@netfilter.org>
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.TH XTABLES-COMPAT 8 "Feb 25, 2017"

.SH NAME
xtables-compat \- compat tools to migrate from iptables to nftables

.SH DESCRIPTION
\fBxtables-compat\fP is set of tools to help the system administrator migrate the
ruleset from \fBiptables(8)\fP, \fBip6tables(8)\fP, \fBarptables(8)\fP, and
\fBebtables(8)\fP to \fBnftables(8)\fP.

The \fBxtables-compat\fP set is composed of several commands:
.IP \[bu] 2
iptables-compat
.IP \[bu]
iptables-compat-save
.IP \[bu]
iptables-compat-restore
.IP \[bu]
ip6tables-compat
.IP \[bu]
ip6tables-compat-save
.IP \[bu]
ip6tables-compat-restore
.IP \[bu]
arptables-compat
.IP \[bu]
ebtables-compat

These tools use the libxtables framework extensions and hook to the nf_tables
kernel subsystem using the \fBnft_compat\fP module.

.SH USAGE
The compat tools set allows you to manage the nf_tables backend using the
native syntax of \fBiptables(8)\fP, \fBip6tables(8)\fP, \fBarptables(8)\fP, and
\fBebtables(8)\fP.

You should use the compat tools exactly the same way as you would use the
corresponding original tool.

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 corresponding compat tool, for example:

.nf
	/sbin/iptables  --> /usr/sbin/iptables-compat
	/sbin/ip6tables --> /usr/sbin/ip6tables-compat
	/sbin/arptables --> /usr/sbin/arptables-compat
	/sbin/ebtables  --> /usr/sbin/ebtables-compat
.fi

.SH EXAMPLES
One basic example is creating the skeleton ruleset in nf_tables from the
compat tools, in a fresh machine:

.nf
	root@machine:~# iptables-compat -L
	[...]
	root@machine:~# ip6tables-compat -L
	[...]
	root@machine:~# arptables-compat -L
	[...]
	root@machine:~# ebtables-compat -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;
		}
	}
.fi

(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 \fBiptables(8)\fP,
you would use:

.nf
	root@machine:~# iptables-save > myruleset		# reads from x_tables
	root@machine:~# iptables-compat-restore myruleset	# writes to nf_tables
.fi


.SH LIMITATIONS
You should use \fBLinux kernel >= 4.2\fP.

Some (few) extensions may be not supported (or fully-supported) for whatever
reason (for example, they were considered obsolete).

To get up-to-date information about this, please head to
\fBhttp://wiki.nftables.org/\fP.

.SH SEE ALSO
\fBnft(8)\fP, \fBxtables-translate(8)\fP

.SH AUTHORS
The 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+.