.\" all rights reserved.
.\" Translated 2013-04-08, Akihiro MOTOKI <amotoki@gmail.com>
.\"
-.TH iptables\-extensions 8 "" "iptables 1.4.18" "iptables 1.4.18"
+.TH iptables\-extensions 8 "" "iptables 1.4.21" "iptables 1.4.21"
.SH 名前
iptables\-extensions \(em 標準の iptables に含まれる拡張モジュールのリスト
.SH 書式
このモジュールは IPsec パケットの認証ヘッダー (AH) の SPI 値にマッチする。
.TP
[\fB!\fP] \fB\-\-ahspi\fP \fIspi\fP[\fB:\fP\fIspi\fP]
+.SS bpf
+Match using Linux Socket Filter. Expects a BPF program in decimal
+format. This is the format generated by the \fBnfbpf_compile\fP utility.
+.TP
+\fB\-\-bytecode\fP \fIcode\fP
+Pass the BPF byte code format (described in the example below).
+.PP
+The code format is similar to the output of the tcpdump \-ddd command: one
+line that stores the number of instructions, followed by one line for each
+instruction. Instruction lines follow the pattern 'u16 u8 u8 u32' in decimal
+notation. Fields encode the operation, jump offset if true, jump offset if
+false and generic multiuse field 'K'. Comments are not supported.
+.PP
+For example, to read only packets matching 'ip proto 6', insert the
+following, without the comments or trailing whitespace:
+.IP
+4 # number of instructions
+.br
+48 0 0 9 # load byte ip\->proto
+.br
+21 0 1 6 # jump equal IPPROTO_TCP
+.br
+6 0 0 1 # return pass (non\-zero)
+.br
+6 0 0 0 # return fail (zero)
+.PP
+You can pass this filter to the bpf match with the following command:
+.IP
+iptables \-A OUTPUT \-m bpf \-\-bytecode '4,48 0 0 9,21 0 1 6,6 0 0 1,6 0 0 0'
+\-j ACCEPT
+.PP
+Or instead, you can invoke the nfbpf_compile utility.
+.IP
+iptables \-A OUTPUT \-m bpf \-\-bytecode "`nfbpf_compile RAW 'ip proto 6'`" \-j
+ACCEPT
+.PP
+You may want to learn more about BPF from FreeBSD's bpf(4) manpage.
.SS cluster
このモジュールを使うと、負荷分散装置なしで、ゲートウェイとバックエンドの負荷分散クラスターを配備できる。
.PP
arptables \-A INPUT \-i eth2 \-\-h\-length 6 \-\-destination\-mac 01:00:5e:00:01:02
\-j mangle \-\-mangle\-mac\-d 00:zz:yy:xx:5a:27
.PP
+\fBNOTE\fP: the arptables commands above use mainstream syntax. If you are
+using arptables\-jf included in some RedHat, CentOS and Fedora versions, you
+will hit syntax errors. Therefore, you'll have to adapt these to the
+arptables\-jf syntax to get them working.
+.PP
TCP 接続の場合には、応答方向で受信した TCP ACK パケットが有効とマークされないようにするため、ピックアップ (pickup)
機能を無効する必要がある。
.IP
.TP
サブネットに対するマッチ
"10.0.0.0/8 内の /28 サブネット (アドレス 8 個のグループ) それぞれに対して 10000 パケット/秒" => \-s
-10.0.0.8 \-\-hashlimit\-mask 28 \-\-hashlimit\-upto 10000/min
+10.0.0.0/8 \-\-hashlimit\-mask 28 \-\-hashlimit\-upto 10000/min
.TP
バイト/秒によるマッチ
"512kbyte/s を超過したフロー" => \-\-hashlimit\-mode srcip,dstip,srcport,dstport
Mobility Header (MH) タイプを指定できる。 タイプ指定には、 数値の MH タイプか、 以下のコマンドで表示される MH
タイプ名を指定できる。
.nf
- ip6tables \-p ipv6\-mh \-h
+ ip6tables \-p mh \-h
.fi
.SS multiport
-このモジュールは送信元ポートや宛先ポートの集合にマッチする。 ポートは 15 個まで指定できる。 ポートの範囲指定 (port:port) は 2
-ポートとカウントされる。 このモジュールが使用できるのは \fB\-p tcp\fP か \fB\-p udp\fP と組み合わせた場合だけである。
+This module matches a set of source or destination ports. Up to 15 ports
+can be specified. A port range (port:port) counts as two ports. It can
+only be used in conjunction with one of the following protocols: \fBtcp\fP,
+\fBudp\fP, \fBudplite\fP, \fBdccp\fP and \fBsctp\fP.
.TP
[\fB!\fP] \fB\-\-source\-ports\fP,\fB\-\-sports\fP \fIport\fP[\fB,\fP\fIport\fP|\fB,\fP\fIport\fP\fB:\fP\fIport\fP]...
送信元ポートが指定されたポートのいずれにマッチする。 フラグ \fB\-\-sports\fP はこのオプションの便利な別名である。
\fB\-\-rdest\fP
recent リストのテーブルの照合/保存で、各パケットの宛先アドレスを使う。
.TP
-\fB\-\-mask\fPnetmask
+\fB\-\-mask\fP \fInetmask\fP
この recent リストに適用するネットマスク。
.TP
[\fB!\fP] \fB\-\-rcheck\fP
iptables \-A FORWARD \-p tcp \-i eth0 \-\-dport 139 \-m recent \-\-name badguy \-\-set
\-j DROP
.PP
-Steve の ipt_recent ウェブサイト (http://snowman.net/projects/ipt_recent/)
-にも使用例がいくつかある。
-.PP
\fB/proc/net/xt_recent/*\fP は現在のアドレスのリストと各リストの各エントリーの情報である。
.PP
\fB/proc/net/xt_recent/\fP の各ファイルは、読み出して現在のリストを確認することができる。 また、以下のコマンドを使って、
the command will match packets for which the source address can be found in
the specified set.
.TP
-\fB\-\-return\-\-nomatch\fP
-If the \fB\-\-return\-\-nomatch\fP option is specified and the set type supports
-the \fBnomatch\fP flag, then the matching is reversed: a match with an element
+\fB\-\-return\-nomatch\fP
+If the \fB\-\-return\-nomatch\fP option is specified and the set type supports the
+\fBnomatch\fP flag, then the matching is reversed: a match with an element
flagged with \fBnomatch\fP returns \fBtrue\fP, while a match with a plain element
returns \fBfalse\fP.
+.TP
+\fB!\fP \fB\-\-update\-counters\fP
+If the \fB\-\-update\-counters\fP flag is negated, then the packet and byte
+counters of the matching element in the set won't be updated. Default the
+packet and byte counters are updated.
+.TP
+\fB!\fP \fB\-\-update\-subcounters\fP
+If the \fB\-\-update\-subcounters\fP flag is negated, then the packet and byte
+counters of the matching element in the member set of a list type of set
+won't be updated. Default the packet and byte counters are updated.
+.TP
+[\fB!\fP] \fB\-\-packets\-eq\fP \fIvalue\fP
+If the packet is matched an element in the set, match only if the packet
+counter of the element matches the given value too.
+.TP
+\fB\-\-packets\-lt\fP \fIvalue\fP
+If the packet is matched an element in the set, match only if the packet
+counter of the element is less than the given value as well.
+.TP
+\fB\-\-packets\-gt\fP \fIvalue\fP
+If the packet is matched an element in the set, match only if the packet
+counter of the element is greater than the given value as well.
+.TP
+[\fB!\fP] \fB\-bytes\-eq\fP \fIvalue\fP
+If the packet is matched an element in the set, match only if the byte
+counter of the element matches the given value too.
+.TP
+\fB\-\-bytes\-lt\fP \fIvalue\fP
+If the packet is matched an element in the set, match only if the byte
+counter of the element is less than the given value as well.
+.TP
+\fB\-\-bytes\-gt\fP \fIvalue\fP
+If the packet is matched an element in the set, match only if the byte
+counter of the element is greater than the given value as well.
+.PP
+The packet and byte counters related options and flags are ignored when the
+set was defined without counter support.
.PP
The option \fB\-\-match\-set\fP can be replaced by \fB\-\-set\fP if that does not clash
with an option of other extensions.
Use of \-m set requires that ipset kernel support is provided, which, for
standard kernels, is the case since Linux 2.6.39.
.SS socket
-This matches if an open socket can be found by doing a socket lookup on the
-packet.
+This matches if an open TCP/UDP socket can be found by doing a socket lookup
+on the packet. It matches if there is an established or non\-zero bound
+listening socket (possibly with a non\-local address). The lookup is
+performed using the \fBpacket\fP tuple of TCP/UDP packets, or the original
+TCP/UDP header \fBembedded\fP in an ICMP/ICPMv6 error packet.
.TP
\fB\-\-transparent\fP
非透過 (non\-transparent) ソケットを無視する。
+.TP
+\fB\-\-nowildcard\fP
+Do not ignore sockets bound to 'any' address. The socket match won't accept
+zero\-bound listeners by default, since then local services could intercept
+traffic that would otherwise be forwarded. This option therefore has
+security implications when used to match traffic being forwarded to redirect
+such packets to local machine with policy routing. When using the socket
+match to implement fully transparent proxies bound to non\-local addresses it
+is recommended to use the \-\-transparent option instead.
+.PP
+Example (assuming packets with mark 1 are delivered locally):
+.IP
+\-t mangle \-A PREROUTING \-m socket \-\-transparent \-j MARK \-\-set\-mark 1
.SS state
"state" 拡張は "conntrack" モジュールのサブセットである。 "state" を使うと、
パケットについてのコネクション追跡状態を参照できる。
.TP
[\fB!\fP] \fB\-\-hex\-string\fP \fIpattern\fP
指定された 16 進表記のパターンにマッチする。
+.TP
+例:
+.IP
+# The string pattern can be used for simple text characters.
+.br
+iptables \-A INPUT \-p tcp \-\-dport 80 \-m string \-\-algo bm \-\-string 'GET
+/index.html' \-j LOG
+.IP
+# The hex string pattern can be used for non\-printable characters, like |0D
+0A| or |0D0A|.
+.br
+iptables \-p udp \-\-dport 53 \-m string \-\-algo bm \-\-from 40 \-\-to 57
+\-\-hex\-string '|03|www|09|netfilter|03|org|00|'
.SS tcp
これらの拡張は `\-\-protocol tcp' が指定され場合に使用できる。 以下のオプションが提供される:
.TP
Use the timeout policy identified by \fIname\fP for the connection. This is
provides more flexible timeout policy definition than global timeout values
available at /proc/sys/net/netfilter/nf_conntrack_*_timeout_*.
-.SS "DNAT (IPv4 の場合)"
+.SS DNAT
このターゲットは \fBnat\fP テーブルの \fBPREROUTING\fP, \fBOUTPUT\fP チェイン、 これらのチェインから呼び出される
ユーザー定義チェインのみで有効である。 このターゲットはパケットの宛先アドレスを修正する (このコネクションの以降のパケットも修正して分からなく
-(mangle) ã\81\99ã\82\8b)ã\80\82 ã\81\95ã\82\89ã\81«ã\80\81 ã\83«ã\83¼ã\83«ã\81«ã\82\88ã\82\8bã\83\81ã\82§ã\83\83ã\82¯ã\82\92æ¢ã\82\81ã\81\95ã\81\9bã\82\8bã\80\82 ã\81\93ã\81®ã\82¿ã\83¼ã\82²ã\83\83ã\83\88ã\81«ã\81¯ã\82ªã\83\97ã\82·ã\83§ã\83³ã\81\8c 1 種é¡\9eã\81\82ã\82\8b:
+(mangle) ã\81\99ã\82\8b)ã\80\82 ã\81\95ã\82\89ã\81«ã\80\81 ã\83«ã\83¼ã\83«ã\81«ã\82\88ã\82\8bã\83\81ã\82§ã\83\83ã\82¯ã\82\92æ¢ã\82\81ã\81\95ã\81\9bã\82\8bã\80\82 ã\81\93ã\81®ã\82¿ã\83¼ã\82²ã\83\83ã\83\88ã\81¯ä»¥ä¸\8bã\81®ã\82ªã\83\97ã\82·ã\83§ã\83³ã\82\92å\8f\96ã\82\8bã\80\82
.TP
\fB\-\-to\-destination\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
-1 つの新しい宛先 IP アドレス、 または IP アドレスの範囲が指定できる。 ポートの範囲を指定することもできる (これはルールで \fB\-p
-tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効)。 ポートの範囲が指定されていない場合、 宛先ポートは変更されない。 IP
-アドレスが指定されなかった場合は、 宛先ポートだけが変更される。
-
-2.6.10 以前のカーネルでは、 複数の \-\-to\-destination オプションを指定することができる。 これらのカーネルでは、
-アドレスの範囲指定や \-\-to\-destination オプションの複数回指定により 2 つ以上の宛先アドレスを指定した場合、
-それらのアドレスを使った単純なラウンドロビンによる負荷分散が行われる。 それ以降のカーネル (>= 2.6.11\-rc1) には複数の範囲を
-NAT する機能は存在しない。
+which can specify a single new destination IP address, an inclusive range of
+IP addresses. Optionally a port range, if the rule also specifies one of the
+following protocols: \fBtcp\fP, \fBudp\fP, \fBdccp\fP or \fBsctp\fP. If no port range
+is specified, then the destination port will never be modified. If no IP
+address is specified then only the destination port will be modified. In
+Kernels up to 2.6.10 you can add several \-\-to\-destination options. For those
+kernels, if you specify more than one destination address, either via an
+address range or multiple \-\-to\-destination options, a simple round\-robin
+(one after another in cycle) load balancing takes place between these
+addresses. Later Kernels (>= 2.6.11\-rc1) don't have the ability to NAT
+to multiple ranges anymore.
.TP
\fB\-\-random\fP
If option \fB\-\-random\fP is used then port mapping will be randomized (kernel
Gives a client the same source\-/destination\-address for each connection.
This supersedes the SAME target. Support for persistent mappings is
available from 2.6.29\-rc2.
+.TP
+IPv6 support available since Linux kernels >= 3.7.
+.SS "DNPT (IPv6 の場合)"
+Provides stateless destination IPv6\-to\-IPv6 Network Prefix Translation (as
+described by RFC 6296).
+.PP
+You have to use this target in the \fBmangle\fP table, not in the \fBnat\fP
+table. It takes the following options:
+.TP
+\fB\-\-src\-pfx\fP [\fIprefix/\fP\fIlength]\fP
+Set source prefix that you want to translate and length
+.TP
+\fB\-\-dst\-pfx\fP [\fIprefix/\fP\fIlength]\fP
+Set destination prefix that you want to use in the translation and length
+.PP
+You have to use the SNPT target to undo the translation. Example:
+.IP
+ip6tables \-t mangle \-I POSTROUTING \-s fd00::/64 \! \-o vboxnet0 \-j SNPT
+\-\-src\-pfx fd00::/64 \-\-dst\-pfx 2001:e20:2000:40f::/64
+.IP
+ip6tables \-t mangle \-I PREROUTING \-i wlan0 \-d 2001:e20:2000:40f::/64 \-j DNPT
+\-\-src\-pfx 2001:e20:2000:40f::/64 \-\-dst\-pfx fd00::/64
+.PP
+You may need to enable IPv6 neighbor proxy:
+.IP
+sysctl \-w net.ipv6.conf.all.proxy_ndp=1
+.PP
+You also have to use the \fBNOTRACK\fP target to disable connection tracking
+for translated flows.
.SS DSCP
このターゲットは、 IPv4 パケットの TOS ヘッダーにある DSCP ビットの値の書き換えを可能にする。 これはパケットを操作するので、
mangle テーブルでのみ使用できる。
.TP
Then attach the new trigger to an LED:
echo netfilter\-ssh >/sys/class/leds/\fIledname\fP/trigger
-.SS "LOG (IPv6 の場合)"
-マッチしたパケットをカーネルログに記録する。 このオプションがルールに対して設定されると、 Linux カーネルはマッチしたパケットについての
-(IPv6 における大部分の IPv6 ヘッダーフィールドのような) 何らかの情報を カーネルログに表示する (カーネルログは \fIdmesg\fP または
-\fIsyslogd\fP(8) で見ることができる)。 これは「非終了タ ーゲット」である。 すなわち、 ルールの探索は、 次のルールへと継続される。
-よって、 拒否するパケットをログ記録したければ、 同じマッチング判断基準を持つ 2 つのルールを使用し、 最初のルールで LOG ターゲットを、
-次のルールで DROP (または REJECT) ターゲットを指定する。
-.TP
-\fB\-\-log\-level\fP \fIlevel\fP
-Level of logging, which can be (system\-specific) numeric or a mnemonic.
-Possible values are (in decreasing order of priority): \fBemerg\fP, \fBalert\fP,
-\fBcrit\fP, \fBerror\fP, \fBwarning\fP, \fBnotice\fP, \fBinfo\fP or \fBdebug\fP.
-.TP
-\fB\-\-log\-prefix\fP \fIprefix\fP
-指定したプレフィックスをログメッセージの前に付ける。
-プレフィックスは 29 文字までの長さで、
-ログの中でメッセージを区別するのに役立つ。
-.TP
-\fB\-\-log\-tcp\-sequence\fP
-TCP シーケンス番号をログに記録する。 ログがユーザーから読める場合、 セキュリティ上の危険がある。
-.TP
-\fB\-\-log\-tcp\-options\fP
-TCP パケットヘッダーのオプションをログに記録する。
-.TP
-\fB\-\-log\-ip\-options\fP
-IPv6 パケットヘッダーのオプションをログに記録する。
-.TP
-\fB\-\-log\-uid\fP
-Log the userid of the process which generated the packet.
-.SS "LOG (IPv4 の場合)"
-マッチしたパケットをカーネルログに記録する。 このオプションがルールに対して設定されると、 Linux カーネルはマッチしたパケットについての
-(大部分の IP ヘッダーフィールドのような) 何らかの情報を カーネルログに表示する (カーネルログは \fIdmesg\fP または
-\fIsyslogd\fP(8) で見ることができる)。 これは "非終了ターゲット" である。 すなわち、 ルールの探索は次のルールへと継続される。
-よって、 拒否するパケットをログ記録したければ、 同じマッチング判断基準を持つ 2 つのルールを使用し、 最初のルールで LOG ターゲットを、
-次のルールで DROP (または REJECT) ターゲットを指定する。
+.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 matching packets
+(like most IP/IPv6 header fields) via the kernel log (where it can be read
+with \fIdmesg(1)\fP or read in the syslog).
+.PP
+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 criteria, first using target LOG then DROP (or
+REJECT).
.TP
\fB\-\-log\-level\fP \fIlevel\fP
Level of logging, which can be (system\-specific) numeric or a mnemonic.
TCP パケットヘッダーのオプションをログに記録する。
.TP
\fB\-\-log\-ip\-options\fP
-IP パケットヘッダーのオプションをログに記録する。
+IP/IPv6 パケットヘッダーのオプションをログに記録する。
.TP
\fB\-\-log\-uid\fP
Log the userid of the process which generated the packet.
\fB\-\-xor\-mark\fP \fIbits\fP
Binary XOR the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP
\fIbits\fP\fB/0\fP.)
-.SS "MASQUERADE (IPv6 の場合)"
-このターゲットは \fBnat\fP テーブルの \fBPOSTROUTING\fP チェインのみで有効である。 動的割り当て IPv6 (ダイヤルアップ)
-コネクションの場合にのみ使うべきである。 固定 IP アドレスならば、 SNAT ターゲットを使うべきである。 マスカレーディングは、
-パケットが送信されるインターフェースの IP アドレスへのマッピングを指定するのと同じであるが、
-インターフェースが停止した場合にコネクションを\fI忘れる\fPという効果がある。 次のダイヤルアップでは同じインターフェースアドレスになる可能性が低い
-(そのため、 前回確立されたコネクションは失われる) 場合、 この動作は正しい。
-.TP
-\fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP]
-このオプションは、 使用する送信元ポートの範囲を指定し、 デフォルトの \fBSNAT\fP 送信元ポートの選択方法 (上記) よりも優先される。 ルールが
-\fB\-p tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
-.TP
-\fB\-\-random\fP
-Randomize source port mapping If option \fB\-\-random\fP is used then port
-mapping will be randomized.
-.RS
-.PP
-.SS "MASQUERADE (IPv4 の場合)"
+.SS MASQUERADE
このターゲットは \fBnat\fP テーブルの \fBPOSTROUTING\fP チェインのみで有効である。 動的割り当て IP (ダイヤルアップ)
コネクションの場合にのみ使うべきである。 固定 IP アドレスならば、 SNAT ターゲットを使うべきである。 マスカレーディングは、
パケットが送信されるインターフェースの IP アドレスへのマッピングを指定するのと同じであるが、
(そのため、 前回確立されたコネクションは失われる) 場合、 この動作は正しい。
.TP
\fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP]
-このオプションは、 使用する送信元ポートの範囲を指定し、 デフォルトの \fBSNAT\fP 送信元ポートの選択方法 (上記) よりも優先される。 ルールが
-\fB\-p tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
+This specifies a range of source ports to use, overriding the default
+\fBSNAT\fP source port\-selection heuristics (see above). This is only valid if
+the rule also specifies one of the following protocols: \fBtcp\fP, \fBudp\fP,
+\fBdccp\fP or \fBsctp\fP.
.TP
\fB\-\-random\fP
Randomize source port mapping If option \fB\-\-random\fP is used then port
mapping will be randomized (kernel >= 2.6.21).
-.RS
-.PP
+.TP
+IPv6 support available since Linux kernels >= 3.7.
.SS "MIRROR (IPv4 の場合)"
実験的なデモンストレーション用のターゲットであり、 IP ヘッダーの送信元と宛先フィールドを入れ換え、 パケットを再送信するものである。 これは
\fBINPUT\fP, \fBFORWARD\fP, \fBPREROUTING\fP チェインと、 これらのチェインから呼び出される
ユーザー定義チェインだけで有効である。 ループ等の問題を回避するため、 外部に送られるパケットは
いかなるパケットフィルタリングチェイン・コネクション追跡・NAT からも 監視\fBされない\fP。
-.SS "NETMAP (IPv4 の場合)"
+.SS NETMAP
This target allows you to statically map a whole network of addresses onto
another network of addresses. It can only be used from rules in the \fBnat\fP
table.
following way: All 'one' bits in the mask are filled in from the new
`address'. All bits that are zero in the mask are filled in from the
original address.
+.TP
+IPv6 support available since Linux kernels >= 3.7.
.SS NFLOG
このターゲットは、 マッチしたパケットをログに記録する機能を提供する。 このターゲットがルールに設定されると、 Linux
カーネルはそのログに記録するためにそのパケットをロードされたロギングバックエンドに渡す。 このターゲットは通常は nfnetlink_log
ユーザー空間にパケットを送信する前に、カーネル内部のキューに入れるパケット数 (nfnetlink_log の場合のみ利用できる)。
大きめの値を指定するほどパケット単位のオーバヘッドは少なくなるが、 パケットがユーザー空間に届くまでの遅延が大きくなる。 デフォルト値は 1 である。
.SS NFQUEUE
-This target is an extension of the QUEUE target. As opposed to QUEUE, it
-allows you to put a packet into any specific queue, identified by its 16\-bit
-queue number. It can only be used with Kernel versions 2.6.14 or later,
-since it requires the \fBnfnetlink_queue\fP kernel support. The
-\fBqueue\-balance\fP option was added in Linux 2.6.31, \fBqueue\-bypass\fP in
-2.6.39.
+This target passes the packet to userspace using the \fBnfnetlink_queue\fP
+handler. The packet is put into the queue identified by its 16\-bit queue
+number. Userspace can inspect and modify the packet if desired. Userspace
+must then drop or reinject the packet into the kernel. Please see
+libnetfilter_queue for details. \fBnfnetlink_queue\fP was added in Linux
+2.6.14. The \fBqueue\-balance\fP option was added in Linux 2.6.31,
+\fBqueue\-bypass\fP in 2.6.39.
.TP
\fB\-\-queue\-num\fP \fIvalue\fP
This specifies the QUEUE number to use. Valid queue numbers are 0 to
\fB\-\-queue\-bypass\fP
By default, if no userspace program is listening on an NFQUEUE, then all
packets that are to be queued are dropped. When this option is used, the
-NFQUEUE rule is silently bypassed instead. The packet will move on to the
-next rule.
+NFQUEUE rule behaves like ACCEPT instead, and the packet will move on to the
+next table.
+.PP
+.TP
+\fB\-\-queue\-cpu\-fanout\fP
+Available starting Linux kernel 3.10. When used together with
+\fB\-\-queue\-balance\fP this will use the CPU ID as an index to map packets to
+the queues. The idea is that you can improve performance if there's a queue
+per CPU. This requires \fB\-\-queue\-balance\fP to be specified.
.SS NOTRACK
-This target disables connection tracking for all packets matching that
-rule. It is obsoleted by \-j CT \-\-notrack. Like CT, NOTRACK can only be used
-in the \fBraw\fP table.
+This extension disables connection tracking for all packets matching that
+rule. It is equivalent with \-j CT \-\-notrack. Like CT, NOTRACK can only be
+used in the \fBraw\fP table.
.SS RATEEST
The RATEEST target collects statistics, performs rate estimation calculation
and saves the results for later evaluation using the \fBrateest\fP match.
.TP
\fB\-\-rateest\-ewmalog\fP \fIvalue\fP
Rate measurement averaging time constant.
-.SS "REDIRECT (IPv4 の場合)"
-このターゲットは、 \fBnat\fP テーブルの \fBPREROUTING\fP チェインと \fBOUTPUT\fP チェイン、
-およびこれらチェインから呼び出されるユーザー定義チェインでのみ有効である。 このターゲットは、 宛先 IP
-をパケットを受信したインタフェースの最初のアドレスに変更することで、 パケットをそのマシン自身にリダイレクトする (ローカルで生成されたパケットは、
-アドレス 127.0.0.1 にマップされる)。
+.SS REDIRECT
+This target is only valid in the \fBnat\fP table, in the \fBPREROUTING\fP and
+\fBOUTPUT\fP chains, and user\-defined chains which are only called from those
+chains. It redirects the packet to the machine itself by changing the
+destination IP to the primary address of the incoming interface
+(locally\-generated packets are mapped to the localhost address, 127.0.0.1
+for IPv4 and ::1 for IPv6).
.TP
\fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP]
-このオプションは使用される宛先ポート・ポート範囲・複数ポートを指定する。 このオプションが指定されない場合、 宛先ポートは変更されない。 ルールが
-\fB\-p tcp\fP または \fB\-p udp\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 one of the following protocols: \fBtcp\fP, \fBudp\fP, \fBdccp\fP or
+\fBsctp\fP.
.TP
\fB\-\-random\fP
If option \fB\-\-random\fP is used then port mapping will be randomized (kernel
>= 2.6.22).
-.RS
-.PP
+.TP
+IPv6 support available starting Linux kernels >= 3.7.
.SS "REJECT (IPv6 の場合)"
マッチしたパケットの応答としてエラーパケットを送信するために使われる。
エラーパケットを送らなければ、 \fBDROP\fP と同じであり、 TARGET を終了し、
制御する。
.TP
\fB\-\-reject\-with\fP \fItype\fP
-指定できるタイプは \fBicmp6\-no\-route\fP, \fBno\-route\fP, \fBicmp6\-adm\-prohibited\fP,
-\fBadm\-prohibited\fP, \fBicmp6\-addr\-unreachable\fP, \fBaddr\-unreach\fP,
-\fBicmp6\-port\-unreachable\fP, \fBport\-unreach\fP である。 指定したタイプの適切な IPv6
-エラーメッセージが返される (\fBport\-unreach\fP がデフォルトである)。 さらに、 TCP プロトコルにのみマッチするルールに対して、
-オプション \fBtcp\-reset\fP を使うことができる。 このオプションを使うと、 TCP RST パケットが送り返される。 主として
-\fIident\fP (113/tcp) による探査を阻止するのに役立つ。 \fIident\fP による探査は、 壊れている (メールを受け取らない)
-メールホストに メールが送られる場合に頻繁に起こる。 \fBtcp\-reset\fP はバージョン 2.6.14 以降のカーネルでのみ使用できる。
+The type given can be \fBicmp6\-no\-route\fP, \fBno\-route\fP,
+\fBicmp6\-adm\-prohibited\fP, \fBadm\-prohibited\fP, \fBicmp6\-addr\-unreachable\fP,
+\fBaddr\-unreach\fP, or \fBicmp6\-port\-unreachable\fP, which return the appropriate
+ICMPv6 error message (\fBicmp6\-port\-unreachable\fP is the default). Finally,
+the option \fBtcp\-reset\fP 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 \fIident\fP (113/tcp) probes which frequently occur when
+sending mail to broken mail hosts (which won't accept your mail otherwise).
+\fBtcp\-reset\fP can only be used with kernel versions 2.6.14 or later.
.SS "REJECT (IPv4 の場合)"
マッチしたパケットの応答としてエラーパケットを送信するために使われる。
エラーパケットを送らなければ、 \fBDROP\fP と同じであり、 TARGET を終了し、
指定できるタイプは \fBicmp\-net\-unreachable\fP, \fBicmp\-host\-unreachable\fP,
\fBicmp\-port\-unreachable\fP, \fBicmp\-proto\-unreachable\fP, \fBicmp\-net\-prohibited\fP,
\fBicmp\-host\-prohibited\fP, \fBicmp\-admin\-prohibited\fP (*) である。指定したタイプの適切な ICMP
-エラーメッセージを返す (\fBport\-unreachable\fP がデフォルトである)。 TCP プロトコルにのみマッチするルールに対して、 オプション
-\fBtcp\-reset\fP を使うことができる。 このオプションを使うと、 TCP RST パケットが送り返される。 主として \fIident\fP
-(113/tcp) による探査を阻止するのに役立つ。 \fIident\fP による探査は、 壊れている (メールを受け取らない) メールホストに
-メールが送られる場合に頻繁に起こる。
+エラーメッセージを返す (\fBicmp\-port\-unreachable\fP がデフォルトである)。 TCP プロトコルにのみマッチするルールに対して、
+オプション \fBtcp\-reset\fP を使うことができる。 このオプションを使うと、 TCP RST パケットが送り返される。 主として
+\fIident\fP (113/tcp) による探査を阻止するのに役立つ。 \fIident\fP による探査は、 壊れている (メールを受け取らない)
+ã\83¡ã\83¼ã\83«ã\83\9bã\82¹ã\83\88ã\81« ã\83¡ã\83¼ã\83«ã\81\8cé\80\81ã\82\89ã\82\8cã\82\8bå ´å\90\88ã\81«é »ç¹\81ã\81«èµ·ã\81\93ã\82\8bã\80\82
.PP
(*) icmp\-admin\-prohibited をサポートしないカーネルで、 icmp\-admin\-prohibited を使用すると、
REJECT ではなく単なる DROP になる。
エントリを追加する際に、 エントリが存在する場合、 タイムアウト値を、 指定された値か集合定義のデフォルト値にリセットする
.PP
\-j SET を使用するには ipset のカーネルサポートが必要である。 標準のカーネルでは、 Linux 2.6.39 以降で提供されている。
-.SS "SNAT (IPv4 の場合)"
-このターゲットは \fBnat\fP テーブルの \fBPOSTROUTING\fP チェインのみで有効である。
-このターゲットはパケットの送信元アドレスを修正させる (このコネクションの以降のパケットも修正して分からなく (mangle) する)。 さらに、
-ルールが評価を中止するように指示する。 このターゲットにはオプションが 1 種類ある:
+.SS SNAT
+This target is only valid in the \fBnat\fP table, in the \fBPOSTROUTING\fP and
+\fBINPUT\fP chains, and user\-defined chains which are only called from those
+chains. It specifies that the source address of the packet should be
+modified (and all future packets in this connection will also be mangled),
+and rules should cease being examined. It takes the following options:
.TP
\fB\-\-to\-source\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
-1 つの新しい送信元 IP アドレス、 または IP アドレスの範囲が指定できる。 ポートの範囲を指定することもできる (ルールが \fB\-p tcp\fP
-または \fB\-p udp\fP を指定している場合にのみ有効)。 ポートの範囲が指定されていない場合、 512 未満の送信元ポートは、 他の 512
-未満のポートにマッピングされる。 512 〜 1023 までのポートは、 1024 未満のポートにマッピングされる。 それ以外のポートは、 1024
-以上のポートにマッピングされる。 可能であれば、 ポートの変換は起こらない。
-
-2.6.10 以前のカーネルでは、 複数の \-\-to\-source オプションを指定することができる。 これらのカーネルでは、 アドレスの範囲指定や
-\-\-to\-source オプションの複数回指定により 2 つ以上の送信元アドレスを指定した場合、
-それらのアドレスを使った単純なラウンド・ロビンが行われる。 それ以降のカーネル (>= 2.6.11\-rc1) には複数の範囲を NAT
-する機能は存在しない。
+which can specify a single new source IP address, an inclusive range of IP
+addresses. Optionally a port range, if the rule also specifies one of the
+following protocols: \fBtcp\fP, \fBudp\fP, \fBdccp\fP or \fBsctp\fP. If no port range
+is specified, then source ports below 512 will be mapped to other ports
+below 512: those between 512 and 1023 inclusive will be mapped to ports
+below 1024, and other ports will be mapped to 1024 or above. Where possible,
+no port alteration will occur. In Kernels up to 2.6.10, you can add several
+\-\-to\-source options. For those kernels, if you specify more than one source
+address, either via an address range or multiple \-\-to\-source options, a
+simple round\-robin (one after another in cycle) takes place between these
+addresses. Later Kernels (>= 2.6.11\-rc1) don't have the ability to NAT
+to multiple ranges anymore.
.TP
\fB\-\-random\fP
If option \fB\-\-random\fP is used then port mapping will be randomized (kernel
Gives a client the same source\-/destination\-address for each connection.
This supersedes the SAME target. Support for persistent mappings is
available from 2.6.29\-rc2.
+.PP
+Kernels prior to 2.6.36\-rc1 don't have the ability to \fBSNAT\fP in the
+\fBINPUT\fP chain.
+.TP
+IPv6 support available since Linux kernels >= 3.7.
+.SS "SNPT (IPv6 の場合)"
+Provides stateless source IPv6\-to\-IPv6 Network Prefix Translation (as
+described by RFC 6296).
+.PP
+You have to use this target in the \fBmangle\fP table, not in the \fBnat\fP
+table. It takes the following options:
+.TP
+\fB\-\-src\-pfx\fP [\fIprefix/\fP\fIlength]\fP
+Set source prefix that you want to translate and length
+.TP
+\fB\-\-dst\-pfx\fP [\fIprefix/\fP\fIlength]\fP
+Set destination prefix that you want to use in the translation and length
+.PP
+You have to use the DNPT target to undo the translation. Example:
+.IP
+ip6tables \-t mangle \-I POSTROUTING \-s fd00::/64 \! \-o vboxnet0 \-j SNPT
+\-\-src\-pfx fd00::/64 \-\-dst\-pfx 2001:e20:2000:40f::/64
+.IP
+ip6tables \-t mangle \-I PREROUTING \-i wlan0 \-d 2001:e20:2000:40f::/64 \-j DNPT
+\-\-src\-pfx 2001:e20:2000:40f::/64 \-\-dst\-pfx fd00::/64
+.PP
+You may need to enable IPv6 neighbor proxy:
+.IP
+sysctl \-w net.ipv6.conf.all.proxy_ndp=1
+.PP
+You also have to use the \fBNOTRACK\fP target to disable connection tracking
+for translated flows.
.SS TCPMSS
このターゲットを用いると、 TCP の SYN パケットの MSS 値を書き換え、 そのコネクションでの最大サイズを制御できる (通常は、
送信インターフェースの MTU から IPv4 では 40 を、 IPv6 では 60 を引いた値に制限する)。 もちろん \fB\-p tcp\fP
\fB\-\-ttl\-inc\fP \fIvalue\fP
Increment the TTL value `value' times.
.SS "ULOG (IPv4 の場合)"
-このターゲットは、 マッチしたパケットを ユーザー空間でログ記録する機能を提供する。 このターゲットがルールに設定されると、 Linux カーネルは、
-そのパケットを \fInetlink\fP ソケットを用いてマルチキャストする。 そして、 1 つ以上のユーザー空間プロセスが
-いろいろなマルチキャストグループに登録をおこない、 パケットを受信する。 LOG と同様、 これは "非終了ターゲット" であり、
-ルールの探索は次のルールへと継続される。
+This is the deprecated ipv4\-only predecessor of the NFLOG target. It
+provides userspace logging of matching packets. When this target is set for
+a rule, the Linux kernel will multicast this packet through a \fInetlink\fP
+socket. One or more userspace processes may then subscribe to various
+multicast groups and receive the packets. Like LOG, this is a
+"non\-terminating target", i.e. rule traversal continues at the next rule.
.TP
\fB\-\-ulog\-nlgroup\fP \fInlgroup\fP
パケットを送信する netlink グループ (1\-32) を指定する。 デフォルトの値は 1 である。