summaryrefslogtreecommitdiffstats
path: root/ip6tables.8
diff options
context:
space:
mode:
authorHervé Eychenne <rv@wallfire.org>2002-03-14 09:25:40 +0000
committerHarald Welte <laforge@gnumonks.org>2002-03-14 09:25:40 +0000
commit9e5180649864703b05dbdb5db6ec38aee04c28d2 (patch)
tree54ddb95b9c5cd9a7eec500986d820709686dcad2 /ip6tables.8
parente0a71a88ca64bc139d9cf93d984e21984875c5c1 (diff)
manpage updates by Herve Eychenne
Diffstat (limited to 'ip6tables.8')
-rw-r--r--ip6tables.8233
1 files changed, 135 insertions, 98 deletions
diff --git a/ip6tables.8 b/ip6tables.8
index 8c8d140b..065932cf 100644
--- a/ip6tables.8
+++ b/ip6tables.8
@@ -1,13 +1,13 @@
-.TH IP6TABLES 8 "Okt 07, 2001" "" ""
+.TH IP6TABLES 8 "Mar 09, 2002" "" ""
.\"
.\" Man page written by Andras Kis-Szabo <kisza@sch.bme.hu>
.\" It is based on iptables man page.
.\"
-.\" iptables page by Herve Eychenne <eychenne@info.enserb.u-bordeaux.fr>
+.\" iptables page by Herve Eychenne <rv@wallfire.org>
.\" It is based on ipchains man page.
.\"
.\" ipchains page by Paul ``Rusty'' Russell March 1997
-.\" Based on the original ipfwadm man page by Jos Vos <jos@xos.nl> (see README)
+.\" Based on the original ipfwadm man page by Jos Vos <jos@xos.nl>
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
@@ -29,13 +29,17 @@ ip6tables \- IPv6 packet filter administration
.SH SYNOPSIS
.BR "ip6tables -[ADC] " "chain rule-specification [options]"
.br
-.BR "ip6tables -[RI] " "chain rulenum rule-specification [options]"
+.BR "ip6tables -I " "chain [rulenum] rule-specification [options]"
+.br
+.BR "ip6tables -R " "chain rulenum rule-specification [options]"
.br
.BR "ip6tables -D " "chain rulenum [options]"
.br
.BR "ip6tables -[LFZ] " "[chain] [options]"
.br
-.BR "ip6tables -[NX] " "chain"
+.BR "ip6tables -N " "chain"
+.br
+.BR "ip6tables -X " "[chain]"
.br
.BR "ip6tables -P " "chain target [options]"
.br
@@ -82,7 +86,7 @@ There are current three independent tables (which tables are present
at any time depends on the kernel configuration options and which
modules are present).
.TP
-.B "-t, --table"
+.BI "-t, --table " "table"
This option specifies the packet matching table which the command
should operate on. If the kernel is configured with automatic module
loading, an attempt will be made to load the appropriate module for
@@ -90,16 +94,19 @@ that table if it is not already there.
The tables are as follows:
.TP
-.BR "filter"
+.B "filter"
This is the default table. It contains the built-in chains INPUT (for
packets coming into the box itself), FORWARD (for packets being routed
through the box), and OUTPUT (for locally-generated packets).
.TP
-.BR "mangle"
-This table is used for specialized packet alteration. It has two
-built-in chains: PREROUTING (for altering incoming packets before
-routing) and OUTPUT (for altering locally-generated packets before
-routing).
+.B "mangle"
+This table is used for specialized packet alteration. Until kernel
+2.4.17 it had two built-in chains: PREROUTING (for altering incoming
+packets before routing) and OUTPUT (for altering locally-generated
+packets before routing). Since kernel 2.4.18, three other built-in
+chains are also supported : INPUT (for packets coming into the box itself),
+FORWARD (for altering packets being routed through the box), and
+POSTROUTING (for altering packets as they are about to go out).
.SH OPTIONS
The options that are recognized by
.B ip6tables
@@ -112,63 +119,75 @@ need to use only enough letters to ensure that
.B ip6tables
can differentiate it from all other options.
.TP
-.BR "-A, --append"
+.BI "-A, --append " "chain rule-specification"
Append one or more rules to the end of the selected chain.
When the source and/or destination names resolve to more than one
address, a rule will be added for each possible address combination.
.TP
-.BR "-D, --delete"
+.BI "-D, --delete " "chain rule-specification"
+.ns
+.TP
+.BI "-D, --delete " "chain rulenum"
Delete one or more rules from the selected chain. There are two
versions of this command: the rule can be specified as a number in the
chain (starting at 1 for the first rule) or a rule to match.
.TP
-.B "-R, --replace"
-Replace a rule in the selected chain. If the source and/or
-destination names resolve to multiple addresses, the command will
-fail. Rules are numbered starting at 1.
-.TP
.B "-I, --insert"
Insert one or more rules in the selected chain as the given rule
number. So, if the rule number is 1, the rule or rules are inserted
at the head of the chain. This is also the default if no rule number
is specified.
.TP
-.B "-L, --list"
+.BI "-R, --replace " "chain rulenum rule-specification"
+Replace a rule in the selected chain. If the source and/or
+destination names resolve to multiple addresses, the command will
+fail. Rules are numbered starting at 1.
+.TP
+.BR "-L, --list " "[\fIchain\fP]"
List all rules in the selected chain. If no chain is selected, all
-chains are listed. It is legal to specify the
+chains are listed. As every other iptables command, it applies to the
+specified table (filter is the default), so NAT rules get listed by
+.br
+ iptables -t nat -n -L
+.br
+Please note that it is often used with the
+.B -n
+option, in order to avoid long reverse DNS lookups.
+It is legal to specify the
.B -Z
(zero) option as well, in which case the chain(s) will be atomically
listed and zeroed. The exact output is affected by the other
arguments given.
.TP
-.B "-F, --flush"
-Flush the selected chain. This is equivalent to deleting all the
-rules one by one.
+.BR "-F, --flush " "[\fIchain\fP]"
+Flush the selected chain (all the chains in the table if none is given).
+This is equivalent to deleting all the rules one by one.
.TP
-.B "-Z, --zero"
+.BR "-Z, --zero " "[\fIchain\fP]"
Zero the packet and byte counters in all chains. It is legal to
specify the
.B "-L, --list"
(list) option as well, to see the counters immediately before they are
cleared. (See above.)
.TP
-.B "-N, --new-chain"
+.BI "-N, --new-chain " "chain"
Create a new user-defined chain by the given name. There must be no
target of that name already.
.TP
-.B "-X, --delete-chain"
-Delete the specified user-defined chain. There must be no references
+.BR "-X, --delete-chain " "[\fIchain\fP]"
+Delete the optional user-defined chain specified. There must be no references
to the chain. If there are, you must delete or replace the referring
rules before the chain can be deleted. If no argument is given, it
will attempt to delete every non-builtin chain in the table.
.TP
-.B "-P, --policy"
+.BI "-P, --policy " "chain target"
Set the policy for the chain to the given target. See the section
.B TARGETS
-for the legal targets. Only non-user-defined chains can have policies,
-and neither built-in nor user-defined chains can be policy targets.
+for the legal targets. Only built-in (non-user-defined) chains can have
+policies, and neither built-in nor user-defined chains can be policy
+targets.
.TP
-.B "-E, --rename-chain"
+.B "-E, --rename-chain " "old-chain new-chain"
Rename the user specified chain to the user supplied name. This is
cosmetic, and has no effect on the structure of the table.
.TP
@@ -200,7 +219,9 @@ option is omitted.
.BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]"
Source specification.
.I Address
-can be either a hostname, or a plain IPv6 address (the network name doesn't supported now).
+can be either a hostname (please note that specifying any name to be
+resolved with a remote query such as DNS is a really bad idea),
+or a plain IPv6 address (the network name isn't supported now).
The
.I mask
can be either a network mask or a plain number,
@@ -212,7 +233,7 @@ is equivalent to
A "!" argument before the address specification inverts the sense of
the address. The flag
.B --src
-is a convenient alias for this option.
+is an alias for this option.
.TP
.BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]"
Destination specification.
@@ -233,8 +254,8 @@ option is omitted in a rule, then matching the rule will have no
effect on the packet's fate, but the counters on the rule will be
incremented.
.TP
-.BR "-i, --in-interface " "[!] [\fIname\fP]"
-Optional name of an interface via which a packet is received (for
+.BR "-i, --in-interface " "[!] \fIname\fP"
+Name of an interface via which a packet is going to be received (only for
packets entering the
.BR INPUT ,
.B FORWARD
@@ -243,20 +264,18 @@ and
chains). When the "!" argument is used before the interface name, the
sense is inverted. If the interface name ends in a "+", then any
interface which begins with this name will match. If this option is
-omitted, the string "+" is assumed, which will match with any
-interface name.
+omitted, any interface name will match.
.TP
-.BR "-o, --out-interface " "[!] [\fIname\fP]"
-Optional name of an interface via which a packet is going to
-be sent (for packets entering the
+.BR "-o, --out-interface " "[!] \fIname\fP"
+Name of an interface via which a packet is going to be sent (for packets
+entering the
.BR FORWARD
and
.B OUTPUT
-chains). When the "!" argument is used before the interface name,
-the sense is inverted. If the interface name ends in a "+", then any
+chains). When the "!" argument is used before the interface name, the
+sense is inverted. If the interface name ends in a "+", then any
interface which begins with this name will match. If this option is
-omitted, the string "+" is assumed, which will match with any
-interface name.
+omitted, any interface name will match.
.TP
.\" Currently not supported (header-based)
.\"
@@ -274,7 +293,7 @@ counters of a rule (during
.B INSERT,
.B APPEND,
.B REPLACE
-operations)
+operations).
.SS "OTHER OPTIONS"
The following additional options can be specified:
.TP
@@ -308,7 +327,7 @@ command.
When listing rules, add line numbers to the beginning of each rule,
corresponding to that rule's position in the chain.
.TP
-.B "--modprobe=<command>"
+.B "--modprobe=command"
When adding or inserting rules into a chain, use
.B command
to load any necessary modules (targets, match extensions, etc).
@@ -324,7 +343,8 @@ or
.B --match
options, followed by the matching module name; after these, various
extra command line options become available, depending on the specific
-module. You can specify multiple extended match modules in one line, and you can use the
+module. You can specify multiple extended match modules in one line,
+and you can use the
.B -h
or
.B --help
@@ -339,7 +359,7 @@ to invert the sense of the match.
These extensions are loaded if `--protocol tcp' is specified. It
provides the following options:
.TP
-.BR "--source-port " "[!] [\fIport[:port]\fP]"
+.BR "--source-port " "[!] \fIport\fP[:\fIport\fP]"
Source port or port range specification. This can either be a service
name or a port number. An inclusive range can also be specified,
using the format
@@ -349,12 +369,12 @@ If the first port is omitted, "0" is assumed; if the last is omitted,
If the second port greater then the first they will be swapped.
The flag
.B --sport
-is an alias for this option.
+is a convenient alias for this option.
.TP
-.BR "--destination-port " "[!] [\fIport[:port]\fP]"
-Destination port or port range specification. The flag
+.BR "--destination-port " "[!] \fIport\fP[:\fIport\fP]"
+Destination port or port range specification. The flag
.B --dport
-is an alias for this option.
+is a convenient alias for this option.
.TP
.BR "--tcp-flags " "[!] \fImask\fP \fIcomp\fP"
Match when the TCP flags are as specified. The first argument is the
@@ -385,13 +405,13 @@ Match if TCP option set.
These extensions are loaded if `--protocol udp' is specified. It
provides the following options:
.TP
-.BR "--source-port " "[!] [\fIport[:port]\fP]"
+.BR "--source-port " "[!] \fIport\fP[:\fIport\fP]"
Source port or port range specification.
See the description of the
.B --source-port
option of the TCP extension for details.
.TP
-.BR "--destination-port " "[!] [\fIport[:port]\fP]"
+.BR "--destination-port " "[!] \fIport\fP[:\fIport\fP]"
Destination port or port range specification.
See the description of the
.B --destination-port
@@ -410,18 +430,19 @@ IPv6-ICMP type, or one of the IPv6-ICMP type names shown by the command
.TP
.BR "--mac-source " "[!] \fIaddress\fP"
Match source MAC address. It must be of the form XX:XX:XX:XX:XX:XX.
-Note that this only makes sense for packets entering the
+Note that this only makes sense for packets coming from an Ethernet device
+and entering the
.BR PREROUTING ,
.B FORWARD
or
.B INPUT
-chains for packets coming from an ethernet device.
+chains.
.SS limit
-This module matches at a limited rate using a token bucket filter: it
-can be used in combination with the
+This module matches at a limited rate using a token bucket filter.
+A rule using this extension will match until this limit is reached
+(unless the `!' flag is used). It can be used in combination with the
.B LOG
-target to give limited logging. A rule using this extension will
-match until this limit is reached (unless the `!' flag is used).
+target to give limited logging, for example.
.TP
.BI "--limit " "rate"
Maximum average matching rate: specified as a number, with an optional
@@ -429,23 +450,27 @@ Maximum average matching rate: specified as a number, with an optional
3/hour.
.TP
.BI "--limit-burst " "number"
-The maximum initial number of packets to match: this number gets
+Maximum initial number of packets to match: this number gets
recharged by one every time the limit specified above is not reached,
up to this number; the default is 5.
.SS multiport
-This module matches a set of source or destination ports. Up to 15
-ports can be specified. It can only be used in conjunction with
+This module matches a set of source or destination ports. Up to 15
+ports can be specified. It can only be used in conjunction with
.B "-p tcp"
or
.BR "-p udp" .
.TP
-.BR "--source-port" " [\fIport[,port]\fP]"
-Match if the source port is one of the given ports.
+.BR "--source-ports " "\fIport\fP[,\fIport\fP[,\fIport\fP...]]"
+Match if the source port is one of the given ports. The flag
+.B --sports
+is a convenient alias for this option.
.TP
-.BR "--destination-port" " [\fIport[,port]\fP]"
-Match if the destination port is one of the given ports.
+.BR "--destination-ports " "\fIport\fP[,\fIport\fP[,\fIport\fP...]]"
+Match if the destination port is one of the given ports. The flag
+.B --dports
+is a convenient alias for this option.
.TP
-.BR "--port" " [\fIport[,port]\fP]"
+.BR "--ports " "\fIport\fP[,\fIport\fP[,\fIport\fP...]]"
Match if the both the source and destination ports are equal to each
other and to one of the given ports.
.SS mark
@@ -454,7 +479,7 @@ This module matches the netfilter mark field associated with a packet
.B MARK
target below).
.TP
-.BI "--mark " "value[/mask]"
+.BR "--mark " "\fIvalue\fP[/\fImask\fP]"
Matches packets with the given unsigned mark value (if a mask is
specified, this is logically ANDed with the mask before the
comparison).
@@ -463,7 +488,7 @@ This module attempts to match various characteristics of the packet
creator, for locally-generated packets. It is only valid in the
.B OUTPUT
chain, and even this some packets (such as ICMP ping responses) may
-have no owner, and hence never match.
+have no owner, and hence never match. This is regarded as experimental.
.TP
.BI "--uid-owner " "userid"
Matches if the packet was created by a process with the given
@@ -513,9 +538,9 @@ group.
.\" iptables -m tos -h
.\" .br
.\" to see the list), or a numeric value to match.
-.\" .SH TARGET EXTENSIONS
-.\" iptables can use extended target modules: the following are included
-.\" in the standard distribution.
+.SH TARGET EXTENSIONS
+ip6tables can use extended target modules: the following are included
+in the standard distribution.
.SS LOG
Turn on kernel logging of matching packets. When this option is set
for a rule, the Linux kernel will print some information on all
@@ -524,6 +549,10 @@ matching packets (like most IPv6 IPv6-header fields) via the kernel log
.I dmesg
or
.IR syslogd (8)).
+This is a "non-terminating target", i.e. rule traversal continues at
+the next rule. So if you want to LOG the packets you refuse, use two
+separate rules with the same matching criterias, first using target LOG
+then DROP (or REJECT).
.TP
.BI "--log-level " "level"
Level of logging (numeric or see \fIsyslog.conf\fP(5)).
@@ -551,14 +580,15 @@ table.
.SS REJECT
This is used to send back an error packet in response to the matched
packet: otherwise it is equivalent to
-.BR DROP .
+.B DROP
+so it is a terminating TARGET, ending rule traversal.
This target is only valid in the
.BR INPUT ,
.B FORWARD
and
.B OUTPUT
chains, and user-defined chains which are only called from those
-chains. Several options control the nature of the error packet
+chains. The following option controls the nature of the error packet
returned:
.TP
.BI "--reject-with " "type"
@@ -571,14 +601,14 @@ The type given can be
.BR addr-unreach ,
.BR icmp6-port-unreachable ,
.BR port-unreach ,
-which return the appropriate IPv6-ICMP error message (port-unreach is
+which return the appropriate IPv6-ICMP error message (\fBport-unreach\fP is
the default). Finally, the option
.B tcp-reset
can be used on rules which only match the TCP protocol: this causes a
TCP RST packet to be sent back. This is mainly useful for blocking
.I ident
-probes which frequently occur when sending mail to broken mail hosts
-(which won't accept your mail otherwise).
+(113/tcp) probes which frequently occur when sending mail to broken mail
+hosts (which won't accept your mail otherwise).
.\" .SS TOS
.\" This is used to set the 8-bit Type of Service field in the IP header.
.\" It is only valid in the
@@ -613,7 +643,7 @@ probes which frequently occur when sending mail to broken mail hosts
.\" modified (and all future packets in this connection will also be
.\" mangled), and rules should cease being examined. It takes one option:
.\" .TP
-.\" .BI "--to-source " "<ipaddr>[-<ipaddr>][:port-port]"
+.\" .BR "--to-source " "\fIipaddr\fP[-\fIipaddr\fP][:\fIport\fP-\fIport\fP]"
.\" which can specify a single new source IP address, an inclusive range
.\" of IP addresses, and optionally, a port range (which is only valid if
.\" the rule also specifies
@@ -637,7 +667,7 @@ probes which frequently occur when sending mail to broken mail hosts
.\" also be mangled), and rules should cease being examined. It takes one
.\" option:
.\" .TP
-.\" .BI "--to-destination " "<ipaddr>[-<ipaddr>][:port-port]"
+.\" .BR "--to-destination " "\fIipaddr\fP[-\fIipaddr\fP][:\fIport\fP-\fIport\fP]"
.\" which can specify a single new destination IP address, an inclusive
.\" range of IP addresses, and optionally, a port range (which is only
.\" valid if the rule also specifies
@@ -661,14 +691,14 @@ probes which frequently occur when sending mail to broken mail hosts
.\" next dialup is unlikely to have the same interface address (and hence
.\" any established connections are lost anyway). It takes one option:
.\" .TP
-.\" .BI "--to-ports " "<port>[-<port>]"
+.\" .BR "--to-ports " "\fIport\fP[-\fIport\fP]"
.\" This specifies a range of source ports to use, overriding the default
.\" .B SNAT
-.\" source port-selection heuristics (see above). This is only valid with
+.\" source port-selection heuristics (see above). This is only valid
.\" if the rule also specifies
.\" .B "-p tcp"
.\" or
-.\" .BR "-p udp" ).
+.\" .BR "-p udp" .
.\" .SS REDIRECT
.\" This target is only valid in the
.\" .B nat
@@ -681,13 +711,13 @@ probes which frequently occur when sending mail to broken mail hosts
.\" the machine itself (locally-generated packets are mapped to the
.\" 127.0.0.1 address). It takes one option:
.\" .TP
-.\" .BI "--to-ports " "<port>[-<port>]"
-.\" This specifies a destination port or range or ports to use: without
-.\" this, the destination port is never altered. This is only valid with
+.\" .BR "--to-ports " "\fIport\fP[-\fIport\fP]"
+.\" This specifies a destination port or range of ports to use: without
+.\" this, the destination port is never altered. This is only valid
.\" if the rule also specifies
.\" .B "-p tcp"
.\" or
-.\" .BR "-p udp" ).
+.\" .BR "-p udp" .
.\" .SH EXTRA EXTENSIONS
.\" The following extensions are not included by default in the standard
.\" distribution.
@@ -718,23 +748,23 @@ probes which frequently occur when sending mail to broken mail hosts
.\" socket. One or more userspace processes may then subscribe to various
.\" multicast groups and receive the packets.
.\" .TP
-.\" .BI "--ulog-nlgroup " "<nlgroup>"
+.\" .BI "--ulog-nlgroup " "nlgroup"
.\" This specifies the netlink group (1-32) to which the packet is sent.
.\" Default value is 1.
.\" .TP
-.\" .BI "--ulog-prefix " "<prefix>"
+.\" .BI "--ulog-prefix " "prefix"
.\" Prefix log messages with the specified prefix; up to 32 characters
.\" long, and useful fro distinguishing messages in the logs.
.\" .TP
-.\" .BI "--ulog-cprange " "<size>"
+.\" .BI "--ulog-cprange " "size"
.\" Number of bytes to be copied to userspace. A value of 0 always copies
-.\" the entire packet, regardless of its size. Default is 0
+.\" the entire packet, regardless of its size. Default is 0.
.\" .TP
-.\" .BI "--ulog-qthreshold " "<size>"
+.\" .BI "--ulog-qthreshold " "size"
.\" Number of packet to queue inside kernel. Setting this value to, e.g. 10
.\" accumulates ten packets inside the kernel and transmits them as one
-.\" netlink multipart message to userspace. Default is 1 (for backwards
-.\" compatibility)
+.\" netlink multipart message to userspace. Default is 1 (for backwards
+.\" compatibility).
.SH DIAGNOSTICS
Various error messages are printed to standard error. The exit code
is 0 for correct functioning. Errors which appear to be caused by
@@ -778,9 +808,12 @@ chain.
.\" .br
There are several other changes in ip6tables.
.SH SEE ALSO
-The packet-filtering-HOWTO, which details more iptables usage for packet filtering,
-and the netfilter-hacking-HOWTO which details the
-internals.
+The packet-filtering-HOWTO, which details more iptables usage for
+packet filtering, the NAT-HOWTO, which details NAT,
+and the netfilter-hacking-HOWTO which details the internals.
+.br
+See
+.BR "http://www.netfilter.org/" .
.SH AUTHORS
Rusty Russell wrote iptables, in early consultation with Michael
Neuling.
@@ -797,6 +830,10 @@ Harald Welte wrote the ULOG target, TTL match+target and libipulog.
.PP
The Netfilter Core Team is: Marc Boucher, Jozsef Kadlecsik, James Morris,
Harald Welte and Rusty Russell.
+.PP
+ip6tables man page created by Andras Kis-Szabo, based on
+iptables man page written by Herve Eychenne <rv@wallfire.org>.
+
.\" .. and did I mention that we are incredibly cool people?
.\" .. sexy, too ..
.\" .. witty, charming, powerful ..