blob: 6308e0208c288eb8de5ef151687cf98652e82524 [file] [log] [blame]
Jan Engelhardt8d671902009-01-08 18:03:45 +01001.TH IP6TABLES 8 "" "@PACKAGE_AND_VERSION@" "@PACKAGE_AND_VERSION@"
Henrik Nordstromc2794132004-01-22 15:04:24 +00002.\"
3.\" Man page written by Andras Kis-Szabo <kisza@sch.bme.hu>
4.\" It is based on iptables man page.
5.\"
6.\" iptables page by Herve Eychenne <rv@wallfire.org>
7.\" It is based on ipchains man page.
8.\"
9.\" ipchains page by Paul ``Rusty'' Russell March 1997
10.\" Based on the original ipfwadm man page by Jos Vos <jos@xos.nl>
11.\"
12.\" This program is free software; you can redistribute it and/or modify
13.\" it under the terms of the GNU General Public License as published by
14.\" the Free Software Foundation; either version 2 of the License, or
15.\" (at your option) any later version.
16.\"
17.\" This program is distributed in the hope that it will be useful,
18.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20.\" GNU General Public License for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with this program; if not, write to the Free Software
24.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25.\"
26.\"
27.SH NAME
28ip6tables \- IPv6 packet filter administration
29.SH SYNOPSIS
Jan Engelhardtd9842a62008-07-30 12:49:47 +020030\fBip6tables\fP [\fB-t\fP \fItable\fP] {\fB-A\fP|\fB-D\fP} \fIchain rule-specification\fP [\fIoptions...\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010031.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020032\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-I\fP [\fIrulenum\fP] \fIrule-specification\fP [\fIoptions...\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010033.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020034\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-R\fP \fIrulenum rule-specification\fP [\fIoptions...\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010035.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020036\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-D\fP \fIchain rulenum\fP [\fIoptions...\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010037.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020038\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-S\fP [\fIchain\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010039.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020040\fBip6tables\fP [\fB-t\fP \fItable\fP] {\fB-F\fP|\fB-L\fP|\fB-Z\fP} [\fIchain\fP] [\fIoptions...\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010041.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020042\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-N\fP \fIchain\fP
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010043.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020044\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-X\fP [\fIchain\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010045.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020046\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-P\fP \fIchain target\fP [\fIoptions...\fP]
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010047.PP
Jan Engelhardtd9842a62008-07-30 12:49:47 +020048\fBip6tables\fP [\fB-t\fP \fItable\fP] \fB-E\fP \fIold-chain-name new-chain-name\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +000049.SH DESCRIPTION
Jan Engelhardt55dffef2008-07-03 20:27:50 +020050\fBIp6tables\fP is used to set up, maintain, and inspect the
51tables of IPv6 packet
Henrik Nordstromc2794132004-01-22 15:04:24 +000052filter rules in the Linux kernel. Several different tables
53may be defined. Each table contains a number of built-in
54chains and may also contain user-defined chains.
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +010055.PP
Henrik Nordstromc2794132004-01-22 15:04:24 +000056Each chain is a list of rules which can match a set of packets. Each
57rule specifies what to do with a packet that matches. This is called
58a `target', which may be a jump to a user-defined chain in the same
59table.
Henrik Nordstromc2794132004-01-22 15:04:24 +000060.SH TARGETS
Jan Engelhardt55dffef2008-07-03 20:27:50 +020061A firewall rule specifies criteria for a packet and a target. If the
Henrik Nordstromc2794132004-01-22 15:04:24 +000062packet does not match, the next rule in the chain is the examined; if
63it does match, then the next rule is specified by the value of the
64target, which can be the name of a user-defined chain or one of the
Jan Engelhardt55dffef2008-07-03 20:27:50 +020065special values \fBACCEPT\fP, \fBDROP\fP, \fBQUEUE\fP or \fBRETURN\fP.
Henrik Nordstromc2794132004-01-22 15:04:24 +000066.PP
Jan Engelhardt55dffef2008-07-03 20:27:50 +020067\fBACCEPT\fP means to let the packet through.
68\fBDROP\fP means to drop the packet on the floor.
69\fBQUEUE\fP means to pass the packet to userspace.
70(How the packet can be received
Harald Welte7bdfca42005-07-28 15:24:02 +000071by a userspace process differs by the particular queue handler. 2.4.x
Jan Engelhardt55dffef2008-07-03 20:27:50 +020072and 2.6.x kernels up to 2.6.13 include the \fBip_queue\fP
73queue handler. Kernels 2.6.14 and later additionally include the
74\fBnfnetlink_queue\fP queue handler. Packets with a target of QUEUE will be
75sent to queue number '0' in this case. Please also see the \fBNFQUEUE\fP
Harald Welte7bdfca42005-07-28 15:24:02 +000076target as described later in this man page.)
Jan Engelhardt55dffef2008-07-03 20:27:50 +020077\fBRETURN\fP means stop traversing this chain and resume at the next
78rule in the
Henrik Nordstromc2794132004-01-22 15:04:24 +000079previous (calling) chain. If the end of a built-in chain is reached
Jan Engelhardt55dffef2008-07-03 20:27:50 +020080or a rule in a built-in chain with target \fBRETURN\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +000081is matched, the target specified by the chain policy determines the
82fate of the packet.
83.SH TABLES
Jan Engelhardt55dffef2008-07-03 20:27:50 +020084There are currently three independent tables (which tables are present
Henrik Nordstromc2794132004-01-22 15:04:24 +000085at any time depends on the kernel configuration options and which
Jan Engelhardt55dffef2008-07-03 20:27:50 +020086modules are present).
Henrik Nordstromc2794132004-01-22 15:04:24 +000087.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +020088\fB-t\fP, \fB--table\fP \fItable\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +000089This option specifies the packet matching table which the command
90should operate on. If the kernel is configured with automatic module
91loading, an attempt will be made to load the appropriate module for
92that table if it is not already there.
93
94The tables are as follows:
95.RS
96.TP .4i
Jan Engelhardt55dffef2008-07-03 20:27:50 +020097\fBfilter\fP:
Henrik Nordstromc2794132004-01-22 15:04:24 +000098This is the default table (if no -t option is passed). It contains
Jan Engelhardt55dffef2008-07-03 20:27:50 +020099the built-in chains \fBINPUT\fP (for packets destined to local sockets),
100\fBFORWARD\fP (for packets being routed through the box), and
101\fBOUTPUT\fP (for locally-generated packets).
Henrik Nordstromc2794132004-01-22 15:04:24 +0000102.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200103\fBmangle\fP:
Henrik Nordstromc2794132004-01-22 15:04:24 +0000104This table is used for specialized packet alteration. Until kernel
Jan Engelhardt55dffef2008-07-03 20:27:50 +02001052.4.17 it had two built-in chains: \fBPREROUTING\fP
106(for altering incoming packets before routing) and \fBOUTPUT\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000107(for altering locally-generated packets before routing).
108Since kernel 2.4.18, three other built-in chains are also supported:
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200109\fBINPUT\fP (for packets coming into the box itself), \fBFORWARD\fP
110(for altering packets being routed through the box), and \fBPOSTROUTING\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000111(for altering packets as they are about to go out).
Yasuyuki KOZAKAI28e5b792006-01-30 08:50:09 +0000112.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200113\fBraw\fP:
Yasuyuki KOZAKAI28e5b792006-01-30 08:50:09 +0000114This table is used mainly for configuring exemptions from connection
115tracking in combination with the NOTRACK target. It registers at the netfilter
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200116hooks with higher priority and is thus called before ip_conntrack, or any other
117IP tables. It provides the following built-in chains: \fBPREROUTING\fP
118(for packets arriving via any network interface) \fBOUTPUT\fP
Yasuyuki KOZAKAI28e5b792006-01-30 08:50:09 +0000119(for packets generated by local processes)
Henrik Nordstromc2794132004-01-22 15:04:24 +0000120.RE
121.SH OPTIONS
122The options that are recognized by
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200123\fBip6tables\fP can be divided into several different groups.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000124.SS COMMANDS
125These options specify the specific action to perform. Only one of them
126can be specified on the command line unless otherwise specified
127below. For all the long versions of the command and option names, you
128need to use only enough letters to ensure that
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200129\fBip6tables\fP can differentiate it from all other options.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000130.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200131\fB-A\fP, \fB--append\fP \fIchain rule-specification\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000132Append one or more rules to the end of the selected chain.
133When the source and/or destination names resolve to more than one
134address, a rule will be added for each possible address combination.
135.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200136\fB-D\fP, \fB--delete\fP \fIchain rule-specification\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000137.ns
138.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200139\fB-D\fP, \fB--delete\fP \fIchain rulenum\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000140Delete one or more rules from the selected chain. There are two
141versions of this command: the rule can be specified as a number in the
142chain (starting at 1 for the first rule) or a rule to match.
143.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200144\fB-I\fP, \fB--insert\fP \fIchain\fP [\fIrulenum\fP] \fIrule-specification\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000145Insert one or more rules in the selected chain as the given rule
146number. So, if the rule number is 1, the rule or rules are inserted
147at the head of the chain. This is also the default if no rule number
148is specified.
149.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200150\fB-R\fP, \fB--replace\fP \fIchain rulenum rule-specification\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000151Replace a rule in the selected chain. If the source and/or
152destination names resolve to multiple addresses, the command will
153fail. Rules are numbered starting at 1.
154.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200155\fB-L\fP, \fB--list\fP [\fIchain\fP]
Henrik Nordstromc2794132004-01-22 15:04:24 +0000156List all rules in the selected chain. If no chain is selected, all
Jan Engelhardtd9842a62008-07-30 12:49:47 +0200157chains are listed. Like every other ip6tables command, it applies to the
Jan Engelhardt9c6ff6b2008-09-08 15:42:41 +0200158specified table (filter is the default).
159.IP ""
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200160Please note that it is often used with the \fB-n\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000161option, in order to avoid long reverse DNS lookups.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200162It is legal to specify the \fB-Z\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000163(zero) option as well, in which case the chain(s) will be atomically
164listed and zeroed. The exact output is affected by the other
165arguments given. The exact rules are suppressed until you use
166.nf
Jan Engelhardtd9842a62008-07-30 12:49:47 +0200167 ip6tables -L -v
Henrik Nordstromc2794132004-01-22 15:04:24 +0000168.fi
169.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200170\fB-S\fP, \fB--list-rules\fP [\fIchain\fP]
Henrik Nordstrom96296cf2008-05-13 13:08:26 +0200171Print all rules in the selected chain. If no chain is selected, all
Jan Engelhardtd9842a62008-07-30 12:49:47 +0200172chains are printed like ip6tables-save. Like every other ip6tables command,
Henrik Nordstrom96296cf2008-05-13 13:08:26 +0200173it applies to the specified table (filter is the default).
174.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200175\fB-F\fP, \fB--flush\fP [\fIchain\fP]
Henrik Nordstromc2794132004-01-22 15:04:24 +0000176Flush the selected chain (all the chains in the table if none is given).
177This is equivalent to deleting all the rules one by one.
178.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200179\fB-Z\fP, \fB--zero\fP [\fIchain\fP]
Henrik Nordstromc2794132004-01-22 15:04:24 +0000180Zero the packet and byte counters in all chains. It is legal to
181specify the
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200182\fB-L\fP, \fB--list\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000183(list) option as well, to see the counters immediately before they are
184cleared. (See above.)
185.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200186\fB-N\fP, \fB--new-chain\fP \fIchain\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000187Create a new user-defined chain by the given name. There must be no
188target of that name already.
189.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200190\fB-X\fP, \fB--delete-chain\fP [\fIchain\fP]
Henrik Nordstromc2794132004-01-22 15:04:24 +0000191Delete the optional user-defined chain specified. There must be no references
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200192to the chain. If there are, you must delete or replace the referring rules
193before the chain can be deleted. The chain must be empty, i.e. not contain
194any rules. If no argument is given, it will attempt to delete every
195non-builtin chain in the table.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000196.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200197\fB-P\fP, \fB--policy\fP \fIchain target\fP
198Set the policy for the chain to the given target. See the section \fBTARGETS\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000199for the legal targets. Only built-in (non-user-defined) chains can have
200policies, and neither built-in nor user-defined chains can be policy
201targets.
202.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200203\fB-E\fP, \fB--rename-chain\fP \fIold-chain new-chain\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000204Rename the user specified chain to the user supplied name. This is
205cosmetic, and has no effect on the structure of the table.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200206.BI "-A, --append " "chain rule-specification"
207Append one or more rules to the end of the selected chain.
208When the source and/or destination names resolve to more than one
209address, a rule will be added for each possible address combination.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000210.TP
211.B -h
212Help.
213Give a (currently very brief) description of the command syntax.
214.SS PARAMETERS
215The following parameters make up a rule specification (as used in the
216add, delete, insert, replace and append commands).
217.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200218[\fB!\fP] \fB-p\fP, \fB--protocol\fP \fIprotocol\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000219The protocol of the rule or of the packet to check.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200220The specified protocol can be one of \fBtcp\fP, \fBudp\fP, \fBudplite\fP,
221\fBicmpv6\fP, \fBesp\fP, \fBmh\fP or \fBall\fP,
Henrik Nordstromc2794132004-01-22 15:04:24 +0000222or it can be a numeric value, representing one of these protocols or a
Yasuyuki KOZAKAI28e5b792006-01-30 08:50:09 +0000223different one. A protocol name from /etc/protocols is also allowed.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200224But IPv6 extension headers except \fBesp\fP are not allowed.
225\fBesp\fP and \fBipv6-nonext\fP
Yasuyuki KOZAKAI28e5b792006-01-30 08:50:09 +0000226can be used with Kernel version 2.6.11 or later.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000227A "!" argument before the protocol inverts the
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200228test. The number zero is equivalent to \fBall\fP.
229Protocol \fBall\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000230will match with all protocols and is taken as default when this
231option is omitted.
232.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200233[\fB!\fP] \fB-s\fP, \fB--source\fP \fIaddress\fP[\fB/\fP\fImask\fP]
Henrik Nordstromc2794132004-01-22 15:04:24 +0000234Source specification.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200235\fIAddress\fP can be either a hostname (please note that specifying
Henrik Nordstromc2794132004-01-22 15:04:24 +0000236any name to be resolved with a remote query such as DNS is a really bad idea),
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200237a network IPv6 address (with \fB/\fP\fImask\fP), or a plain IPv6 address.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000238(the network name isn't supported now).
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200239The \fImask\fP is a plain number,
Henrik Nordstromc2794132004-01-22 15:04:24 +0000240specifying the number of 1's at the left side of the network mask.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000241A "!" argument before the address specification inverts the sense of
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200242the address. The flag \fB--src\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000243is an alias for this option.
244.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200245[\fB!\fP] \fB-d\fP, \fB--destination\fP \fIaddress\fP[\fB/\fP\fImask\fP]
Henrik Nordstromc2794132004-01-22 15:04:24 +0000246Destination specification.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200247See the description of the \fB-s\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000248(source) flag for a detailed description of the syntax. The flag
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200249\fB--dst\fP is an alias for this option.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000250.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200251\fB-j\fP, \fB--jump\fP \fItarget\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000252This specifies the target of the rule; i.e., what to do if the packet
253matches it. The target can be a user-defined chain (other than the
254one this rule is in), one of the special builtin targets which decide
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200255the fate of the packet immediately, or an extension (see \fBEXTENSIONS\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000256below). If this
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200257option is omitted in a rule (and \fB-g\fP
Thomas Jacobeaf831e2008-06-23 11:35:29 +0200258is not used), then matching the rule will have no
Henrik Nordstromc2794132004-01-22 15:04:24 +0000259effect on the packet's fate, but the counters on the rule will be
260incremented.
261.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200262\fB-g\fP, \fB--goto\fP \fIchain\fP
Thomas Jacobeaf831e2008-06-23 11:35:29 +0200263This specifies that the processing should continue in a user
264specified chain. Unlike the --jump option return will not continue
265processing in this chain but instead in the chain that called us via
266--jump.
267.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200268[\fB!\fP] \fB-i\fP, \fB--in-interface\fP \fIname\fP
269Name of an interface via which a packet was received (only for
270packets entering the \fBINPUT\fP, \fBFORWARD\fP and \fBPREROUTING\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000271chains). When the "!" argument is used before the interface name, the
272sense is inverted. If the interface name ends in a "+", then any
273interface which begins with this name will match. If this option is
274omitted, any interface name will match.
275.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200276[\fB!\fP] \fB-o\fP, \fB--out-interface\fP \fIname\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000277Name of an interface via which a packet is going to be sent (for packets
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200278entering the \fBFORWARD\fP, \fBOUTPUT\fP and \fBPOSTROUTING\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000279chains). When the "!" argument is used before the interface name, the
280sense is inverted. If the interface name ends in a "+", then any
281interface which begins with this name will match. If this option is
282omitted, any interface name will match.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000283.\" Currently not supported (header-based)
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200284.\" .TP
285.\" [\fB!\fP] \fB-f\fP, \fB--fragment\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000286.\" This means that the rule only refers to second and further fragments
287.\" of fragmented packets. Since there is no way to tell the source or
288.\" destination ports of such a packet (or ICMP type), such a packet will
289.\" not match any rules which specify them. When the "!" argument
290.\" precedes the "-f" flag, the rule will only match head fragments, or
291.\" unfragmented packets.
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200292.TP
293\fB-c\fP, \fB--set-counters\fP \fIpackets bytes\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000294This enables the administrator to initialize the packet and byte
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200295counters of a rule (during \fBINSERT\fP, \fBAPPEND\fP, \fBREPLACE\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000296operations).
297.SS "OTHER OPTIONS"
298The following additional options can be specified:
299.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200300\fB-v\fP, \fB--verbose\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000301Verbose output. This option makes the list command show the interface
302name, the rule options (if any), and the TOS masks. The packet and
303byte counters are also listed, with the suffix 'K', 'M' or 'G' for
3041000, 1,000,000 and 1,000,000,000 multipliers respectively (but see
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200305the \fB-x\fP flag to change this).
Henrik Nordstromc2794132004-01-22 15:04:24 +0000306For appending, insertion, deletion and replacement, this causes
307detailed information on the rule or rules to be printed.
308.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200309\fB-n\fP, \fB--numeric\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000310Numeric output.
311IP addresses and port numbers will be printed in numeric format.
312By default, the program will try to display them as host names,
313network names, or services (whenever applicable).
314.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200315\fB-x\fP, \fB--exact\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000316Expand numbers.
317Display the exact value of the packet and byte counters,
318instead of only the rounded number in K's (multiples of 1000)
319M's (multiples of 1000K) or G's (multiples of 1000M). This option is
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200320only relevant for the \fB-L\fP command.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000321.TP
322.B "--line-numbers"
323When listing rules, add line numbers to the beginning of each rule,
324corresponding to that rule's position in the chain.
325.TP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200326\fB--modprobe=\fP\fIcommand\fP
327When adding or inserting rules into a chain, use \fIcommand\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000328to load any necessary modules (targets, match extensions, etc).
329.SH MATCH EXTENSIONS
330ip6tables can use extended packet matching modules. These are loaded
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200331in two ways: implicitly, when \fB-p\fP or \fB--protocol\fP
332is specified, or with the \fB-m\fP or \fB--match\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000333options, followed by the matching module name; after these, various
334extra command line options become available, depending on the specific
335module. You can specify multiple extended match modules in one line,
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200336and you can use the \fB-h\fP or \fB--help\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000337options after the module has been specified to receive help specific
338to that module.
Jan Engelhardt0c2b5a42009-01-08 18:04:40 +0100339.PP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000340The following are included in the base package, and most of these can
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200341be preceded by a "\fB!\fP" to invert the sense of the match.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000342.\" @MATCH@
343.SH TARGET EXTENSIONS
344ip6tables can use extended target modules: the following are included
345in the standard distribution.
346.\" @TARGET@
347.SH DIAGNOSTICS
348Various error messages are printed to standard error. The exit code
349is 0 for correct functioning. Errors which appear to be caused by
350invalid or abused command line parameters cause an exit code of 2, and
351other errors cause an exit code of 1.
352.SH BUGS
353Bugs? What's this? ;-)
354Well... the counters are not reliable on sparc64.
355.SH COMPATIBILITY WITH IPCHAINS
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200356This \fBip6tables\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000357is very similar to ipchains by Rusty Russell. The main difference is
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200358that the chains \fBINPUT\fP and \fBOUTPUT\fP
Henrik Nordstromc2794132004-01-22 15:04:24 +0000359are only traversed for packets coming into the local host and
360originating from the local host respectively. Hence every packet only
361passes through one of the three chains (except loopback traffic, which
362involves both INPUT and OUTPUT chains); previously a forwarded packet
363would pass through all three.
364.PP
Jan Engelhardt55dffef2008-07-03 20:27:50 +0200365The other main difference is that \fB-i\fP refers to the input interface;
366\fB-o\fP refers to the output interface, and both are available for packets
367entering the \fBFORWARD\fP chain.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000368There are several other changes in ip6tables.
369.SH SEE ALSO
370.BR ip6tables-save (8),
371.BR ip6tables-restore(8),
372.BR iptables (8),
373.BR iptables-save (8),
Harald Welte7bdfca42005-07-28 15:24:02 +0000374.BR iptables-restore (8),
375.BR libipq (3).
Henrik Nordstromc2794132004-01-22 15:04:24 +0000376.P
377The packet-filtering-HOWTO details iptables usage for
Jan Engelhardt9c6ff6b2008-09-08 15:42:41 +0200378packet filtering,
Henrik Nordstromc2794132004-01-22 15:04:24 +0000379the netfilter-extensions-HOWTO details the extensions that are
380not in the standard distribution,
381and the netfilter-hacking-HOWTO details the netfilter internals.
382.br
383See
384.BR "http://www.netfilter.org/" .
385.SH AUTHORS
386Rusty Russell wrote iptables, in early consultation with Michael
387Neuling.
388.PP
389Marc Boucher made Rusty abandon ipnatctl by lobbying for a generic packet
390selection framework in iptables, then wrote the mangle table, the owner match,
391the mark stuff, and ran around doing cool stuff everywhere.
392.PP
393James Morris wrote the TOS target, and tos match.
394.PP
395Jozsef Kadlecsik wrote the REJECT target.
396.PP
Jan Engelhardt6cf172e2008-03-10 17:48:59 +0100397Harald Welte wrote the ULOG and NFQUEUE target, the new libiptc, as well as TTL match+target and libipulog.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000398.PP
Patrick McHardy110a89a2007-01-28 01:24:55 +0000399The Netfilter Core Team is: Marc Boucher, Martin Josefsson, Yasuyuki Kozakai,
Yasuyuki KOZAKAIe605d762007-02-15 06:41:58 +0000400Jozsef Kadlecsik, Patrick McHardy, James Morris, Pablo Neira Ayuso,
401Harald Welte and Rusty Russell.
Henrik Nordstromc2794132004-01-22 15:04:24 +0000402.PP
403ip6tables man page created by Andras Kis-Szabo, based on
404iptables man page written by Herve Eychenne <rv@wallfire.org>.
405.\" .. and did I mention that we are incredibly cool people?
406.\" .. sexy, too ..
407.\" .. witty, charming, powerful ..
408.\" .. and most of all, modest ..