OSDN Git Service

0a781cb4f0d3c0fea7a1ae77d542648869b2cd96
[linuxjm/iptables.git] / release / man8 / iptables-extensions.8
1 .\"*******************************************************************
2 .\"
3 .\" This file was generated with po4a. Translate the source file.
4 .\"
5 .\"*******************************************************************
6 .\"
7 .\" Japanese Version Copyright (c) 2013 Akihiro MOTOKI
8 .\"         all rights reserved.
9 .\" Translated 2013-04-08, Akihiro MOTOKI <amotoki@gmail.com>
10 .\"
11 .TH iptables\-extensions 8 "" "iptables 1.4.18" "iptables 1.4.18"
12 .SH 名前
13 iptables\-extensions \(em 標準の iptables に含まれる拡張モジュールのリスト
14 .SH 書式
15 \fBip6tables\fP [\fB\-m\fP \fIname\fP [\fImodule\-options\fP...]] [\fB\-j\fP \fItarget\-name\fP
16 [\fItarget\-options\fP...]
17 .PP
18 \fBiptables\fP [\fB\-m\fP \fIname\fP [\fImodule\-options\fP...]] [\fB\-j\fP \fItarget\-name\fP
19 [\fItarget\-options\fP...]
20 .SH マッチングの拡張
21 iptables は拡張されたパケットマッチングモジュールを使うことができる。 使用するモジュールは \fB\-m\fP か \fB\-\-match\fP
22 の後ろにモジュール名に続けて指定する。 モジュール名の後ろには、 モジュールに応じて他のいろいろなコマンドラインオプションを指定することができる。
23 複数の拡張マッチングモジュールを一行で指定することができる。 モジュールの指定より後ろで \fB\-h\fP か \fB\-\-help\fP を指定すると、
24 モジュール固有のヘルプが表示される。 拡張マッチングモジュールはルールで指定された順序で評価される。
25 .PP
26 .\" @MATCH@
27 \fB\-p\fP か \fB\-\-protocol\fP が指定され、 かつ未知のオプションだけが指定されていた場合にのみ、 iptables
28 はプロトコルと同じ名前のマッチモジュールをロードし、 そのオプションを使えるようにしようとする。
29 .SS addrtype
30 このモジュールは、 アドレス種別 (\fBaddress type\fP) に基づいてパケットマッチングを行う。
31 アドレス種別はカーネルのネットワークスタック内で使われており、 アドレスはいくつかグループに分類される。 厳密なグループの定義は個々のレイヤ 3
32 プロトコルに依存する。
33 .PP
34 以下のアドレスタイプが利用できる。
35 .TP 
36 \fBUNSPEC\fP
37 アドレスを指定しない (つまりアドレス 0.0.0.0)
38 .TP 
39 \fBUNICAST\fP
40 ユニキャストアドレス
41 .TP 
42 \fBLOCAL\fP
43 ローカルアドレス
44 .TP 
45 \fBBROADCAST\fP
46 ブロードキャストアドレス
47 .TP 
48 \fBANYCAST\fP
49 エニーキャストアドレス
50 .TP 
51 \fBMULTICAST\fP
52 マルチキャストアドレス
53 .TP 
54 \fBBLACKHOLE\fP
55 ブラックホールアドレス
56 .TP 
57 \fBUNREACHABLE\fP
58 到達できないアドレス
59 .TP 
60 \fBPROHIBIT\fP
61 禁止されたアドレス
62 .TP 
63 \fBTHROW\fP
64 要修正
65 .TP 
66 \fBNAT\fP
67 要修正
68 .TP 
69 \fBXRESOLVE\fP
70 .TP 
71 [\fB!\fP] \fB\-\-src\-type\fP \fItype\fP
72 送信元アドレスが指定された種類の場合にマッチする。
73 .TP 
74 [\fB!\fP] \fB\-\-dst\-type\fP \fItype\fP
75 宛先アドレスが指定された種類の場合にマッチする。
76 .TP 
77 \fB\-\-limit\-iface\-in\fP
78 アドレス種別のチェックをそのパケットが受信されたインターフェースに限定する。 このオプションは \fBPREROUTING\fP, \fBINPUT\fP,
79 \fBFORWARD\fP チェインでのみ利用できる。 \fB\-\-limit\-iface\-out\fP オプションと同時に指定することはできない。
80 .TP 
81 \fB\-\-limit\-iface\-out\fP
82 アドレス種別のチェックをそのパケットが出力されるインターフェースに限定する。 このオプションは \fBPOSTROUTING\fP, \fBOUTPUT\fP,
83 \fBFORWARD\fP チェインでのみ利用できる。 \fB\-\-limit\-iface\-in\fP オプションと同時に指定することはできない。
84 .SS "ah (IPv6 の場合)"
85 このモジュールは IPsec パケットの認証ヘッダーのパラメータにマッチする。
86 .TP 
87 [\fB!\fP] \fB\-\-ahspi\fP \fIspi\fP[\fB:\fP\fIspi\fP]
88 SPI にマッチする。
89 .TP 
90 [\fB!\fP] \fB\-\-ahlen\fP \fIlength\fP
91 このヘッダーの全体の長さ (8進数)。
92 .TP 
93 \fB\-\-ahres\fP
94 予約フィールドが 0 で埋められている場合にマッチする。
95 .SS "ah (IPv4 の場合)"
96 このモジュールは IPsec パケットの認証ヘッダー (AH) の SPI 値にマッチする。
97 .TP 
98 [\fB!\fP] \fB\-\-ahspi\fP \fIspi\fP[\fB:\fP\fIspi\fP]
99 .SS cluster
100 このモジュールを使うと、負荷分散装置なしで、ゲートウェイとバックエンドの負荷分散クラスターを配備できる。
101 .PP
102 This match requires that all the nodes see the same packets. Thus, the
103 cluster match decides if this node has to handle a packet given the
104 following options:
105 .TP 
106 \fB\-\-cluster\-total\-nodes\fP \fInum\fP
107 クラスターの合計ノード数を設定する。
108 .TP 
109 [\fB!\fP] \fB\-\-cluster\-local\-node\fP \fInum\fP
110 ローカルノードの数字の ID を設定する。
111 .TP 
112 [\fB!\fP] \fB\-\-cluster\-local\-nodemask\fP \fImask\fP
113 ローカルノードの ID マスクを設定する。 このオプションは \fB\-\-cluster\-local\-node\fP の代わりに使うことができる。
114 .TP 
115 \fB\-\-cluster\-hash\-seed\fP \fIvalue\fP
116 Jenkins ハッシュのシード値を設定する。
117 .PP
118 例:
119 .IP
120 iptables \-A PREROUTING \-t mangle \-i eth1 \-m cluster \-\-cluster\-total\-nodes 2
121 \-\-cluster\-local\-node 1 \-\-cluster\-hash\-seed 0xdeadbeef \-j MARK \-\-set\-mark
122 0xffff
123 .IP
124 iptables \-A PREROUTING \-t mangle \-i eth2 \-m cluster \-\-cluster\-total\-nodes 2
125 \-\-cluster\-local\-node 1 \-\-cluster\-hash\-seed 0xdeadbeef \-j MARK \-\-set\-mark
126 0xffff
127 .IP
128 iptables \-A PREROUTING \-t mangle \-i eth1 \-m mark ! \-\-mark 0xffff \-j DROP
129 .IP
130 iptables \-A PREROUTING \-t mangle \-i eth2 \-m mark ! \-\-mark 0xffff \-j DROP
131 .PP
132 以下のコマンドで、 すべてのノードに同じパケットを届けることができる。
133 .IP
134 ip maddr add 01:00:5e:00:01:01 dev eth1
135 .IP
136 ip maddr add 01:00:5e:00:01:02 dev eth2
137 .IP
138 arptables \-A OUTPUT \-o eth1 \-\-h\-length 6 \-j mangle \-\-mangle\-mac\-s
139 01:00:5e:00:01:01
140 .IP
141 arptables \-A INPUT \-i eth1 \-\-h\-length 6 \-\-destination\-mac 01:00:5e:00:01:01
142 \-j mangle \-\-mangle\-mac\-d 00:zz:yy:xx:5a:27
143 .IP
144 arptables \-A OUTPUT \-o eth2 \-\-h\-length 6 \-j mangle \-\-mangle\-mac\-s
145 01:00:5e:00:01:02
146 .IP
147 arptables \-A INPUT \-i eth2 \-\-h\-length 6 \-\-destination\-mac 01:00:5e:00:01:02
148 \-j mangle \-\-mangle\-mac\-d 00:zz:yy:xx:5a:27
149 .PP
150 TCP 接続の場合には、応答方向で受信した TCP ACK パケットが有効とマークされないようにするため、ピックアップ (pickup)
151 機能を無効する必要がある。
152 .IP
153 echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_loose
154 .SS comment
155 ルールにコメント (最大 256 文字) を付けることができる。
156 .TP 
157 \fB\-\-comment\fP \fIcomment\fP
158 .TP 
159 例:
160 iptables \-A INPUT \-i eth1 \-m comment \-\-comment "my local LAN"
161 .SS connbytes
162 一つのコネクション (もしくはそのコネクションを構成する 2 つのフローの一方) でそれまでに転送されたバイト数やパケット数、
163 もしくはパケットあたりの平均バイト数にマッチする。
164 .PP
165 カウンターは 64 ビットであり、したがってオーバーフローすることは考えられていない ;)
166 .PP
167 主な利用方法は、長時間存在するダウンロードを検出し、 これらに印を付けることで、
168 トラフィック制御において艇優先帯域を使うようにスケジューリングできるようにすることである。
169 .PP
170 コネクションあたりの転送バイト数は、 `conntrack \-L` 経由で見ることができ、 ctnetlink 経由でもアクセスすることもできる。
171 .PP
172 アカウント情報を持っていないコネクションでは、 このマッチングは常に false を返す点に注意すること。
173 "net.netfilter.nf_conntrack_acct" sysctl フラグで、
174 \fB新規\fPコネクションでバイト数/パケット数の計測が行われるかが制御できる。 sysctl フラグが変更されても、
175 既存のコネクションのアカウント情報は影響を受けない。
176 .TP 
177 [\fB!\fP] \fB\-\-connbytes\fP \fIfrom\fP[\fB:\fP\fIto\fP]
178 パケット数/バイト数/平均パケットサイズが FROM バイト/パケットより大きく TO バイト/パケットよりも小さいコネクションのパケットにマッチする。
179 TO が省略した場合は FROM のみがチェックされる。 "!" を使うと、 この範囲にないパケットにマッチする。
180 .TP 
181 \fB\-\-connbytes\-dir\fP {\fBoriginal\fP|\fBreply\fP|\fBboth\fP}
182 どのパケットを計測するかを指定する
183 .TP 
184 \fB\-\-connbytes\-mode\fP {\fBpackets\fP|\fBbytes\fP|\fBavgpkt\fP}
185 パケット総数、転送バイト数、これまでに受信した全パケットの平均サイズ (バイト単位) のどれをチェックするかを指定する。 "both" と
186 "avgpkt" を組み合わせて使った場合で、 (HTTP のように) データが (主に) 片方向でのみ転送される場合、
187 平均パケットサイズは実際のデータパケットの約半分になる点に注意すること。
188 .TP 
189 例:
190 iptables .. \-m connbytes \-\-connbytes 10000:100000 \-\-connbytes\-dir both
191 \-\-connbytes\-mode bytes ...
192 .SS connlimit
193 一つのサーバーに対する、 一つのクライアント IP アドレス (またはクライアントアドレスブロック) からの同時接続数を制限することができる。
194 .TP 
195 \fB\-\-connlimit\-upto\fP \fIn\fP
196 既存の接続数が \fIn\fP 以下の場合にマッチする。
197 .TP 
198 \fB\-\-connlimit\-above\fP \fIn\fP
199 既存の接続数が \fIn\fP より多い場合にマッチする。
200 .TP 
201 \fB\-\-connlimit\-mask\fP \fIprefix_length\fP
202 プレフィックス長を使ってホストのグルーピングを行う。 IPv4 の場合には、プレフィックス長は 0 以上 32 以下の値でなければならない。 IPv6
203 の場合には 0 以上 128 以下でなければならない。 指定しなかった場合、そのプロトコルで使われる最も長いプレフィックス長が使用される。
204 .TP 
205 \fB\-\-connlimit\-saddr\fP
206 送信元グループに対して制限を適用する。 これが \-\-connlimit\-daddr が指定されなかった場合のデフォルトである。
207 .TP 
208 \fB\-\-connlimit\-daddr\fP
209 宛先グループに対して制限を適用する。
210 .PP
211 例:
212 .TP 
213 # クライアントホストあたり 2 つの telnet 接続を許可する
214 iptables \-A INPUT \-p tcp \-\-syn \-\-dport 23 \-m connlimit \-\-connlimit\-above 2
215 \-j REJECT
216 .TP 
217 # 同じことのに行う別のマッチ方法
218 iptables \-A INPUT \-p tcp \-\-syn \-\-dport 23 \-m connlimit \-\-connlimit\-upto 2 \-j
219 ACCEPT
220 .TP 
221 # クラス C の送信元ネットワーク (ネットマスクが 24 ビット) あたりの同時 HTTP リクエスト数を 16 までに制限する
222 iptables \-p tcp \-\-syn \-\-dport 80 \-m connlimit \-\-connlimit\-above 16
223 \-\-connlimit\-mask 24 \-j REJECT
224 .TP 
225 # リンクローカルネットワークからの同時 HTTP リクエスト数を 16 までに制限する
226 (ipv6)  ip6tables \-p tcp \-\-syn \-\-dport 80 \-s fe80::/64 \-m connlimit
227 \-\-connlimit\-above 16 \-\-connlimit\-mask 64 \-j REJECT
228 .TP 
229 # 特定のホスト宛のコネクション数を制限する
230 ip6tables \-p tcp \-\-syn \-\-dport 49152:65535 \-d 2001:db8::1 \-m connlimit
231 \-\-connlimit\-above 100 \-j REJECT
232 .SS connmark
233 このモジュールはコネクションに関連づけられた netfilter の mark フィールドにマッチする (このフィールドは、 以下の
234 \fBCONNMARK\fP ターゲットで設定される)。
235 .TP 
236 [\fB!\fP] \fB\-\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
237 指定された mark 値を持つコネクションのパケットにマッチする (mask が指定されると、 比較の前に mask との論理積 (AND)
238 がとられる)。
239 .SS conntrack
240 コネクション追跡 (connection tracking) と組み合わせて使用した場合に、 このモジュールを使うと、
241 パケットやコネクションの追跡状態を知ることができる。
242 .TP 
243 [\fB!\fP] \fB\-\-ctstate\fP \fIstatelist\fP
244 \fIstatelist\fP はマッチするコネクション状態 (connection state) のリストで、 コンマ区切りで指定する。
245 指定できる状態のリストは後述。
246 .TP 
247 [\fB!\fP] \fB\-\-ctproto\fP \fIl4proto\fP
248 指定されたレイヤ 4 のプロトコルにマッチする。 プロトコルは名前または数値で指定する。
249 .TP 
250 [\fB!\fP] \fB\-\-ctorigsrc\fP \fIaddress\fP[\fB/\fP\fImask\fP]
251 .TP 
252 [\fB!\fP] \fB\-\-ctorigdst\fP \fIaddress\fP[\fB/\fP\fImask\fP]
253 .TP 
254 [\fB!\fP] \fB\-\-ctreplsrc\fP \fIaddress\fP[\fB/\fP\fImask\fP]
255 .TP 
256 [\fB!\fP] \fB\-\-ctrepldst\fP \fIaddress\fP[\fB/\fP\fImask\fP]
257 順方向/反対方向のコネクションの送信元/宛先アドレスにマッチする。
258 .TP 
259 [\fB!\fP] \fB\-\-ctorigsrcport\fP \fIport\fP[\fB:\fP\fIport\fP]
260 .TP 
261 [\fB!\fP] \fB\-\-ctorigdstport\fP \fIport\fP[\fB:\fP\fIport\fP]
262 .TP 
263 [\fB!\fP] \fB\-\-ctreplsrcport\fP \fIport\fP[\fB:\fP\fIport\fP]
264 .TP 
265 [\fB!\fP] \fB\-\-ctrepldstport\fP \fIport\fP[\fB:\fP\fIport\fP]
266 順方向/反対方向のコネクションの (TCP/UDPなどの) 送信元/宛先ポートアドレス、 もしくは GRE キーにマッチする。
267 ポートの範囲指定はカーネル 2.6.38 以降でのみサポートされている。
268 .TP 
269 [\fB!\fP] \fB\-\-ctstatus\fP \fIstatelist\fP
270 \fIstatuslist\fP はマッチするコネクション状況 (connection status) のリストで、 コンマ区切りで指定する。
271 指定できる状況のリストは後述。
272 .TP 
273 [\fB!\fP] \fB\-\-ctexpire\fP \fItime\fP[\fB:\fP\fItime\fP]
274 有効期間の残り秒数、 またはその範囲(両端を含む)にマッチする。
275 .TP 
276 \fB\-\-ctdir\fP {\fBORIGINAL\fP|\fBREPLY\fP}
277 指定した方向に流れるパケットにマッチする。 このフラグが全く指定されなかった場合、 両方向のパケットがマッチする。
278 .PP
279 \fB\-\-ctstate\fP に指定できる状態は以下の通り。
280 .TP 
281 \fBINVALID\fP
282 そのパケットはどの既知のコネクションとも関連付けられていない。
283 .TP 
284 \fBNEW\fP
285 そのパケットが新しいコネクションを開始しようとしている。 もしくは、 両方の方向でパケットが観測されていないコネクションに関連付けられる。
286 .TP 
287 \fBESTABLISHED\fP
288 そのパケットが、 両方向のパケットが観測されたコネクションに関連付けられる。
289 .TP 
290 \fBRELATED\fP
291 そのパケットは、新しいコネクションを開始しようとしているが、 既存のコネクションと関連付けられる。 FTP データ転送や ICMP
292 エラーなどが該当する。
293 .TP 
294 \fBUNTRACKED\fP
295 そのパケットは全く追跡されていない。 この状態は、 raw テーブルで \-j CT \-\-notrack
296 を使って明示的にそのパケットを追跡しないようにしている場合に起こる。
297 .TP 
298 \fBSNAT\fP
299 元の送信元アドレスが応答の宛先アドレスと異なる場合にマッチする仮想的な状態。
300 .TP 
301 \fBDNAT\fP
302 元の宛先アドレスが応答の送信元アドレスと異なる場合にマッチする仮想的な状態。
303 .PP
304 \fB\-\-ctstatus\fP に指定できる値は以下の通り。
305 .TP 
306 \fBNONE\fP
307 以下のいずれでもない。
308 .TP 
309 \fBEXPECTED\fP
310 期待通りのコネクションである (つまり conntrack のヘルパーがコネクションをセットアップした)。
311 .TP 
312 \fBSEEN_REPLY\fP
313 conntrack が両方の方向でパケットを観測済である。
314 .TP 
315 \fBASSURED\fP
316 conntrack エントリが early\-expired されることはない。
317 .TP 
318 \fBCONFIRMED\fP
319 Connection is confirmed: originating packet has left box.
320 .SS cpu
321 .TP 
322 [\fB!\fP] \fB\-\-cpu\fP \fInumber\fP
323 このパケットを処理する CPU にマッチする。 CPU には 0 から NR_CPUS\-1 の番号が振られる。
324 ネットワークトラフィックを複数のキューに分散させるために RPS (Remote Packet Steering) やマルチキュー NIC
325 と組み合わせて使用できる。
326 .PP
327 例:
328 .PP
329 iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 0 \-j REDIRECT
330 \-\-to\-port 8080
331 .PP
332 iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 1 \-j REDIRECT
333 \-\-to\-port 8081
334 .PP
335 Linux 2.6.36 以降で利用可能。
336 .SS dccp
337 .TP 
338 [\fB!\fP] \fB\-\-source\-port\fP,\fB\-\-sport\fP \fIport\fP[\fB:\fP\fIport\fP]
339 .TP 
340 [\fB!\fP] \fB\-\-destination\-port\fP,\fB\-\-dport\fP \fIport\fP[\fB:\fP\fIport\fP]
341 .TP 
342 [\fB!\fP] \fB\-\-dccp\-types\fP \fImask\fP
343 DCCP パケットタイプが \fImask\fP のいずれかであればマッチする。 \fImask\fP はカンマ区切りのパケットタイプのリストである。
344 指定できるパケットタイプは \fBREQUEST RESPONSE DATA ACK DATAACK CLOSEREQ CLOSE RESET SYNC
345 SYNCACK INVALID\fP である。
346 .TP 
347 [\fB!\fP] \fB\-\-dccp\-option\fP \fInumber\fP
348 DCCP オプションが設定されている場合にマッチする。
349 .SS devgroup
350 パケットの受信/送信インターフェースのデバイスグループにマッチする。
351 .TP 
352 [\fB!\fP] \fB\-\-src\-group\fP \fIname\fP
353 受信デバイスのデバイスグループにマッチする
354 .TP 
355 [\fB!\fP] \fB\-\-dst\-group\fP \fIname\fP
356 送信デバイスのデバイスグループにマッチする
357 .SS dscp
358 このモジュールは、 IP ヘッダーの TOS フィールド内にある、 6 bit の DSCP フィールドにマッチする。 IETF では DSCP が
359 TOS に取って代わった。
360 .TP 
361 [\fB!\fP] \fB\-\-dscp\fP \fIvalue\fP
362 (10 進または 16 進の) 数値 [0\-63] にマッチする。
363 .TP 
364 [\fB!\fP] \fB\-\-dscp\-class\fP \fIclass\fP
365 DiffServ クラスにマッチする。 値は BE, EF, AFxx, CSx クラスのいずれかである。 対応する数値に変換される。
366 .SS "dst (IPv6 の場合)"
367 このモジュールは宛先オプションヘッダーのパラメータにマッチする。
368 .TP 
369 [\fB!\fP] \fB\-\-dst\-len\fP \fIlength\fP
370 このヘッダーの全体の長さ (8進数)。
371 .TP 
372 \fB\-\-dst\-opts\fP \fItype\fP[\fB:\fP\fIlength\fP][\fB,\fP\fItype\fP[\fB:\fP\fIlength\fP]...]
373 数値のオプションタイプとオプションデータのオクテット単位の長さ。
374 .SS ecn
375 IPv4/IPv6 と TCP ヘッダーの ECN ビットにマッチングを行う。 ECN とは RFC3168 で規定された Explicit
376 Congestion Notification (明示的な輻輳通知) 機構のことである。
377 .TP 
378 [\fB!\fP] \fB\-\-ecn\-tcp\-cwr\fP
379 TCP ECN CWR (Congestion Window Received) ビットがセットされている場合にマッチする。
380 .TP 
381 [\fB!\fP] \fB\-\-ecn\-tcp\-ece\fP
382 TCP ECN ECE (ECN Echo) ビットがセットされている場合にマッチする。
383 .TP 
384 [\fB!\fP] \fB\-\-ecn\-ip\-ect\fP \fInum\fP
385 特定の IPv4/IPv6 ECT (ECN\-Capable Transport) にマッチする。 `0' 以上 `3'
386 以下の値を指定しなければならない。
387 .SS esp
388 このモジュールは IPsec パケットの ESP ヘッダーの SPI 値にマッチする。
389 .TP 
390 [\fB!\fP] \fB\-\-espspi\fP \fIspi\fP[\fB:\fP\fIspi\fP]
391 .SS "eui64 (IPv6 の場合)"
392 このモジュールは stateless の自動で設定された IPv6 アドレスの EUI\-64 の部分にマッチする。 Ethernet の送信元 MAC
393 アドレスに基づく EUI\-64 と IPv6 送信元アドレスの下位 64 ビットの比較が行われる。 ただし "Universal/Local"
394 ビットは比較されない。 このモジュールは他のリンク層フレームにはマッチしない。 このモジュールは \fBPREROUTING\fP, \fBINPUT\fP,
395 \fBFORWARD\fP チェインでのみ有効である。
396 .SS "frag (IPv6 の場合)"
397 このモジュールはフラグメントヘッダーのパラメータにマッチする。
398 .TP 
399 [\fB!\fP] \fB\-\-fragid\fP \fIid\fP[\fB:\fP\fIid\fP]
400 指定された値もしくは範囲の ID にマッチする。
401 .TP 
402 [\fB!\fP] \fB\-\-fraglen\fP \fIlength\fP
403 このオプションはバージョン 2.6.10 以降のカーネルでは使用できない。 フラグメントヘッダー長は変化しないので、このオプションは意味を持たない。
404 .TP 
405 \fB\-\-fragres\fP
406 予約フィールドに 0 が入っている場合にマッチする。
407 .TP 
408 \fB\-\-fragfirst\fP
409 最初のフラグメントにマッチする。
410 .TP 
411 \fB\-\-fragmore\fP
412 さらにフラグメントが続く場合にマッチする。
413 .TP 
414 \fB\-\-fraglast\fP
415 最後のフラグメントの場合にマッチする。
416 .SS hashlimit
417 \fBhashlimit\fP uses hash buckets to express a rate limiting match (like the
418 \fBlimit\fP match) for a group of connections using a \fBsingle\fP iptables
419 rule. Grouping can be done per\-hostgroup (source and/or destination address)
420 and/or per\-port. It gives you the ability to express "\fIN\fP packets per time
421 quantum per group" or "\fIN\fP bytes per seconds" (see below for some
422 examples).
423 .PP
424 hash limit オプション (\fB\-\-hashlimit\-upto\fP, \fB\-\-hashlimit\-above\fP) と
425 \fB\-\-hashlimit\-name\fP は必須である。
426 .TP 
427 \fB\-\-hashlimit\-upto\fP \fIamount\fP[\fB/second\fP|\fB/minute\fP|\fB/hour\fP|\fB/day\fP]
428 単位時間あたりの平均マッチ回数の最大値。 数値で指定され、 添字 `/second', `/minute', `/hour', `/day'
429 を付けることもできる。 デフォルトは 3/hour である。
430 .TP 
431 \fB\-\-hashlimit\-above\fP \fIamount\fP[\fB/second\fP|\fB/minute\fP|\fB/hour\fP|\fB/day\fP]
432 レートが指定された区間での \fIamount\fP より大きい場合にマッチする。
433 .TP 
434 \fB\-\-hashlimit\-burst\fP \fIamount\fP
435 パケットがマッチする回数の最大初期値: 上のオプションで指定した制限に達しなければ、 マッチするごとに、 この数値になるまで 1 個ずつ増やされる。
436 デフォルトは 5 である。 バイトでのレート照合が要求された場合、 このオプションは指定レートを超過できるバイト数を規定する。
437 このオプションを使用する際には注意が必要である \-\- エントリがタイムアウトで削除される際に、バースト値もリセットされる。
438 .TP 
439 \fB\-\-hashlimit\-mode\fP {\fBsrcip\fP|\fBsrcport\fP|\fBdstip\fP|\fBdstport\fP}\fB,\fP...
440 対象とする要素のカンマ区切りのリスト。 \-\-hashlimit\-mode オプションが指定されなかった場合、 hashlimit は limit
441 と同じ動作をするが、 ハッシュの管理を行うコストがかかる。
442 .TP 
443 \fB\-\-hashlimit\-srcmask\fP \fIprefix\fP
444 When \-\-hashlimit\-mode srcip is used, all source addresses encountered will
445 be grouped according to the given prefix length and the so\-created subnet
446 will be subject to hashlimit. \fIprefix\fP must be between (inclusive) 0 and
447 32. Note that \-\-hashlimit\-srcmask 0 is basically doing the same thing as not
448 specifying srcip for \-\-hashlimit\-mode, but is technically more expensive.
449 .TP 
450 \fB\-\-hashlimit\-dstmask\fP \fIprefix\fP
451 Like \-\-hashlimit\-srcmask, but for destination addresses.
452 .TP 
453 \fB\-\-hashlimit\-name\fP \fIfoo\fP
454 /proc/net/ipt_hashlimit/foo エントリの名前。
455 .TP 
456 \fB\-\-hashlimit\-htable\-size\fP \fIbuckets\fP
457 ハッシュテーブルのバケット数。
458 .TP 
459 \fB\-\-hashlimit\-htable\-max\fP \fIentries\fP
460 ハッシュの最大エントリ数。
461 .TP 
462 \fB\-\-hashlimit\-htable\-expire\fP \fImsec\fP
463 ハッシュエントリが何ミリ秒後に削除されるか。
464 .TP 
465 \fB\-\-hashlimit\-htable\-gcinterval\fP \fImsec\fP
466 ガベージコレクションの間隔 (ミリ秒)。
467 .PP
468 例:
469 .TP 
470 送信元ホストに対するマッチ
471 "192.168.0.0/16 の各ホストに対して 1000 パケット/秒" => \-s 192.168.0.0/16
472 \-\-hashlimit\-mode srcip \-\-hashlimit\-upto 1000/sec
473 .TP 
474 送信元ポートに対するマッチ
475 "192.168.1.1 の各サービスに対して 100 パケット/秒" => \-s 192.168.1.1 \-\-hashlimit\-mode
476 srcport \-\-hashlimit\-upto 100/sec
477 .TP 
478 サブネットに対するマッチ
479 "10.0.0.0/8 内の /28 サブネット (アドレス 8 個のグループ) それぞれに対して 10000 パケット/秒" => \-s
480 10.0.0.8 \-\-hashlimit\-mask 28 \-\-hashlimit\-upto 10000/min
481 .TP 
482 バイト/秒によるマッチ
483 "512kbyte/s を超過したフロー" => \-\-hashlimit\-mode srcip,dstip,srcport,dstport
484 \-\-hashlimit\-above 512kb/s
485 .TP 
486 バイト/秒によるマッチ
487 "512kbyte/s を超過するとマッチするが、 1 メガバイトに達するまではマッチせず許可する" \-\-hashlimit\-mode dstip
488 \-\-hashlimit\-above 512kb/s \-\-hashlimit\-burst 1mb
489 .SS "hbh (IPv6 の場合)"
490 このモジュールは Hop\-by\-Hop オプションヘッダーのパラメータにマッチする。
491 .TP 
492 [\fB!\fP] \fB\-\-hbh\-len\fP \fIlength\fP
493 このヘッダーの全体の長さ (8進数)。
494 .TP 
495 \fB\-\-hbh\-opts\fP \fItype\fP[\fB:\fP\fIlength\fP][\fB,\fP\fItype\fP[\fB:\fP\fIlength\fP]...]
496 数値のオプションタイプとオプションデータのオクテット単位の長さ。
497 .SS helper
498 このモジュールは、 指定されたコネクション追跡ヘルパーモジュールに 関連するパケットにマッチする。
499 .TP 
500 [\fB!\fP] \fB\-\-helper\fP \fIstring\fP
501 指定されたコネクション追跡ヘルパーモジュールに 関連するパケットにマッチする。
502 .RS
503 .PP
504 デフォルトのポートを使った ftp\-セッションに関連するパケットでは、 string に "ftp" と書ける。 他のポートでは "\-ポート番号"
505 を値に付け加える。 すなわち "ftp\-2121" となる。
506 .PP
507 他のコネクション追跡ヘルパーでも同じルールが適用される。
508 .RE
509 .SS "hl (IPv6 の場合)"
510 このモジュールは IPv6 ヘッダーの Hop Limit フィールドにマッチする。
511 .TP 
512 [\fB!\fP] \fB\-\-hl\-eq\fP \fIvalue\fP
513 Hop Limit が \fIvalue\fP と同じ場合にマッチする。
514 .TP 
515 \fB\-\-hl\-lt\fP \fIvalue\fP
516 Hop Limit が \fIvalue\fP より小さい場合にマッチする。
517 .TP 
518 \fB\-\-hl\-gt\fP \fIvalue\fP
519 Hop Limit が \fIvalue\fP より大きい場合にマッチする。
520 .SS "icmp (IPv4 の場合)"
521 この拡張は `\-\-protocol icmp' が指定された場合に使用でき、 以下のオプションが提供される:
522 .TP 
523 [\fB!\fP] \fB\-\-icmp\-type\fP {\fItype\fP[\fB/\fP\fIcode\fP]|\fItypename\fP}
524 ICMP タイプを指定できる。 タイプ指定には、 数値の ICMP タイプ、 タイプ/コードの組、 または以下のコマンド で表示される ICMP
525 タイプ名を指定できる。
526 .nf
527  iptables \-p icmp \-h
528 .fi
529 .SS "icmp6 (IPv6 の場合)"
530 これらの拡張は `\-\-protocol ipv6\-icmp' または `\-\-protocol icmpv6' が指定された場合に使用でき、
531 以下のオプションが提供される:
532 .TP 
533 [\fB!\fP] \fB\-\-icmpv6\-type\fP \fItype\fP[\fB/\fP\fIcode\fP]|\fItypename\fP
534 ICMPv6 タイプを指定できる。 タイプ指定には、 数値の ICMP \fItype\fP、 \fItype\fP と \fIcode\fP、 または以下のコマンド
535 で表示される ICMPv6 タイプ名を指定できる。
536 .nf
537  ip6tables \-p ipv6\-icmp \-h
538 .fi
539 .SS iprange
540 このモジュールは指定された任意の範囲の IP アドレスにマッチする。
541 .TP 
542 [\fB!\fP] \fB\-\-src\-range\fP \fIfrom\fP[\fB\-\fP\fIto\fP]
543 指定された範囲の送信元 IP にマッチする。
544 .TP 
545 [\fB!\fP] \fB\-\-dst\-range\fP \fIfrom\fP[\fB\-\fP\fIto\fP]
546 指定された範囲の宛先 IP にマッチする。
547 .SS "ipv6header (IPv6 の場合)"
548 このモジュールは IPv6 拡張ヘッダー、 上位レイヤのヘッダー、もしくはその両方にマッチする。
549 .TP 
550 \fB\-\-soft\fP
551 パケットが \fB\-\-header\fP で指定されたヘッダーの\fBいずれか\fPを含む場合にマッチする。
552 .TP 
553 [\fB!\fP] \fB\-\-header\fP \fIheader\fP[\fB,\fP\fIheader\fP...]
554 Matches the packet which EXACTLY includes all specified headers. The headers
555 encapsulated with ESP header are out of scope.  Possible \fIheader\fP types can
556 be:
557 .TP 
558 \fBhop\fP|\fBhop\-by\-hop\fP
559 Hop\-by\-Hop オプションヘッダー
560 .TP 
561 \fBdst\fP
562 宛先オプションヘッダー
563 .TP 
564 \fBroute\fP
565 ルーティングヘッダー
566 .TP 
567 \fBfrag\fP
568 フラグメントヘッダー
569 .TP 
570 \fBauth\fP
571 認証ヘッダー (AH)
572 .TP 
573 \fBesp\fP
574 ESP (Encapsulating Security Payload) ヘッダー
575 .TP 
576 \fBnone\fP
577 No Next header which matches 59 in the 'Next Header field' of IPv6 header or
578 any IPv6 extension headers
579 .TP 
580 \fBproto\fP
581 which matches any upper layer protocol header. A protocol name from
582 /etc/protocols and numeric value also allowed. The number 255 is equivalent
583 to \fBproto\fP.
584 .SS ipvs
585 IPVS コネクション属性にマッチする。
586 .TP 
587 [\fB!\fP] \fB\-\-ipvs\fP
588 IPVS コネクションに属すパケット
589 .TP 
590 以下のオプションでは \-\-ipvs も暗黙のうちに指定される (否定の場合も含む)
591 .TP 
592 [\fB!\fP] \fB\-\-vproto\fP \fIprotocol\fP
593 マッチする VIP プロトコル (数値か名前 (例えば "tcp") で指定する)
594 .TP 
595 [\fB!\fP] \fB\-\-vaddr\fP \fIaddress\fP[\fB/\fP\fImask\fP]
596 マッチする VIP アドレス
597 .TP 
598 [\fB!\fP] \fB\-\-vport\fP \fIport\fP
599 マッチする VIP プロトコル (数値か名前 (例えば \"http\") で指定する)
600 .TP 
601 \fB\-\-vdir\fP {\fBORIGINAL\fP|\fBREPLY\fP}
602 パケットフローの方向
603 .TP 
604 [\fB!\fP] \fB\-\-vmethod\fP {\fBGATE\fP|\fBIPIP\fP|\fBMASQ\fP}
605 使用する IPVS の転送方法
606 .TP 
607 [\fB!\fP] \fB\-\-vportctl\fP \fIport\fP
608 マッチする制御用コネクションの VIP ポート (例えば FTP であれば 21)
609 .SS length
610 このモジュールは、 パケットのレイヤ 3 ペイロード (例えばレイヤ 4 パケット) の長さが、 指定された値、 または値の範囲にあればマッチする。
611 .TP 
612 [\fB!\fP] \fB\-\-length\fP \fIlength\fP[\fB:\fP\fIlength\fP]
613 .SS limit
614 このモジュールは、 トークンバケットフィルタを使って制限レートのマッチを行う。 この拡張を使ったルールは、指定された制限に達するまでマッチする。
615 例えば、 このモジュールはログ記録を制限するために \fBLOG\fP ターゲットと組み合わせて使うことができる。
616 .PP
617 xt_limit has no negation support \- you will have to use \-m hashlimit !
618 \-\-hashlimit \fIrate\fP in this case whilst omitting \-\-hashlimit\-mode.
619 .TP 
620 \fB\-\-limit\fP \fIrate\fP[\fB/second\fP|\fB/minute\fP|\fB/hour\fP|\fB/day\fP]
621 単位時間あたりの平均マッチ回数の最大値。 数値で指定され、 添字 `/second', `/minute', `/hour', `/day'
622 を付けることもできる。 デフォルトは 3/hour である。
623 .TP 
624 \fB\-\-limit\-burst\fP \fInumber\fP
625 パケットがマッチする回数の最大初期値: 上のオプションで指定した制限に達しなければ、 マッチするごとに、 この数値になるまで 1 個ずつ増やされる。
626 デフォルトは 5 である。
627 .SS mac
628 .TP 
629 [\fB!\fP] \fB\-\-mac\-source\fP \fIaddress\fP
630 送信元 MAC アドレスにマッチする。 \fIaddress\fP は XX:XX:XX:XX:XX:XX と
631 いう形式でなければならない。 イーサーネットデバイスから入ってくるパケッ
632 トで、 \fBPREROUTING\fP, \fBFORWARD\fP, \fBINPUT\fP チェインに入るパケットにしか
633 意味がない。
634 .SS mark
635 このモジュールはパケットに関連づけられた netfilter の mark フィールドにマッチする (このフィールドは、 以下の \fBMARK\fP
636 ターゲットで設定される)。
637 .TP 
638 [\fB!\fP] \fB\-\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
639 指定された符号なしの mark 値を持つパケットにマッチする (\fImask\fP が指定されると、 比較の前に \fImask\fP との論理積 (AND)
640 がとられる)。
641 .SS "mh (IPv6 の場合)"
642 この拡張は `\-\-protocol ipv6\-mh' または `\-\-protocol mh' が指定された場合にロードされる。
643 以下のオプションが提供される。
644 .TP 
645 [\fB!\fP] \fB\-\-mh\-type\fP \fItype\fP[\fB:\fP\fItype\fP]
646 Mobility Header (MH) タイプを指定できる。 タイプ指定には、 数値の MH タイプか、 以下のコマンドで表示される MH
647 タイプ名を指定できる。
648 .nf
649  ip6tables \-p ipv6\-mh \-h
650 .fi
651 .SS multiport
652 このモジュールは送信元ポートや宛先ポートの集合にマッチする。 ポートは 15 個まで指定できる。 ポートの範囲指定 (port:port) は 2
653 ポートとカウントされる。 このモジュールが使用できるのは \fB\-p tcp\fP か \fB\-p udp\fP と組み合わせた場合だけである。
654 .TP 
655 [\fB!\fP] \fB\-\-source\-ports\fP,\fB\-\-sports\fP \fIport\fP[\fB,\fP\fIport\fP|\fB,\fP\fIport\fP\fB:\fP\fIport\fP]...
656 送信元ポートが指定されたポートのいずれにマッチする。 フラグ \fB\-\-sports\fP はこのオプションの便利な別名である。
657 複数のポートやポート範囲がカンマ区切りで指定できる。 ポート範囲はコロン区切りで指定する。 したがって \fB53,1024:65535\fP はポート 53
658 および 1024 から 65535 までの全ポートにマッチする。
659 .TP 
660 [\fB!\fP] \fB\-\-destination\-ports\fP,\fB\-\-dports\fP \fIport\fP[\fB,\fP\fIport\fP|\fB,\fP\fIport\fP\fB:\fP\fIport\fP]...
661 宛先ポートが指定されたポートのうちのいずれかであればマッチする。
662 フラグ \fB\-\-dports\fP は、 このオプションの便利な別名である。
663 .TP 
664 [\fB!\fP] \fB\-\-ports\fP \fIport\fP[\fB,\fP\fIport\fP|\fB,\fP\fIport\fP\fB:\fP\fIport\fP]...
665 送信元ポートと宛先ポートの一方が指定されたポートのいずれか一つと等しければ、 マッチする。
666 .SS nfacct
667 nfacct マッチングは iptable に拡張アカウンティング機構を提供する。 このマッチングモジュールはユーザー空間スタンドアロンユーティリティ
668 \fBnfacct\fP(8) と一緒に使う必要がある。
669 .PP
670 以下のオプションだけがこのマッチングで使用できる。
671 .TP 
672 \fB\-\-nfacct\-name\fP \fIname\fP
673 このルールセットがマッチするトラフィック量を記録するのに使用する既存のオブジェクト名を指定する。
674 .PP
675 この拡張を使用するには、アカウンティングオブジェクトを作成する必要があります。
676 .IP
677 nfacct add http\-traffic
678 .PP
679 それから、iptables を使ってアカウンティングオブジェクトにトラフィックを関連付けます。
680 .IP
681 iptables \-I INPUT \-p tcp \-\-sport 80 \-m nfacct \-\-nfacct\-name http\-traffic
682 .IP
683 iptables \-I OUTPUT \-p tcp \-\-dport 80 \-m nfacct \-\-nfacct\-name http\-traffic
684 .PP
685 そうすると、ルールにマッチしたトラフィック量をチェックできる。
686 .IP
687 nfacct get http\-traffic
688 .IP
689 { pkts = 00000000000000000156, bytes = 00000000000000151786 } =
690 http\-traffic;
691 .PP
692 \fBnfacct\fP(8) は http://www.netfilter.org もしくは git.netfilter.org リポジトリから入手できる。
693 .SS osf
694 osf モジュールは受動的な OS (オペレーティングシステム) フィンガープリンティングを行う。 このモジュールは SYN
695 ビットがセットされたパケットのいくつかのデータ (Window Size, MSS, オプションとその順序, TTL, DF など) を比較する。
696 .TP 
697 [\fB!\fP] \fB\-\-genre\fP \fIstring\fP
698 受動的フィンガープリンティングでマッチさせるオペレーティングシステムのジャンル。
699 .TP 
700 \fB\-\-ttl\fP \fIlevel\fP
701 パケットに対して、オペレーティングシステムを判定するための追加の TTL チェックを行う。 \fIlevel\fP には以下の値のいずれを指定できる。
702 .IP \(bu 4
703 0 \- 本当の IP アドレスとフィンガープリント TTL の比較を行う。 一般に LAN で有効である。
704 .IP \(bu 4
705 1 \- IP ヘッダーの TTL がフィンガープリント TTL より小さいかチェックする。 グローバルにルーティング可能なアドレスで有効である。
706 .IP \(bu 4
707 2 \- TTL の比較を全く行わない。
708 .TP 
709 \fB\-\-log\fP \fIlevel\fP
710 判別したジャンルが期待するものと違う場合でもロギングするかどうか。 \fIlevel\fP には以下のいずれかを指定できる。
711 .IP \(bu 4
712 マッチしたシグネチャーと不明なシグネチャーをすべて記録する
713 .IP \(bu 4
714 1 \- 最初にマッチしたもののみを記録する
715 .IP \(bu 4
716 2 \- マッチした既知のシグネチャーをすべて記録する
717 .PP
718 syslog に以下のようなメッセージが記録される。
719 .PP
720 Windows [2000:SP3:Windows XP Pro SP1, 2000 SP3]: 11.22.33.55:4024 \->
721 11.22.33.44:139 hops=3 Linux [2.5\-2.6:] : 1.2.3.4:42624 \-> 1.2.3.5:22
722 hops=4
723 .PP
724 OS フィンガープリントは \fBnfnl_osf\fP プログラムを使ってロードできる。 ファイルからフィンガープリントをロードするには以下のようにする。
725 .PP
726 \fBnfnl_osf \-f /usr/share/xtables/pf.os\fP
727 .PP
728 再度削除するには以下のようにする。
729 .PP
730 \fBnfnl_osf \-f /usr/share/xtables/pf.os \-d\fP
731 .PP
732 フィンガープリントデータベースは http://www.openbsd.org/cgi\-bin/cvsweb/src/etc/pf.os
733 からダウンロードできる。
734 .SS owner
735 このモジュールは、 ローカルで生成されたパケットに対して、 パケット生成者の様々な特性に対するマッチを行う。 このマッチは OUTPUT チェインか
736 POSTROUTING チェインでのみ有効である。 転送パケットはどのソケットとも関連付けられていない。
737 カーネルスレッドからのパケットには対応するソケットがあるが、 通常ソケットの所有者はいない。
738 .TP 
739 [\fB!\fP] \fB\-\-uid\-owner\fP \fIusername\fP
740 .TP 
741 [\fB!\fP] \fB\-\-uid\-owner\fP \fIuserid\fP[\fB\-\fP\fIuserid\fP]
742 そのパケットのソケットのファイル構造体が存在し、ソケットの所有者が指定されたユーザーの場合にマッチする。 数値の UID や UID
743 の範囲を指定することもできる。
744 .TP 
745 [\fB!\fP] \fB\-\-gid\-owner\fP \fIgroupname\fP
746 .TP 
747 [\fB!\fP] \fB\-\-gid\-owner\fP \fIgroupid\fP[\fB\-\fP\fIgroupid\fP]
748 そのパケットのソケットのファイル構造体の所有者が指定されたグループの場合にマッチする。 数値の GID や GID の範囲を指定することもできる。
749 .TP 
750 [\fB!\fP] \fB\-\-socket\-exists\fP
751 パケットがソケットに関連付けられている場合にマッチする。
752 .SS physdev
753 このモジュールは、 ブリッジデバイスのスレーブにされた、 ブリッジポートの入出力デバイスにマッチする。 このモジュールは、 ブリッジによる透過的な IP
754 ファイアウォールの基盤の一部であり、 カーネルバージョン 2.5.44 以降でのみ有効である。
755 .TP 
756 [\fB!\fP] \fB\-\-physdev\-in\fP \fIname\fP
757 パケットが受信されるブリッジのポート名 (\fBINPUT\fP, \fBFORWARD\fP, \fBPREROUTING\fP チェインに入るパケットのみ)。
758 インターフェース名が "+" で終っている場合、 その名前で始まる任意のインターフェース名にマッチする。
759 ブリッジデバイスを通して受け取られなかったパケットは、 \&'!' が指定されていない限り、 このオプションにマッチしない。
760 .TP 
761 [\fB!\fP] \fB\-\-physdev\-out\fP \fIname\fP
762 パケットを送信することになるブリッジのポート名 (\fBFORWARD\fP, \fBOUTPUT\fP, \fBPOSTROUTING\fP
763 チェインに入るパケットのみ)。 インターフェース名が "+" で終っている場合、 その名前で始まる任意のインターフェース名にマッチする。 \fBnat\fP
764 と \fBmangle\fP テーブルの \fBOUTPUT\fP チェインではブリッジの出力ポートにマッチさせることができないが、 \fBfilter\fP テーブルの
765 \fBOUPUT\fP チェインではマッチ可能である。 パケットがブリッジデバイスから送られなかった場合、 またはパケットの出力デバイスが不明であった場合は、
766 \&'!' が指定されていない限り、 パケットはこのオプションにマッチしない。
767 .TP 
768 [\fB!\fP] \fB\-\-physdev\-is\-in\fP
769 パケットがブリッジインターフェースに入った場合にマッチする。
770 .TP 
771 [\fB!\fP] \fB\-\-physdev\-is\-out\fP
772 パケットがブリッジインターフェースから出ようとした場合にマッチする。
773 .TP 
774 [\fB!\fP] \fB\-\-physdev\-is\-bridged\fP
775 パケットがブリッジされることにより、 ルーティングされなかった場合にマッチする。 これは FORWARD, POSTROUTING
776 チェインにおいてのみ役立つ。
777 .SS pkttype
778 このモジュールは、 リンク層のパケットタイプにマッチする。
779 .TP 
780 [\fB!\fP] \fB\-\-pkt\-type\fP {\fBunicast\fP|\fBbroadcast\fP|\fBmulticast\fP}
781 .SS policy
782 このモジュールはパケットを処理する IPsec が使用するポリシーにマッチする。
783 .TP 
784 \fB\-\-dir\fP {\fBin\fP|\fBout\fP}
785 復号 (decapsulation) に使用するポリシーにマッチするか、カプセル化 (encapsulation)
786 に使用するポリシーにマッチするかを指定する。 \fBin\fP はチェイン \fBPREROUTING, INPUT, FORWARD\fP で有効で、
787 \fBout\fP はチェイン \fBPOSTROUTING, OUTPUT, FORWARD\fP で有効である。
788 .TP 
789 \fB\-\-pol\fP {\fBnone\fP|\fBipsec\fP}
790 パケットが IPsec 処理対象であればマッチする。 \fB\-\-pol none\fP は \fB\-\-strict\fP と一緒に使用できない。
791 .TP 
792 \fB\-\-strict\fP
793 ポリシーが正確にマッチするか、指定したポリシーがポリシーのいずれかのルールにマッチするかを指定する。
794 .PP
795 それぞれのポリシー要素を定義するのに、以下のオプション (複数可) を使用することができる。 \fB\-\-strict\fP
796 が有効になっている場合、各要素につき少なくともオプションを一つ指定しなければならない。
797 .TP 
798 [\fB!\fP] \fB\-\-reqid\fP \fIid\fP
799 ポリシールールの reqid にマッチする。 reqid は \fBsetkey\fP(8) でレベルとして \fBunique:id\fP を使って指定できる。
800 .TP 
801 [\fB!\fP] \fB\-\-spi\fP \fIspi\fP
802 SA の SPI にマッチする。
803 .TP 
804 [\fB!\fP] \fB\-\-proto\fP {\fBah\fP|\fBesp\fP|\fBipcomp\fP}
805 カプセル化プロトコルにマッチする。
806 .TP 
807 [\fB!\fP] \fB\-\-mode\fP {\fBtunnel\fP|\fBtransport\fP}
808 カプセル化モードにマッチする。
809 .TP 
810 [\fB!\fP] \fB\-\-tunnel\-src\fP \fIaddr\fP[\fB/\fP\fImask\fP]
811 トンネルモード SA の送信元エンドポイントアドレスにマッチする。 \fB\-\-mode tunnel\fP との組み合わせでのみ有効。
812 .TP 
813 [\fB!\fP] \fB\-\-tunnel\-dst\fP \fIaddr\fP[\fB/\fP\fImask\fP]
814 トンネルモード SA の宛先エンドポイントアドレスにマッチする。 \fB\-\-mode tunnel\fP との組み合わせでのみ有効。
815 .TP 
816 \fB\-\-next\fP
817 ポリシー定義の次の要素から開始する。 \fB\-\-strict\fP との組み合わせでのみ使用できる。
818 .SS quota
819 Implements network quotas by decrementing a byte counter with each
820 packet. The condition matches until the byte counter reaches zero. Behavior
821 is reversed with negation (i.e. the condition does not match until the byte
822 counter reaches zero).
823 .TP 
824 [\fB!\fP] \fB\-\-quota\fP \fIbytes\fP
825 バイト単位のクォータ。
826 .SS rateest
827 レート推測器 (rate estimator) は RATEEST ターゲットで収集された推定レートにマッチする。 bps/pps
828 の絶対値に対するマッチング、 2 つのレート推測器の比較、 2 つのレート推測器の差分に対するマッチングをサポートしている。
829 .PP
830 .\" * Absolute:
831 利用可能なオプションが分かりやすいように、すべての可能な組み合わせを以下に示す。
832 .IP \(bu 4
833 \fBrateest\fP \fIoperator\fP \fBrateest\-bps\fP
834 .IP \(bu 4
835 .\" * Absolute + Delta:
836 \fBrateest\fP \fIoperator\fP \fBrateest\-pps\fP
837 .IP \(bu 4
838 (\fBrateest\fP minus \fBrateest\-bps1\fP) \fIoperator\fP \fBrateest\-bps2\fP
839 .IP \(bu 4
840 .\" * Relative:
841 (\fBrateest\fP minus \fBrateest\-pps1\fP) \fIoperator\fP \fBrateest\-pps2\fP
842 .IP \(bu 4
843 \fBrateest1\fP \fIoperator\fP \fBrateest2\fP \fBrateest\-bps\fP(without rate!)
844 .IP \(bu 4
845 .\" * Relative + Delta:
846 \fBrateest1\fP \fIoperator\fP \fBrateest2\fP \fBrateest\-pps\fP(without rate!)
847 .IP \(bu 4
848 (\fBrateest1\fP minus \fBrateest\-bps1\fP) \fIoperator\fP (\fBrateest2\fP minus
849 \fBrateest\-bps2\fP)
850 .IP \(bu 4
851 (\fBrateest1\fP minus \fBrateest\-pps1\fP) \fIoperator\fP (\fBrateest2\fP minus
852 \fBrateest\-pps2\fP)
853 .TP 
854 \fB\-\-rateest\-delta\fP
855 (絶対モードでも相対モードでも) 各レート推測器について、 レート推測器が推測したフローレートと BPS/PPS
856 オプションで指定された固定値の差分を計算する。 フローレートが指定された BPS/PPS よりも大きい場合、 負の値ではなく 0 が代わりに使用される。
857 つまり "max(0, rateest#_rate \- rateest#_bps)" が使用される。
858 .TP 
859 [\fB!\fP] \fB\-\-rateest\-lt\fP
860 レートが指定されたレートかレート推測器のレートよりも低い場合にマッチする。
861 .TP 
862 [\fB!\fP] \fB\-\-rateest\-gt\fP
863 レートが指定されたレートかレート推測器のレートよりも高い場合にマッチする。
864 .TP 
865 [\fB!\fP] \fB\-\-rateest\-eq\fP
866 レートが指定されたレートかレート推測器のレートと等しい場合にマッチする。
867 .PP
868 いわゆる「絶対モード」では、使用できるレート推測器は一つだけであり、固定値に対する比較だけができる。一方、「相対モード」では、2
869 つのレート推測器が使用でき、レート推測器どうしの比較ができる。
870 .TP 
871 \fB\-\-rateest\fP \fIname\fP
872 絶対モードで使用するレート推測器の名前
873 .TP 
874 \fB\-\-rateest1\fP \fIname\fP
875 .TP 
876 \fB\-\-rateest2\fP \fIname\fP
877 相対モードで使用する 2 つレート推測器の名前
878 .TP 
879 \fB\-\-rateest\-bps\fP [\fIvalue\fP]
880 .TP 
881 \fB\-\-rateest\-pps\fP [\fIvalue\fP]
882 .TP 
883 \fB\-\-rateest\-bps1\fP [\fIvalue\fP]
884 .TP 
885 \fB\-\-rateest\-bps2\fP [\fIvalue\fP]
886 .TP 
887 \fB\-\-rateest\-pps1\fP [\fIvalue\fP]
888 .TP 
889 \fB\-\-rateest\-pps2\fP [\fIvalue\fP]
890 レート推測器と指定した値を、秒間のバイト数またはパケット数で比較する。 どのオプションがどの場合に使用できるかは上の箇条書きのリストを見てほしい。
891 単位を示す接尾辞を付けることができる。 bit, [kmgt]bit, [KMGT]ibit, Bps, [KMGT]Bps, [KMGT]iBps
892 が使用できる。
893 .PP
894 例: この機能を、データコネクションの開始時に利用可能帯域に基づいて、 FTP サーバーからの出力データコネクションを 2
895 つの回線に振り分けるのに使用する場合。
896 .PP
897 # 出力レートを推定する
898 .PP
899 iptables \-t mangle \-A POSTROUTING \-o eth0 \-j RATEEST \-\-rateest\-name eth0
900 \-\-rateest\-interval 250ms \-\-rateest\-ewma 0.5s
901 .PP
902 iptables \-t mangle \-A POSTROUTING \-o ppp0 \-j RATEEST \-\-rateest\-name ppp0
903 \-\-rateest\-interval 250ms \-\-rateest\-ewma 0.5s
904 .PP
905 # 利用可能帯域に基づいてマーキングを行う
906 .PP
907 iptables \-t mangle \-A balance \-m conntrack \-\-ctstate NEW \-m helper \-\-helper
908 ftp \-m rateest \-\-rateest\-delta \-\-rateest1 eth0 \-\-rateest\-bps1 2.5mbit
909 \-\-rateest\-gt \-\-rateest2 ppp0 \-\-rateest\-bps2 2mbit \-j CONNMARK \-\-set\-mark 1
910 .PP
911 iptables \-t mangle \-A balance \-m conntrack \-\-ctstate NEW \-m helper \-\-helper
912 ftp \-m rateest \-\-rateest\-delta \-\-rateest1 ppp0 \-\-rateest\-bps1 2mbit
913 \-\-rateest\-gt \-\-rateest2 eth0 \-\-rateest\-bps2 2.5mbit \-j CONNMARK \-\-set\-mark 2
914 .PP
915 iptables \-t mangle \-A balance \-j CONNMARK \-\-restore\-mark
916 .SS "realm (IPv4 の場合)"
917 This matches the routing realm.  Routing realms are used in complex routing
918 setups involving dynamic routing protocols like BGP.
919 .TP 
920 [\fB!\fP] \fB\-\-realm\fP \fIvalue\fP[\fB/\fP\fImask\fP]
921 Matches a given realm number (and optionally mask). If not a number, value
922 can be a named realm from /etc/iproute2/rt_realms (mask can not be used in
923 that case).
924 .SS recent
925 IP アドレスのリストを動的に作成し、このリストに対するマッチングをいくつかの方法で行う。
926 .PP
927 例えば、 あなたのファイアウォールの 139 番ポートに接続しようとした「悪ガキ」リストを作成し、
928 そのアドレスからのこれ以降のすべてのパケットを「廃棄」する。
929 .PP
930 \fB\-\-set\fP, \fB\-\-rcheck\fP, \fB\-\-update\fP, \fB\-\-remove\fP は同時に使用できない。
931 .TP 
932 \fB\-\-name\fP \fIname\fP
933 コマンドで使用するリストを指定する。名前が指定されなかった場合 \fBDEFAULT\fP が使用される。
934 .TP 
935 [\fB!\fP] \fB\-\-set\fP
936 リストにパケットの送信元アドレスを追加する。 その送信元アドレスがすでにリストにある場合は、既存のエントリーを更新する。 常に成功を返す (\fB!\fP
937 が指定されている場合は常に失敗を返す)。
938 .TP 
939 \fB\-\-rsource\fP
940 recent リストのテーブルの照合/保存で、各パケットの送信元アドレスを使う。 これがデフォルトである。
941 .TP 
942 \fB\-\-rdest\fP
943 recent リストのテーブルの照合/保存で、各パケットの宛先アドレスを使う。
944 .TP 
945 \fB\-\-mask\fPnetmask
946 この recent リストに適用するネットマスク。
947 .TP 
948 [\fB!\fP] \fB\-\-rcheck\fP
949 このパケットの送信元アドレスが現在リストに含まれるかをチェックする。
950 .TP 
951 [\fB!\fP] \fB\-\-update\fP
952 \fB\-\-rcheck\fP と同じだが、 このオプションではマッチした場合に "last seen" タイムスタンプを更新する。
953 .TP 
954 [\fB!\fP] \fB\-\-remove\fP
955 パケットの送信元アドレスが現在リストに含まれているかをチェックし、 含まれている場合、そのアドレスをリストから削除し、ルールは true を返す。
956 アドレスが含まれない場合、false を返す。
957 .TP 
958 \fB\-\-seconds\fP \fIseconds\fP
959 このオプションは \fB\-\-rcheck\fP か \fB\-\-update\fP との組み合わせでのみ使用できる。 使用された場合、
960 アドレスがリストに含まれ、かつそのアドレスが直近の指定された秒数以内に観測された場合にのみ、 マッチするようになる。
961 .TP 
962 \fB\-\-reap\fP
963 このオプションは \fB\-\-seconds\fP との組み合わせでのみ使用できる。 使用された場合、 最後に指定された秒数より古いエントリーを破棄する。
964 .TP 
965 \fB\-\-hitcount\fP \fIhits\fP
966 このオプションは \fB\-\-rcheck\fP か \fB\-\-update\fP との組み合わせて使用しなければならない。 使用された場合、
967 アドレスがリストに含まれ、受信されたパケット数が指定した値以上の場合にのみマッチするようになる。 このオプションは \fB\-\-seconds\fP
968 と共に使用することもでき、 その場合は指定された時間内のヒット数に対して照合を行う。 hitcount パラメータの最大値は xt_recent
969 カーネルモードの "ip_pkt_list_tot" パラメータで規定される。
970 このコマンドリストでこの値よりも大きな値を指定すると、そのルールは拒否される。
971 .TP 
972 \fB\-\-rttl\fP
973 このオプションは \fB\-\-rcheck\fP か \fB\-\-update\fP との組み合わせでのみ使用できる。 使用された場合、
974 アドレスがリストに含まれ、かつ現在のパケットの TTL が \fB\-\-set\fP ルールにヒットしたパケットの TTL
975 にマッチする場合にのみマッチするようになる。 このオプションは、
976 送信元アドレスを偽装する人が偽りのパケットを送信して、このモジュールを使ってあなたのサイトへの他のアクセスができないようにする DoS
977 攻撃がある場合などに役に立つかもしれない。
978 .PP
979 例:
980 .IP
981 iptables \-A FORWARD \-m recent \-\-name badguy \-\-rcheck \-\-seconds 60 \-j DROP
982 .IP
983 iptables \-A FORWARD \-p tcp \-i eth0 \-\-dport 139 \-m recent \-\-name badguy \-\-set
984 \-j DROP
985 .PP
986 Steve の ipt_recent ウェブサイト (http://snowman.net/projects/ipt_recent/)
987 にも使用例がいくつかある。
988 .PP
989 \fB/proc/net/xt_recent/*\fP は現在のアドレスのリストと各リストの各エントリーの情報である。
990 .PP
991 \fB/proc/net/xt_recent/\fP の各ファイルは、読み出して現在のリストを確認することができる。 また、以下のコマンドを使って、
992 これらのファイルに書き込んでリストを変更することができる。
993 .TP 
994 \fBecho +\fP\fIaddr\fP\fB >/proc/net/xt_recent/DEFAULT\fP
995 DEFAULT リストに \fIaddr\fP を追加する
996 .TP 
997 \fBecho \-\fP\fIaddr\fP\fB >/proc/net/xt_recent/DEFAULT\fP
998 DEFAULT リストから \fIaddr\fP を削除する
999 .TP 
1000 \fBecho / >/proc/net/xt_recent/DEFAULT\fP
1001 DEFAULT リストをフラッシュ (全エントリーを削除) する
1002 .PP
1003 モジュール自体もパラメーターを取り、デフォルトは以下の通りである。
1004 .TP 
1005 \fBip_list_tot\fP=\fI100\fP
1006 テーブル単位の記録アドレス数。
1007 .TP 
1008 \fBip_pkt_list_tot\fP=\fI20\fP
1009 アドレス単位の記録パケット数。
1010 .TP 
1011 \fBip_list_hash_size\fP=\fI0\fP
1012 ハッシュテーブルサイズ。 0 は ip_list_tot に基づいて計算することを意味する。 デフォルトは 512。
1013 .TP 
1014 \fBip_list_perms\fP=\fI0644\fP
1015 /proc/net/xt_recent/* ファイルのアクセス許可モード。
1016 .TP 
1017 \fBip_list_uid\fP=\fI0\fP
1018 /proc/net/xt_recent/* ファイルの数値 ID での所有者。
1019 .TP 
1020 \fBip_list_gid\fP=\fI0\fP
1021 /proc/net/xt_recent/* ファイルの数値 ID でのグループ所有者。
1022 .SS rpfilter
1023 Performs a reverse path filter test on a packet.  If a reply to the packet
1024 would be sent via the same interface that the packet arrived on, the packet
1025 will match.  Note that, unlike the in\-kernel rp_filter, packets protected by
1026 IPSec are not treated specially.  Combine this match with the policy match
1027 if you want this.  Also, packets arriving via the loopback interface are
1028 always permitted.  This match can only be used in the PREROUTING chain of
1029 the raw or mangle table.
1030 .TP 
1031 \fB\-\-loose\fP
1032 Used to specifiy that the reverse path filter test should match even if the
1033 selected output device is not the expected one.
1034 .TP 
1035 \fB\-\-validmark\fP
1036 Also use the packets' nfmark value when performing the reverse path route
1037 lookup.
1038 .TP 
1039 \fB\-\-accept\-local\fP
1040 This will permit packets arriving from the network with a source address
1041 that is also assigned to the local machine.
1042 .TP 
1043 \fB\-\-invert\fP
1044 This will invert the sense of the match.  Instead of matching packets that
1045 passed the reverse path filter test, match those that have failed it.
1046 .PP
1047 Example to log and drop packets failing the reverse path filter test:
1048
1049 iptables \-t raw \-N RPFILTER
1050
1051 iptables \-t raw \-A RPFILTER \-m rpfilter \-j RETURN
1052
1053 iptables \-t raw \-A RPFILTER \-m limit \-\-limit 10/minute \-j NFLOG
1054 \-\-nflog\-prefix "rpfilter drop"
1055
1056 iptables \-t raw \-A RPFILTER \-j DROP
1057
1058 iptables \-t raw \-A PREROUTING \-j RPFILTER
1059
1060 失敗したパケットをドロップするが、ロギングを行わない例
1061
1062 iptables \-t raw \-A RPFILTER \-m rpfilter \-\-invert \-j DROP
1063 .SS "rt (IPv6 の場合)"
1064 IPv6 ルーティングヘッダーに対してマッチする。
1065 .TP 
1066 [\fB!\fP] \fB\-\-rt\-type\fP \fItype\fP
1067 指定したタイプ (数値) にマッチする。
1068 .TP 
1069 [\fB!\fP] \fB\-\-rt\-segsleft\fP \fInum\fP[\fB:\fP\fInum\fP]
1070 `segments left' フィールド (範囲) にマッチする。
1071 .TP 
1072 [\fB!\fP] \fB\-\-rt\-len\fP \fIlength\fP
1073 このヘッダーの長さにマッチする。
1074 .TP 
1075 \fB\-\-rt\-0\-res\fP
1076 予約フィールド (type=0) にもマッチする。
1077 .TP 
1078 \fB\-\-rt\-0\-addrs\fP \fIaddr\fP[\fB,\fP\fIaddr\fP...]
1079 type=0 のアドレス (リスト) にマッチする。
1080 .TP 
1081 \fB\-\-rt\-0\-not\-strict\fP
1082 type=0 のアドレスのリストは厳密なリストではない。
1083 .SS sctp
1084 .TP 
1085 [\fB!\fP] \fB\-\-source\-port\fP,\fB\-\-sport\fP \fIport\fP[\fB:\fP\fIport\fP]
1086 .TP 
1087 [\fB!\fP] \fB\-\-destination\-port\fP,\fB\-\-dport\fP \fIport\fP[\fB:\fP\fIport\fP]
1088 .TP 
1089 [\fB!\fP] \fB\-\-chunk\-types\fP {\fBall\fP|\fBany\fP|\fBonly\fP} \fIchunktype\fP[\fB:\fP\fIflags\fP] [...]
1090 大文字のフラグ文字はそのフラグがセットされている場合にマッチし、 小文字のフラグ文字はセットされていない場合にマッチすることを指示する。
1091
1092 チャンク種別: DATA INIT INIT_ACK SACK HEARTBEAT HEARTBEAT_ACK ABORT SHUTDOWN
1093 SHUTDOWN_ACK ERROR COOKIE_ECHO COOKIE_ACK ECN_ECNE ECN_CWR SHUTDOWN_COMPLETE
1094 ASCONF ASCONF_ACK FORWARD_TSN
1095
1096 チャンク種別で利用可能なフラグ
1097 .br
1098 DATA I U B E i u b e
1099 .br
1100 ABORT T t
1101 .br
1102 SHUTDOWN_COMPLETE T t
1103
1104 (小文字はフラグを「オフ」にすることを、大文字は「オン」にすることを意味する)
1105 .P
1106 例:
1107
1108 iptables \-A INPUT \-p sctp \-\-dport 80 \-j DROP
1109
1110 iptables \-A INPUT \-p sctp \-\-chunk\-types any DATA,INIT \-j DROP
1111
1112 iptables \-A INPUT \-p sctp \-\-chunk\-types any DATA:Be \-j ACCEPT
1113 .SS set
1114 このモジュールは \fBipsec\fP(8) で定義できる IP 集合にマッチする。
1115 .TP 
1116 [\fB!\fP] \fB\-\-match\-set\fP \fIsetname\fP \fIflag\fP[\fB,\fP\fIflag\fP]...
1117 where flags are the comma separated list of \fBsrc\fP and/or \fBdst\fP
1118 specifications and there can be no more than six of them. Hence the command
1119 .IP
1120  iptables \-A FORWARD \-m set \-\-match\-set test src,dst
1121 .IP
1122 will match packets, for which (if the set type is ipportmap) the source
1123 address and destination port pair can be found in the specified set. If the
1124 set type of the specified set is single dimension (for example ipmap), then
1125 the command will match packets for which the source address can be found in
1126 the specified set.
1127 .TP 
1128 \fB\-\-return\-\-nomatch\fP
1129 If the \fB\-\-return\-\-nomatch\fP option is specified and the set type supports
1130 the \fBnomatch\fP flag, then the matching is reversed: a match with an element
1131 flagged with \fBnomatch\fP returns \fBtrue\fP, while a match with a plain element
1132 returns \fBfalse\fP.
1133 .PP
1134 The option \fB\-\-match\-set\fP can be replaced by \fB\-\-set\fP if that does not clash
1135 with an option of other extensions.
1136 .PP
1137 Use of \-m set requires that ipset kernel support is provided, which, for
1138 standard kernels, is the case since Linux 2.6.39.
1139 .SS socket
1140 This matches if an open socket can be found by doing a socket lookup on the
1141 packet.
1142 .TP 
1143 \fB\-\-transparent\fP
1144 非透過 (non\-transparent) ソケットを無視する。
1145 .SS state
1146 "state" 拡張は "conntrack" モジュールのサブセットである。 "state" を使うと、
1147 パケットについてのコネクション追跡状態を参照できる。
1148 .TP 
1149 [\fB!\fP] \fB\-\-state\fP \fIstate\fP
1150 Where state is a comma separated list of the connection states to
1151 match. Only a subset of the states unterstood by "conntrack" are recognized:
1152 \fBINVALID\fP, \fBESTABLISHED\fP, \fBNEW\fP, \fBRELATED\fP or \fBUNTRACKED\fP. For their
1153 description, see the "conntrack" heading in this manpage.
1154 .SS statistic
1155 このモジュールは統計的な条件に基づいたパケットのマッチングを行う。 二つのモードがサポートされており、 \fB\-\-mode\fP オプションで設定できる。
1156 .PP
1157 サポートされているオプション:
1158 .TP 
1159 \fB\-\-mode\fP \fImode\fP
1160 マッチングルールのマッチングモードを設定する。 サポートされているモードは \fBrandom\fP と \fBnth\fP である。
1161 .TP 
1162 [\fB!\fP] \fB\-\-probability\fP \fIp\fP
1163 ランダムにパケットがマッチする確率を設定する。 \fBrandom\fP モードでのみ機能する。 \fIp\fP は 0.0 と 1.0 の範囲でなければならない。
1164 サポートされている粒度は 1/2147483648 である。
1165 .TP 
1166 [\fB!\fP] \fB\-\-every\fP \fIn\fP
1167 n パケットに 1 つマッチする。 \fBnth\fP モードでのみ機能する (\fB\-\-packet\fP オプションも参照)。
1168 .TP 
1169 \fB\-\-packet\fP \fIp\fP
1170 \fBnth\fP モードでカウンターの初期値を設定する (0 <= p <= n\-1, デフォルトは 0)。
1171 .SS string
1172 このモジュールは、いくつかのパターンマッチ手法を用いて指定された文字列とのマッチを行う。 Linux カーネル 2.6.14 以上が必要である。
1173 .TP 
1174 \fB\-\-algo\fP {\fBbm\fP|\fBkmp\fP}
1175 パターンマッチング手法を選択する (bm = Boyer\-Moore, kmp = Knuth\-Pratt\-Morris)
1176 .TP 
1177 \fB\-\-from\fP \fIoffset\fP
1178 マッチングの検索を開始するオフセットを設定する。 指定されなかった場合のデフォルトは 0 である。
1179 .TP 
1180 \fB\-\-to\fP \fIoffset\fP
1181 検索を終了するオフセットを設定する。 バイト \fIoffset\fP\-1 (バイト番号は 0 から開始) が検索範囲の最終バイトとなる。
1182 指定されなかった場合、デフォルトはパケットサイズである。
1183 .TP 
1184 [\fB!\fP] \fB\-\-string\fP \fIpattern\fP
1185 指定されたパターンにマッチする。
1186 .TP 
1187 [\fB!\fP] \fB\-\-hex\-string\fP \fIpattern\fP
1188 指定された 16 進表記のパターンにマッチする。
1189 .SS tcp
1190 これらの拡張は `\-\-protocol tcp' が指定され場合に使用できる。 以下のオプションが提供される:
1191 .TP 
1192 [\fB!\fP] \fB\-\-source\-port\fP,\fB\-\-sport\fP \fIport\fP[\fB:\fP\fIport\fP]
1193 送信元ポートまたはポート範囲の指定。 サービス名またはポート番号を指定できる。 \fIfirst\fP\fB:\fP\fIlast\fP という形式で、 2
1194 つの番号を含む範囲を指定することもできる。 最初のポートを省略した場合、 "0" を仮定する。 最後のポートを省略した場合、 "65535"
1195 を仮定する。 最初のポートが最後のポートより大きい場合、 2 つは入れ換えられる。 フラグ \fB\-\-sport\fP は、
1196 このオプションの便利な別名である。
1197 .TP 
1198 [\fB!\fP] \fB\-\-destination\-port\fP,\fB\-\-dport\fP \fIport\fP[\fB:\fP\fIport\fP]
1199 宛先ポートまたはポート範囲の指定。 フラグ \fB\-\-dport\fP は、 このオプションの便利な別名である。
1200 .TP 
1201 [\fB!\fP] \fB\-\-tcp\-flags\fP \fImask\fP \fIcomp\fP
1202 TCP フラグが指定されたものと等しい場合にマッチする。 第 1 引き数 \fImask\fP は評価対象とするフラグで、 コンマ区切りのリストである。 第
1203 2 引き数 \fIcomp\fP は必ず設定しなければならないフラグで、 コンマ区切りのリストである。 指定できるフラグは \fBSYN ACK FIN RST
1204 URG PSH ALL NONE\fP である。 よって、 コマンド
1205 .nf
1206  iptables \-A FORWARD \-p tcp \-\-tcp\-flags SYN,ACK,FIN,RST SYN
1207 .fi
1208 は、 SYN フラグが設定され ACK, FIN, RST フラグが設定されていない パケットにのみマッチする。
1209 .TP 
1210 [\fB!\fP] \fB\-\-syn\fP
1211 SYN ビットが設定され ACK, RST, FIN ビットがクリアされている TCP パケットにのみマッチする。 このようなパケットは TCP
1212 コネクションの開始要求に使われる。 例えば、 あるインターフェースに入ってくるこのようなパケットをブロックすれば、 内側への TCP
1213 コネクションは禁止されるが、 外側への TCP コネクションには影響しない。 これは \fB\-\-tcp\-flags SYN,RST,ACK,FIN
1214 SYN\fP と等しい。 "\-\-syn" の前に "!" フラグ
1215 を置くと、 SYN ビットがクリアされ ACK と RST ビットが設定されている
1216 TCP パケットにのみマッチする。
1217 .TP 
1218 [\fB!\fP] \fB\-\-tcp\-option\fP \fInumber\fP
1219 TCP オプションが設定されている場合にマッチする。
1220 .SS tcpmss
1221 TCP ヘッダーの TCP MSS (maximum segment size) フィールドにマッチする。 TCP の SYN パケットか
1222 SYN/ACK パケットに対してのみ利用できる。 MSS のネゴシエーションはコネクション開始時の TCP ハンドシェイク中だけだからである。
1223 .TP 
1224 [\fB!\fP] \fB\-\-mss\fP \fIvalue\fP[\fB:\fP\fIvalue\fP]
1225 指定された TCP MSS 値か範囲にマッチする。
1226 .SS time
1227 This matches if the packet arrival time/date is within a given range. All
1228 options are optional, but are ANDed when specified. All times are
1229 interpreted as UTC by default.
1230 .TP 
1231 \fB\-\-datestart\fP \fIYYYY\fP[\fB\-\fP\fIMM\fP[\fB\-\fP\fIDD\fP[\fBT\fP\fIhh\fP[\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]]]]]
1232 .TP 
1233 \fB\-\-datestop\fP \fIYYYY\fP[\fB\-\fP\fIMM\fP[\fB\-\fP\fIDD\fP[\fBT\fP\fIhh\fP[\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]]]]]
1234 Only match during the given time, which must be in ISO 8601 "T" notation.
1235 The possible time range is 1970\-01\-01T00:00:00 to 2038\-01\-19T04:17:07.
1236 .IP
1237 If \-\-datestart or \-\-datestop are not specified, it will default to
1238 1970\-01\-01 and 2038\-01\-19, respectively.
1239 .TP 
1240 \fB\-\-timestart\fP \fIhh\fP\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]
1241 .TP 
1242 \fB\-\-timestop\fP \fIhh\fP\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]
1243 Only match during the given daytime. The possible time range is 00:00:00 to
1244 23:59:59. Leading zeroes are allowed (e.g. "06:03") and correctly
1245 interpreted as base\-10.
1246 .TP 
1247 [\fB!\fP] \fB\-\-monthdays\fP \fIday\fP[\fB,\fP\fIday\fP...]
1248 Only match on the given days of the month. Possible values are \fB1\fP to
1249 \fB31\fP. Note that specifying \fB31\fP will of course not match on months which
1250 do not have a 31st day; the same goes for 28\- or 29\-day February.
1251 .TP 
1252 [\fB!\fP] \fB\-\-weekdays\fP \fIday\fP[\fB,\fP\fIday\fP...]
1253 Only match on the given weekdays. Possible values are \fBMon\fP, \fBTue\fP,
1254 \fBWed\fP, \fBThu\fP, \fBFri\fP, \fBSat\fP, \fBSun\fP, or values from \fB1\fP to \fB7\fP,
1255 respectively. You may also use two\-character variants (\fBMo\fP, \fBTu\fP, etc.).
1256 .TP 
1257 \fB\-\-contiguous\fP
1258 When \fB\-\-timestop\fP is smaller than \fB\-\-timestart\fP value, match this as a
1259 single time period instead distinct intervals.  See EXAMPLES.
1260 .TP 
1261 \fB\-\-kerneltz\fP
1262 Use the kernel timezone instead of UTC to determine whether a packet meets
1263 the time regulations.
1264 .PP
1265 About kernel timezones: Linux keeps the system time in UTC, and always does
1266 so.  On boot, system time is initialized from a referential time
1267 source. Where this time source has no timezone information, such as the x86
1268 CMOS RTC, UTC will be assumed. If the time source is however not in UTC,
1269 userspace should provide the correct system time and timezone to the kernel
1270 once it has the information.
1271 .PP
1272 Local time is a feature on top of the (timezone independent) system
1273 time. Each process has its own idea of local time, specified via the TZ
1274 environment variable. The kernel also has its own timezone offset
1275 variable. The TZ userspace environment variable specifies how the UTC\-based
1276 system time is displayed, e.g. when you run date(1), or what you see on your
1277 desktop clock.  The TZ string may resolve to different offsets at different
1278 dates, which is what enables the automatic time\-jumping in userspace. when
1279 DST changes. The kernel's timezone offset variable is used when it has to
1280 convert between non\-UTC sources, such as FAT filesystems, to UTC (since the
1281 latter is what the rest of the system uses).
1282 .PP
1283 The caveat with the kernel timezone is that Linux distributions may ignore
1284 to set the kernel timezone, and instead only set the system time. Even if a
1285 particular distribution does set the timezone at boot, it is usually does
1286 not keep the kernel timezone offset \- which is what changes on DST \- up to
1287 date.  ntpd will not touch the kernel timezone, so running it will not
1288 resolve the issue. As such, one may encounter a timezone that is always
1289 +0000, or one that is wrong half of the time of the year. As such, \fBusing
1290 \-\-kerneltz is highly discouraged.\fP
1291 .PP
1292 EXAMPLES. To match on weekends, use:
1293 .IP
1294 \-m time \-\-weekdays Sa,Su
1295 .PP
1296 Or, to match (once) on a national holiday block:
1297 .IP
1298 \-m time \-\-datestart 2007\-12\-24 \-\-datestop 2007\-12\-27
1299 .PP
1300 Since the stop time is actually inclusive, you would need the following stop
1301 time to not match the first second of the new day:
1302 .IP
1303 \-m time \-\-datestart 2007\-01\-01T17:00 \-\-datestop 2007\-01\-01T23:59:59
1304 .PP
1305 During lunch hour:
1306 .IP
1307 \-m time \-\-timestart 12:30 \-\-timestop 13:30
1308 .PP
1309 The fourth Friday in the month:
1310 .IP
1311 \-m time \-\-weekdays Fr \-\-monthdays 22,23,24,25,26,27,28
1312 .PP
1313 (Note that this exploits a certain mathematical property. It is not possible
1314 to say "fourth Thursday OR fourth Friday" in one rule. It is possible with
1315 multiple rules, though.)
1316 .PP
1317 Matching across days might not do what is expected.  For instance,
1318 .IP
1319 \-m time \-\-weekdays Mo \-\-timestart 23:00 \-\-timestop 01:00 Will match Monday,
1320 for one hour from midnight to 1 a.m., and then again for another hour from
1321 23:00 onwards.  If this is unwanted, e.g. if you would like 'match for two
1322 hours from Montay 23:00 onwards' you need to also specify the \-\-contiguous
1323 option in the example above.
1324 .SS tos
1325 このモジュールは IPv4 ヘッダーの 8 ビットの Type of Service フィールド (すなわち上位ビットを含まれる) もしくは IPv6
1326 ヘッダーの (8 ビットの) Priority フィールドにマッチする。
1327 .TP 
1328 [\fB!\fP] \fB\-\-tos\fP \fIvalue\fP[\fB/\fP\fImask\fP]
1329 指定された TOS マーク値を持つパケットにマッチする。 mask が指定されると、 比較の前に TOS マーク値との論理積 (AND) がとられる)。
1330 .TP 
1331 [\fB!\fP] \fB\-\-tos\fP \fIsymbol\fP
1332 You can specify a symbolic name when using the tos match for IPv4. The list
1333 of recognized TOS names can be obtained by calling iptables with \fB\-m tos
1334 \-h\fP.  Note that this implies a mask of 0x3F, i.e. all but the ECN bits.
1335 .SS "ttl (IPv4 の場合)"
1336 このモジュールは IP ヘッダーの time to live フィールドにマッチする。
1337 .TP 
1338 [\fB!\fP] \fB\-\-ttl\-eq\fP \fIttl\fP
1339 指定された TTL 値にマッチする。
1340 .TP 
1341 \fB\-\-ttl\-gt\fP \fIttl\fP
1342 TTL が指定された TTL 値より大きければマッチする。
1343 .TP 
1344 \fB\-\-ttl\-lt\fP \fIttl\fP
1345 TTL が指定された TTL 値より小さければマッチする。
1346 .SS u32
1347 U32 tests whether quantities of up to 4 bytes extracted from a packet have
1348 specified values. The specification of what to extract is general enough to
1349 find data at given offsets from tcp headers or payloads.
1350 .TP 
1351 [\fB!\fP] \fB\-\-u32\fP \fItests\fP
1352 The argument amounts to a program in a small language described below.
1353 .IP
1354 tests := location "=" value | tests "&&" location "=" value
1355 .IP
1356 value := range | value "," range
1357 .IP
1358 range := number | number ":" number
1359 .PP
1360 a single number, \fIn\fP, is interpreted the same as \fIn:n\fP. \fIn:m\fP is
1361 interpreted as the range of numbers \fB>=n\fP and \fB<=m\fP.
1362 .IP "" 4
1363 location := number | location operator number
1364 .IP "" 4
1365 operator := "&" | "<<" | ">>" | "@"
1366 .PP
1367 The operators \fB&\fP, \fB<<\fP, \fB>>\fP and \fB&&\fP mean the same as
1368 in C.  The \fB=\fP is really a set membership operator and the value syntax
1369 describes a set. The \fB@\fP operator is what allows moving to the next header
1370 and is described further below.
1371 .PP
1372 There are currently some artificial implementation limits on the size of the
1373 tests:
1374 .IP "    *"
1375 no more than 10 of "\fB=\fP" (and 9 "\fB&&\fP"s) in the u32 argument
1376 .IP "    *"
1377 no more than 10 ranges (and 9 commas) per value
1378 .IP "    *"
1379 no more than 10 numbers (and 9 operators) per location
1380 .PP
1381 To describe the meaning of location, imagine the following machine that
1382 interprets it. There are three registers:
1383 .IP
1384 A is of type \fBchar *\fP, initially the address of the IP header
1385 .IP
1386 B and C are unsigned 32 bit integers, initially zero
1387 .PP
1388 The instructions are:
1389 .IP
1390 number B = number;
1391 .IP
1392 C = (*(A+B)<<24) + (*(A+B+1)<<16) + (*(A+B+2)<<8) +
1393 *(A+B+3)
1394 .IP
1395 &number C = C & number
1396 .IP
1397 << number C = C << number
1398 .IP
1399 >> number C = C >> number
1400 .IP
1401 @number A = A + C; then do the instruction number
1402 .PP
1403 Any access of memory outside [skb\->data,skb\->end] causes the match
1404 to fail.  Otherwise the result of the computation is the final value of C.
1405 .PP
1406 Whitespace is allowed but not required in the tests. However, the characters
1407 that do occur there are likely to require shell quoting, so it is a good
1408 idea to enclose the arguments in quotes.
1409 .PP
1410 例:
1411 .IP
1412 match IP packets with total length >= 256
1413 .IP
1414 The IP header contains a total length field in bytes 2\-3.
1415 .IP
1416 \-\-u32 "\fB0 & 0xFFFF = 0x100:0xFFFF\fP"
1417 .IP
1418 read bytes 0\-3
1419 .IP
1420 AND that with 0xFFFF (giving bytes 2\-3), and test whether that is in the
1421 range [0x100:0xFFFF]
1422 .PP
1423 Example: (more realistic, hence more complicated)
1424 .IP
1425 match ICMP packets with icmp type 0
1426 .IP
1427 First test that it is an ICMP packet, true iff byte 9 (protocol) = 1
1428 .IP
1429 \-\-u32 "\fB6 & 0xFF = 1 &&\fP ...
1430 .IP
1431 read bytes 6\-9, use \fB&\fP to throw away bytes 6\-8 and compare the result to
1432 1. Next test that it is not a fragment. (If so, it might be part of such a
1433 packet but we cannot always tell.) N.B.: This test is generally needed if
1434 you want to match anything beyond the IP header. The last 6 bits of byte 6
1435 and all of byte 7 are 0 iff this is a complete packet (not a
1436 fragment). Alternatively, you can allow first fragments by only testing the
1437 last 5 bits of byte 6.
1438 .IP
1439 \&... \fB4 & 0x3FFF = 0 &&\fP ...
1440 .IP
1441 Last test: the first byte past the IP header (the type) is 0. This is where
1442 we have to use the @syntax. The length of the IP header (IHL) in 32 bit
1443 words is stored in the right half of byte 0 of the IP header itself.
1444 .IP
1445 \&... \fB0 >> 22 & 0x3C @ 0 >> 24 = 0\fP"
1446 .IP
1447 The first 0 means read bytes 0\-3, \fB>>22\fP means shift that 22 bits
1448 to the right. Shifting 24 bits would give the first byte, so only 22 bits is
1449 four times that plus a few more bits. \fB&3C\fP then eliminates the two extra
1450 bits on the right and the first four bits of the first byte. For instance,
1451 if IHL=5, then the IP header is 20 (4 x 5) bytes long. In this case, bytes
1452 0\-1 are (in binary) xxxx0101 yyzzzzzz, \fB>>22\fP gives the 10 bit
1453 value xxxx0101yy and \fB&3C\fP gives 010100. \fB@\fP means to use this number as a
1454 new offset into the packet, and read four bytes starting from there. This is
1455 the first 4 bytes of the ICMP payload, of which byte 0 is the ICMP
1456 type. Therefore, we simply shift the value 24 to the right to throw out all
1457 but the first byte and compare the result with 0.
1458 .PP
1459 例:
1460 .IP
1461 TCP payload bytes 8\-12 is any of 1, 2, 5 or 8
1462 .IP
1463 First we test that the packet is a tcp packet (similar to ICMP).
1464 .IP
1465 \-\-u32 "\fB6 & 0xFF = 6 &&\fP ...
1466 .IP
1467 Next, test that it is not a fragment (same as above).
1468 .IP
1469 \&... \fB0 >> 22 & 0x3C @ 12 >> 26 & 0x3C @ 8 = 1,2,5,8\fP"
1470 .IP
1471 \fB0>>22&3C\fP as above computes the number of bytes in the IP
1472 header. \fB@\fP makes this the new offset into the packet, which is the start
1473 of the TCP header. The length of the TCP header (again in 32 bit words) is
1474 the left half of byte 12 of the TCP header. The \fB12>>26&3C\fP
1475 computes this length in bytes (similar to the IP header before). "@" makes
1476 this the new offset, which is the start of the TCP payload. Finally, 8 reads
1477 bytes 8\-12 of the payload and \fB=\fP checks whether the result is any of 1, 2,
1478 5 or 8.
1479 .SS udp
1480 これらの拡張は `\-\-protocol udp' が指定された場合に利用できる。 以下のオプションが提供される。
1481 .TP 
1482 [\fB!\fP] \fB\-\-source\-port\fP,\fB\-\-sport\fP \fIport\fP[\fB:\fP\fIport\fP]
1483 送信元ポートまたはポート範囲の指定。 詳細は TCP 拡張の \fB\-\-source\-port\fP オプションの説明を参照すること。
1484 .TP 
1485 [\fB!\fP] \fB\-\-destination\-port\fP,\fB\-\-dport\fP \fIport\fP[\fB:\fP\fIport\fP]
1486 宛先ポートまたはポート範囲の指定。 詳細は TCP 拡張の \fB\-\-destination\-port\fP オプションの説明を参照すること。
1487 .SS "unclean (IPv4 の場合)"
1488 このモジュールにはオプションがないが、 おかしく正常でないように見えるパケットにマッチする。 これは実験的なものとして扱われている。
1489 .SH ターゲットの拡張
1490 .\" @TARGET@
1491 iptables は拡張ターゲットモジュールを使うことができる: 以下のものが、 標準的なディストリビューションに含まれている。
1492 .SS AUDIT
1493 This target allows to create audit records for packets hitting the target.
1494 It can be used to record accepted, dropped, and rejected packets. See
1495 auditd(8) for additional details.
1496 .TP 
1497 \fB\-\-type\fP {\fBaccept\fP|\fBdrop\fP|\fBreject\fP}
1498 Set type of audit record.
1499 .PP
1500 例:
1501 .IP
1502 iptables \-N AUDIT_DROP
1503 .IP
1504 iptables \-A AUDIT_DROP \-j AUDIT \-\-type drop
1505 .IP
1506 iptables \-A AUDIT_DROP \-j DROP
1507 .SS CHECKSUM
1508 このターゲットは、 おかしいアプリケーションや古いアプリケーションに対する選択的な対処を可能にする。 mangle テーブルでのみ使用できる。
1509 .TP 
1510 \fB\-\-checksum\-fill\fP
1511 Compute and fill in the checksum in a packet that lacks a checksum.  This is
1512 particularly useful, if you need to work around old applications such as
1513 dhcp clients, that do not work well with checksum offloads, but don't want
1514 to disable checksum offload in your device.
1515 .SS CLASSIFY
1516 This module allows you to set the skb\->priority value (and thus classify
1517 the packet into a specific CBQ class).
1518 .TP 
1519 \fB\-\-set\-class\fP \fImajor\fP\fB:\fP\fIminor\fP
1520 Set the major and minor class value. The values are always interpreted as
1521 hexadecimal even if no 0x prefix is given.
1522 .SS "CLUSTERIP (IPv4 の場合)"
1523 This module allows you to configure a simple cluster of nodes that share a
1524 certain IP and MAC address without an explicit load balancer in front of
1525 them.  Connections are statically distributed between the nodes in this
1526 cluster.
1527 .TP 
1528 \fB\-\-new\fP
1529 Create a new ClusterIP.  You always have to set this on the first rule for a
1530 given ClusterIP.
1531 .TP 
1532 \fB\-\-hashmode\fP \fImode\fP
1533 Specify the hashing mode.  Has to be one of \fBsourceip\fP,
1534 \fBsourceip\-sourceport\fP, \fBsourceip\-sourceport\-destport\fP.
1535 .TP 
1536 \fB\-\-clustermac\fP \fImac\fP
1537 Specify the ClusterIP MAC address. Has to be a link\-layer multicast address
1538 .TP 
1539 \fB\-\-total\-nodes\fP \fInum\fP
1540 Number of total nodes within this cluster.
1541 .TP 
1542 \fB\-\-local\-node\fP \fInum\fP
1543 Local node number within this cluster.
1544 .TP 
1545 \fB\-\-hash\-init\fP \fIrnd\fP
1546 Specify the random seed used for hash initialization.
1547 .SS CONNMARK
1548 このモジュールは、 コネクションに関連付けられた netfilter の mark 値を設定する。 mark は 32 ビット幅である。
1549 .TP 
1550 \fB\-\-set\-xmark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
1551 Zero out the bits given by \fImask\fP and XOR \fIvalue\fP into the ctmark.
1552 .TP 
1553 \fB\-\-save\-mark\fP [\fB\-\-nfmask\fP \fInfmask\fP] [\fB\-\-ctmask\fP \fIctmask\fP]
1554 Copy the packet mark (nfmark) to the connection mark (ctmark) using the
1555 given masks. The new nfmark value is determined as follows:
1556 .IP
1557 ctmark = (ctmark & ~ctmask) ^ (nfmark & nfmask)
1558 .IP
1559 i.e. \fIctmask\fP defines what bits to clear and \fInfmask\fP what bits of the
1560 nfmark to XOR into the ctmark. \fIctmask\fP and \fInfmask\fP default to
1561 0xFFFFFFFF.
1562 .TP 
1563 \fB\-\-restore\-mark\fP [\fB\-\-nfmask\fP \fInfmask\fP] [\fB\-\-ctmask\fP \fIctmask\fP]
1564 Copy the connection mark (ctmark) to the packet mark (nfmark) using the
1565 given masks. The new ctmark value is determined as follows:
1566 .IP
1567 nfmark = (nfmark & ~\fInfmask\fP) ^ (ctmark & \fIctmask\fP);
1568 .IP
1569 i.e. \fInfmask\fP defines what bits to clear and \fIctmask\fP what bits of the
1570 ctmark to XOR into the nfmark. \fIctmask\fP and \fInfmask\fP default to
1571 0xFFFFFFFF.
1572 .IP
1573 \fB\-\-restore\-mark\fP is only valid in the \fBmangle\fP table.
1574 .PP
1575 The following mnemonics are available for \fB\-\-set\-xmark\fP:
1576 .TP 
1577 \fB\-\-and\-mark\fP \fIbits\fP
1578 Binary AND the ctmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark
1579 0/\fP\fIinvbits\fP, where \fIinvbits\fP is the binary negation of \fIbits\fP.)
1580 .TP 
1581 \fB\-\-or\-mark\fP \fIbits\fP
1582 Binary OR the ctmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP
1583 \fIbits\fP\fB/\fP\fIbits\fP.)
1584 .TP 
1585 \fB\-\-xor\-mark\fP \fIbits\fP
1586 Binary XOR the ctmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP
1587 \fIbits\fP\fB/0\fP.)
1588 .TP 
1589 \fB\-\-set\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
1590 Set the connection mark. If a mask is specified then only those bits set in
1591 the mask are modified.
1592 .TP 
1593 \fB\-\-save\-mark\fP [\fB\-\-mask\fP \fImask\fP]
1594 Copy the nfmark to the ctmark. If a mask is specified, only those bits are
1595 copied.
1596 .TP 
1597 \fB\-\-restore\-mark\fP [\fB\-\-mask\fP \fImask\fP]
1598 ctmark を nfmark にコピーする。 mask が指定されると、 指定されたビットだけがコピーされる。 \fBmangle\fP
1599 テーブルのみで有効である。
1600 .SS CONNSECMARK
1601 This module copies security markings from packets to connections (if
1602 unlabeled), and from connections back to packets (also only if unlabeled).
1603 Typically used in conjunction with SECMARK, it is valid in the \fBsecurity\fP
1604 table (for backwards compatibility with older kernels, it is also valid in
1605 the \fBmangle\fP table).
1606 .TP 
1607 \fB\-\-save\fP
1608 If the packet has a security marking, copy it to the connection if the
1609 connection is not marked.
1610 .TP 
1611 \fB\-\-restore\fP
1612 If the packet does not have a security marking, and the connection does,
1613 copy the security marking from the connection to the packet.
1614
1615 .SS CT
1616 The CT target allows to set parameters for a packet or its associated
1617 connection. The target attaches a "template" connection tracking entry to
1618 the packet, which is then used by the conntrack core when initializing a new
1619 ct entry. This target is thus only valid in the "raw" table.
1620 .TP 
1621 \fB\-\-notrack\fP
1622 Disables connection tracking for this packet.
1623 .TP 
1624 \fB\-\-helper\fP \fIname\fP
1625 Use the helper identified by \fIname\fP for the connection. This is more
1626 flexible than loading the conntrack helper modules with preset ports.
1627 .TP 
1628 \fB\-\-ctevents\fP \fIevent\fP[\fB,\fP...]
1629 Only generate the specified conntrack events for this connection. Possible
1630 event types are: \fBnew\fP, \fBrelated\fP, \fBdestroy\fP, \fBreply\fP, \fBassured\fP,
1631 \fBprotoinfo\fP, \fBhelper\fP, \fBmark\fP (this refers to the ctmark, not nfmark),
1632 \fBnatseqinfo\fP, \fBsecmark\fP (ctsecmark).
1633 .TP 
1634 \fB\-\-expevents\fP \fIevent\fP[\fB,\fP...]
1635 Only generate the specified expectation events for this connection.
1636 Possible event types are: \fBnew\fP.
1637 .TP 
1638 \fB\-\-zone\fP \fIid\fP
1639 Assign this packet to zone \fIid\fP and only have lookups done in that zone.
1640 By default, packets have zone 0.
1641 .TP 
1642 \fB\-\-timeout\fP \fIname\fP
1643 Use the timeout policy identified by \fIname\fP for the connection. This is
1644 provides more flexible timeout policy definition than global timeout values
1645 available at /proc/sys/net/netfilter/nf_conntrack_*_timeout_*.
1646 .SS "DNAT (IPv4 の場合)"
1647 このターゲットは \fBnat\fP テーブルの \fBPREROUTING\fP, \fBOUTPUT\fP チェイン、 これらのチェインから呼び出される
1648 ユーザー定義チェインのみで有効である。 このターゲットはパケットの宛先アドレスを修正する (このコネクションの以降のパケットも修正して分からなく
1649 (mangle) する)。 さらに、 ルールによるチェックを止めさせる。 このターゲットにはオプションが 1 種類ある:
1650 .TP 
1651 \fB\-\-to\-destination\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
1652 1 つの新しい宛先 IP アドレス、 または IP アドレスの範囲が指定できる。 ポートの範囲を指定することもできる (これはルールで \fB\-p
1653 tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効)。 ポートの範囲が指定されていない場合、 宛先ポートは変更されない。 IP
1654 アドレスが指定されなかった場合は、 宛先ポートだけが変更される。
1655
1656 2.6.10 以前のカーネルでは、 複数の \-\-to\-destination オプションを指定することができる。 これらのカーネルでは、
1657 アドレスの範囲指定や \-\-to\-destination オプションの複数回指定により 2 つ以上の宛先アドレスを指定した場合、
1658 それらのアドレスを使った単純なラウンドロビンによる負荷分散が行われる。 それ以降のカーネル (>= 2.6.11\-rc1) には複数の範囲を
1659 NAT する機能は存在しない。
1660 .TP 
1661 \fB\-\-random\fP
1662 If option \fB\-\-random\fP is used then port mapping will be randomized (kernel
1663 >= 2.6.22).
1664 .TP 
1665 \fB\-\-persistent\fP
1666 Gives a client the same source\-/destination\-address for each connection.
1667 This supersedes the SAME target. Support for persistent mappings is
1668 available from 2.6.29\-rc2.
1669 .SS DSCP
1670 このターゲットは、 IPv4 パケットの TOS ヘッダーにある DSCP ビットの値の書き換えを可能にする。 これはパケットを操作するので、
1671 mangle テーブルでのみ使用できる。
1672 .TP 
1673 \fB\-\-set\-dscp\fP \fIvalue\fP
1674 DSCP フィールドの数値を設定する (10 進または 16 進)。
1675 .TP 
1676 \fB\-\-set\-dscp\-class\fP \fIclass\fP
1677 DSCP フィールドの DiffServ クラスを設定する。
1678 .SS "ECN (IPv4 の場合)"
1679 このターゲットは ECN ブラックホール問題への対処を可能にする。 mangle テーブルでのみ使用できる。
1680 .TP 
1681 \fB\-\-ecn\-tcp\-remove\fP
1682 TCP ヘッダーから全ての ECN ビット (訳注: ECE/CWR フラグ) を取り除く。 当然、 \fB\-p tcp\fP
1683 オプションとの組合わせでのみ使用できる。
1684 .SS "HL (IPv6 の場合)"
1685 This is used to modify the Hop Limit field in IPv6 header. The Hop Limit
1686 field is similar to what is known as TTL value in IPv4.  Setting or
1687 incrementing the Hop Limit field can potentially be very dangerous, so it
1688 should be avoided at any cost. This target is only valid in \fBmangle\fP table.
1689 .PP
1690 \fBDon't ever set or increment the value on packets that leave your local
1691 network!\fP
1692 .TP 
1693 \fB\-\-hl\-set\fP \fIvalue\fP
1694 Set the Hop Limit to `value'.
1695 .TP 
1696 \fB\-\-hl\-dec\fP \fIvalue\fP
1697 Decrement the Hop Limit `value' times.
1698 .TP 
1699 \fB\-\-hl\-inc\fP \fIvalue\fP
1700 Increment the Hop Limit `value' times.
1701 .SS HMARK
1702 Like MARK, i.e. set the fwmark, but the mark is calculated from hashing
1703 packet selector at choice. You have also to specify the mark range and,
1704 optionally, the offset to start from. ICMP error messages are inspected and
1705 used to calculate the hashing.
1706 .PP
1707 Existing options are:
1708 .TP 
1709 \fB\-\-hmark\-tuple\fP tuple
1710 Possible tuple members are: \fBsrc\fP meaning source address (IPv4, IPv6
1711 address), \fBdst\fP meaning destination address (IPv4, IPv6 address), \fBsport\fP
1712 meaning source port (TCP, UDP, UDPlite, SCTP, DCCP), \fBdport\fP meaning
1713 destination port (TCP, UDP, UDPlite, SCTP, DCCP), \fBspi\fP meaning Security
1714 Parameter Index (AH, ESP), and \fBct\fP meaning the usage of the conntrack
1715 tuple instead of the packet selectors.
1716 .TP 
1717 \fB\-\-hmark\-mod\fP \fIvalue (must be > 0)\fP
1718 Modulus for hash calculation (to limit the range of possible marks)
1719 .TP 
1720 \fB\-\-hmark\-offset\fP \fIvalue\fP
1721 Offset to start marks from.
1722 .TP 
1723 For advanced usage, instead of using \-\-hmark\-tuple, you can specify custom
1724 prefixes and masks:
1725 .TP 
1726 \fB\-\-hmark\-src\-prefix\fP \fIcidr\fP
1727 The source address mask in CIDR notation.
1728 .TP 
1729 \fB\-\-hmark\-dst\-prefix\fP \fIcidr\fP
1730 The destination address mask in CIDR notation.
1731 .TP 
1732 \fB\-\-hmark\-sport\-mask\fP \fIvalue\fP
1733 A 16 bit source port mask in hexadecimal.
1734 .TP 
1735 \fB\-\-hmark\-dport\-mask\fP \fIvalue\fP
1736 A 16 bit destination port mask in hexadecimal.
1737 .TP 
1738 \fB\-\-hmark\-spi\-mask\fP \fIvalue\fP
1739 A 32 bit field with spi mask.
1740 .TP 
1741 \fB\-\-hmark\-proto\-mask\fP \fIvalue\fP
1742 An 8 bit field with layer 4 protocol number.
1743 .TP 
1744 \fB\-\-hmark\-rnd\fP \fIvalue\fP
1745 A 32 bit random custom value to feed hash calculation.
1746 .PP
1747 \fIExamples:\fP
1748 .PP
1749 iptables \-t mangle \-A PREROUTING \-m conntrack \-\-ctstate NEW
1750  \-j HMARK \-\-hmark\-tuple ct,src,dst,proto \-\-hmark\-offset 10000
1751 \-\-hmark\-mod 10 \-\-hmark\-rnd 0xfeedcafe
1752 .PP
1753 iptables \-t mangle \-A PREROUTING \-j HMARK \-\-hmark\-offset 10000 \-\-hmark\-tuple
1754 src,dst,proto \-\-hmark\-mod 10 \-\-hmark\-rnd 0xdeafbeef
1755 .SS IDLETIMER
1756 This target can be used to identify when interfaces have been idle for a
1757 certain period of time.  Timers are identified by labels and are created
1758 when a rule is set with a new label.  The rules also take a timeout value
1759 (in seconds) as an option.  If more than one rule uses the same timer label,
1760 the timer will be restarted whenever any of the rules get a hit.  One entry
1761 for each timer is created in sysfs.  This attribute contains the timer
1762 remaining for the timer to expire.  The attributes are located under the
1763 xt_idletimer class:
1764 .PP
1765 /sys/class/xt_idletimer/timers/<label>
1766 .PP
1767 When the timer expires, the target module sends a sysfs notification to the
1768 userspace, which can then decide what to do (eg. disconnect to save power).
1769 .TP 
1770 \fB\-\-timeout\fP \fIamount\fP
1771 This is the time in seconds that will trigger the notification.
1772 .TP 
1773 \fB\-\-label\fP \fIstring\fP
1774 This is a unique identifier for the timer.  The maximum length for the label
1775 string is 27 characters.
1776 .SS LED
1777 This creates an LED\-trigger that can then be attached to system indicator
1778 lights, to blink or illuminate them when certain packets pass through the
1779 system. One example might be to light up an LED for a few minutes every time
1780 an SSH connection is made to the local machine. The following options
1781 control the trigger behavior:
1782 .TP 
1783 \fB\-\-led\-trigger\-id\fP \fIname\fP
1784 This is the name given to the LED trigger. The actual name of the trigger
1785 will be prefixed with "netfilter\-".
1786 .TP 
1787 \fB\-\-led\-delay\fP \fIms\fP
1788 This indicates how long (in milliseconds) the LED should be left illuminated
1789 when a packet arrives before being switched off again. The default is 0
1790 (blink as fast as possible.) The special value \fIinf\fP can be given to leave
1791 the LED on permanently once activated. (In this case the trigger will need
1792 to be manually detached and reattached to the LED device to switch it off
1793 again.)
1794 .TP 
1795 \fB\-\-led\-always\-blink\fP
1796 Always make the LED blink on packet arrival, even if the LED is already on.
1797 This allows notification of new packets even with long delay values (which
1798 otherwise would result in a silent prolonging of the delay time.)
1799 .TP 
1800 例:
1801 .TP 
1802 Create an LED trigger for incoming SSH traffic:
1803 iptables \-A INPUT \-p tcp \-\-dport 22 \-j LED \-\-led\-trigger\-id ssh
1804 .TP 
1805 Then attach the new trigger to an LED:
1806 echo netfilter\-ssh >/sys/class/leds/\fIledname\fP/trigger
1807 .SS "LOG (IPv6 の場合)"
1808 マッチしたパケットをカーネルログに記録する。 このオプションがルールに対して設定されると、 Linux カーネルはマッチしたパケットについての
1809 (IPv6 における大部分の IPv6 ヘッダーフィールドのような) 何らかの情報を カーネルログに表示する (カーネルログは \fIdmesg\fP または
1810 \fIsyslogd\fP(8)  で見ることができる)。 これは「非終了タ ーゲット」である。 すなわち、 ルールの探索は、 次のルールへと継続される。
1811 よって、 拒否するパケットをログ記録したければ、 同じマッチング判断基準を持つ 2 つのルールを使用し、 最初のルールで LOG ターゲットを、
1812 次のルールで DROP (または REJECT) ターゲットを指定する。
1813 .TP 
1814 \fB\-\-log\-level\fP \fIlevel\fP
1815 Level of logging, which can be (system\-specific) numeric or a mnemonic.
1816 Possible values are (in decreasing order of priority): \fBemerg\fP, \fBalert\fP,
1817 \fBcrit\fP, \fBerror\fP, \fBwarning\fP, \fBnotice\fP, \fBinfo\fP or \fBdebug\fP.
1818 .TP 
1819 \fB\-\-log\-prefix\fP \fIprefix\fP
1820 指定したプレフィックスをログメッセージの前に付ける。
1821 プレフィックスは 29 文字までの長さで、
1822 ログの中でメッセージを区別するのに役立つ。
1823 .TP 
1824 \fB\-\-log\-tcp\-sequence\fP
1825 TCP シーケンス番号をログに記録する。 ログがユーザーから読める場合、 セキュリティ上の危険がある。
1826 .TP 
1827 \fB\-\-log\-tcp\-options\fP
1828 TCP パケットヘッダーのオプションをログに記録する。
1829 .TP 
1830 \fB\-\-log\-ip\-options\fP
1831 IPv6 パケットヘッダーのオプションをログに記録する。
1832 .TP 
1833 \fB\-\-log\-uid\fP
1834 Log the userid of the process which generated the packet.
1835 .SS "LOG (IPv4 の場合)"
1836 マッチしたパケットをカーネルログに記録する。 このオプションがルールに対して設定されると、 Linux カーネルはマッチしたパケットについての
1837 (大部分の IP ヘッダーフィールドのような) 何らかの情報を カーネルログに表示する (カーネルログは \fIdmesg\fP または
1838 \fIsyslogd\fP(8)  で見ることができる)。 これは "非終了ターゲット" である。 すなわち、 ルールの探索は次のルールへと継続される。
1839 よって、 拒否するパケットをログ記録したければ、 同じマッチング判断基準を持つ 2 つのルールを使用し、 最初のルールで LOG ターゲットを、
1840 次のルールで DROP (または REJECT) ターゲットを指定する。
1841 .TP 
1842 \fB\-\-log\-level\fP \fIlevel\fP
1843 Level of logging, which can be (system\-specific) numeric or a mnemonic.
1844 Possible values are (in decreasing order of priority): \fBemerg\fP, \fBalert\fP,
1845 \fBcrit\fP, \fBerror\fP, \fBwarning\fP, \fBnotice\fP, \fBinfo\fP or \fBdebug\fP.
1846 .TP 
1847 \fB\-\-log\-prefix\fP \fIprefix\fP
1848 指定したプレフィックスをログメッセージの前に付ける。
1849 プレフィックスは 29 文字までの長さで、
1850 ログの中でメッセージを区別するのに役立つ。
1851 .TP 
1852 \fB\-\-log\-tcp\-sequence\fP
1853 TCP シーケンス番号をログに記録する。 ログがユーザーから読める場合、 セキュリティ上の危険がある。
1854 .TP 
1855 \fB\-\-log\-tcp\-options\fP
1856 TCP パケットヘッダーのオプションをログに記録する。
1857 .TP 
1858 \fB\-\-log\-ip\-options\fP
1859 IP パケットヘッダーのオプションをログに記録する。
1860 .TP 
1861 \fB\-\-log\-uid\fP
1862 Log the userid of the process which generated the packet.
1863 .SS MARK
1864 This target is used to set the Netfilter mark value associated with the
1865 packet.  It can, for example, be used in conjunction with routing based on
1866 fwmark (needs iproute2). If you plan on doing so, note that the mark needs
1867 to be set in the PREROUTING chain of the mangle table to affect routing.
1868 The mark field is 32 bits wide.
1869 .TP 
1870 \fB\-\-set\-xmark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
1871 Zeroes out the bits given by \fImask\fP and XORs \fIvalue\fP into the packet mark
1872 ("nfmark"). If \fImask\fP is omitted, 0xFFFFFFFF is assumed.
1873 .TP 
1874 \fB\-\-set\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
1875 Zeroes out the bits given by \fImask\fP and ORs \fIvalue\fP into the packet
1876 mark. If \fImask\fP is omitted, 0xFFFFFFFF is assumed.
1877 .PP
1878 The following mnemonics are available:
1879 .TP 
1880 \fB\-\-and\-mark\fP \fIbits\fP
1881 Binary AND the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark
1882 0/\fP\fIinvbits\fP, where \fIinvbits\fP is the binary negation of \fIbits\fP.)
1883 .TP 
1884 \fB\-\-or\-mark\fP \fIbits\fP
1885 Binary OR the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP
1886 \fIbits\fP\fB/\fP\fIbits\fP.)
1887 .TP 
1888 \fB\-\-xor\-mark\fP \fIbits\fP
1889 Binary XOR the nfmark with \fIbits\fP. (Mnemonic for \fB\-\-set\-xmark\fP
1890 \fIbits\fP\fB/0\fP.)
1891 .SS "MASQUERADE (IPv6 の場合)"
1892 このターゲットは \fBnat\fP テーブルの \fBPOSTROUTING\fP チェインのみで有効である。 動的割り当て IPv6 (ダイヤルアップ)
1893 コネクションの場合にのみ使うべきである。 固定 IP アドレスならば、 SNAT ターゲットを使うべきである。 マスカレーディングは、
1894 パケットが送信されるインターフェースの IP アドレスへのマッピングを指定するのと同じであるが、
1895 インターフェースが停止した場合にコネクションを\fI忘れる\fPという効果がある。 次のダイヤルアップでは同じインターフェースアドレスになる可能性が低い
1896 (そのため、 前回確立されたコネクションは失われる) 場合、 この動作は正しい。
1897 .TP 
1898 \fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP]
1899 このオプションは、 使用する送信元ポートの範囲を指定し、 デフォルトの \fBSNAT\fP 送信元ポートの選択方法 (上記) よりも優先される。 ルールが
1900 \fB\-p tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
1901 .TP 
1902 \fB\-\-random\fP
1903 Randomize source port mapping If option \fB\-\-random\fP is used then port
1904 mapping will be randomized.
1905 .RS
1906 .PP
1907 .SS "MASQUERADE (IPv4 の場合)"
1908 このターゲットは \fBnat\fP テーブルの \fBPOSTROUTING\fP チェインのみで有効である。 動的割り当て IP (ダイヤルアップ)
1909 コネクションの場合にのみ使うべきである。 固定 IP アドレスならば、 SNAT ターゲットを使うべきである。 マスカレーディングは、
1910 パケットが送信されるインターフェースの IP アドレスへのマッピングを指定するのと同じであるが、
1911 インターフェースが停止した場合にコネクションを\fI忘れる\fPという効果がある。 次のダイヤルアップでは同じインターフェースアドレスになる可能性が低い
1912 (そのため、 前回確立されたコネクションは失われる) 場合、 この動作は正しい。
1913 .TP 
1914 \fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP]
1915 このオプションは、 使用する送信元ポートの範囲を指定し、 デフォルトの \fBSNAT\fP 送信元ポートの選択方法 (上記) よりも優先される。 ルールが
1916 \fB\-p tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
1917 .TP 
1918 \fB\-\-random\fP
1919 Randomize source port mapping If option \fB\-\-random\fP is used then port
1920 mapping will be randomized (kernel >= 2.6.21).
1921 .RS
1922 .PP
1923 .SS "MIRROR (IPv4 の場合)"
1924 実験的なデモンストレーション用のターゲットであり、 IP ヘッダーの送信元と宛先フィールドを入れ換え、 パケットを再送信するものである。 これは
1925 \fBINPUT\fP, \fBFORWARD\fP, \fBPREROUTING\fP チェインと、 これらのチェインから呼び出される
1926 ユーザー定義チェインだけで有効である。 ループ等の問題を回避するため、 外部に送られるパケットは
1927 いかなるパケットフィルタリングチェイン・コネクション追跡・NAT からも 監視\fBされない\fP。
1928 .SS "NETMAP (IPv4 の場合)"
1929 This target allows you to statically map a whole network of addresses onto
1930 another network of addresses.  It can only be used from rules in the \fBnat\fP
1931 table.
1932 .TP 
1933 \fB\-\-to\fP \fIaddress\fP[\fB/\fP\fImask\fP]
1934 Network address to map to.  The resulting address will be constructed in the
1935 following way: All 'one' bits in the mask are filled in from the new
1936 `address'.  All bits that are zero in the mask are filled in from the
1937 original address.
1938 .SS NFLOG
1939 このターゲットは、 マッチしたパケットをログに記録する機能を提供する。 このターゲットがルールに設定されると、 Linux
1940 カーネルはそのログに記録するためにそのパケットをロードされたロギングバックエンドに渡す。 このターゲットは通常は nfnetlink_log
1941 をロギングバックエンドとして使う組み合わせで使用される。 nfnetlink_log はそのパケットを \fInetlink\fP
1942 ソケット経由で指定されたマルチキャストグループにマルチキャストする。 1
1943 つ以上のユーザー空間プロセスがマルチキャストグループを購読しパケットを受信することができる。 LOG と同様に、
1944 このターゲットは非終了ターゲットであり、 ルールの探索は次のルールへと継続される。
1945 .TP 
1946 \fB\-\-nflog\-group\fP \fInlgroup\fP
1947 パケットを送信する netlink グループ (0 \- 2^16\-1) を指定する (nfnetlink_log の場合のみ利用できる)。
1948 デフォルトの値は 0 である。
1949 .TP 
1950 \fB\-\-nflog\-prefix\fP \fIprefix\fP
1951 ログメッセージの前に付けるプレフィックス文字列。 最大 64 文字までの指定できる。 ログの中でメッセージを区別するのに役に立つ。
1952 .TP 
1953 \fB\-\-nflog\-range\fP \fIsize\fP
1954 ユーザー空間にコピーするバイト数 (nfnetlink_log の場合のみ利用できる)。 nfnetlink_log
1955 のインスタンスは自身でコピーする範囲を指定できるが、 このオプションはそれを上書きする。
1956 .TP 
1957 \fB\-\-nflog\-threshold\fP \fIsize\fP
1958 ユーザー空間にパケットを送信する前に、カーネル内部のキューに入れるパケット数 (nfnetlink_log の場合のみ利用できる)。
1959 大きめの値を指定するほどパケット単位のオーバヘッドは少なくなるが、 パケットがユーザー空間に届くまでの遅延が大きくなる。 デフォルト値は 1 である。
1960 .SS NFQUEUE
1961 This target is an extension of the QUEUE target. As opposed to QUEUE, it
1962 allows you to put a packet into any specific queue, identified by its 16\-bit
1963 queue number.  It can only be used with Kernel versions 2.6.14 or later,
1964 since it requires the \fBnfnetlink_queue\fP kernel support. The
1965 \fBqueue\-balance\fP option was added in Linux 2.6.31, \fBqueue\-bypass\fP in
1966 2.6.39.
1967 .TP 
1968 \fB\-\-queue\-num\fP \fIvalue\fP
1969 This specifies the QUEUE number to use. Valid queue numbers are 0 to
1970 65535. The default value is 0.
1971 .PP
1972 .TP 
1973 \fB\-\-queue\-balance\fP \fIvalue\fP\fB:\fP\fIvalue\fP
1974 This specifies a range of queues to use. Packets are then balanced across
1975 the given queues.  This is useful for multicore systems: start multiple
1976 instances of the userspace program on queues x, x+1, .. x+n and use
1977 "\-\-queue\-balance \fIx\fP\fB:\fP\fIx+n\fP".  Packets belonging to the same connection
1978 are put into the same nfqueue.
1979 .PP
1980 .TP 
1981 \fB\-\-queue\-bypass\fP
1982 By default, if no userspace program is listening on an NFQUEUE, then all
1983 packets that are to be queued are dropped.  When this option is used, the
1984 NFQUEUE rule is silently bypassed instead. The packet will move on to the
1985 next rule.
1986 .SS NOTRACK
1987 This target disables connection tracking for all packets matching that
1988 rule.  It is obsoleted by \-j CT \-\-notrack. Like CT, NOTRACK can only be used
1989 in the \fBraw\fP table.
1990 .SS RATEEST
1991 The RATEEST target collects statistics, performs rate estimation calculation
1992 and saves the results for later evaluation using the \fBrateest\fP match.
1993 .TP 
1994 \fB\-\-rateest\-name\fP \fIname\fP
1995 Count matched packets into the pool referred to by \fIname\fP, which is freely
1996 choosable.
1997 .TP 
1998 \fB\-\-rateest\-interval\fP \fIamount\fP{\fBs\fP|\fBms\fP|\fBus\fP}
1999 Rate measurement interval, in seconds, milliseconds or microseconds.
2000 .TP 
2001 \fB\-\-rateest\-ewmalog\fP \fIvalue\fP
2002 Rate measurement averaging time constant.
2003 .SS "REDIRECT (IPv4 の場合)"
2004 このターゲットは、 \fBnat\fP テーブルの \fBPREROUTING\fP チェインと \fBOUTPUT\fP チェイン、
2005 およびこれらチェインから呼び出されるユーザー定義チェインでのみ有効である。 このターゲットは、 宛先 IP
2006 をパケットを受信したインタフェースの最初のアドレスに変更することで、 パケットをそのマシン自身にリダイレクトする (ローカルで生成されたパケットは、
2007 アドレス 127.0.0.1 にマップされる)。
2008 .TP 
2009 \fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP]
2010 このオプションは使用される宛先ポート・ポート範囲・複数ポートを指定する。 このオプションが指定されない場合、 宛先ポートは変更されない。 ルールが
2011 \fB\-p tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
2012 .TP 
2013 \fB\-\-random\fP
2014 If option \fB\-\-random\fP is used then port mapping will be randomized (kernel
2015 >= 2.6.22).
2016 .RS
2017 .PP
2018 .SS "REJECT (IPv6 の場合)"
2019 マッチしたパケットの応答としてエラーパケットを送信するために使われる。
2020 エラーパケットを送らなければ、 \fBDROP\fP と同じであり、 TARGET を終了し、
2021 ルールの探索を終了する。 このターゲットは、 \fBINPUT\fP, \fBFORWARD\fP,
2022 \fBOUTPUT\fP チェインと、 これらのチェインから呼ばれる ユーザー定義チェイン
2023 だけで有効である。 以下のオプションは、 返されるエラーパケットの特性を
2024 制御する。
2025 .TP 
2026 \fB\-\-reject\-with\fP \fItype\fP
2027 指定できるタイプは \fBicmp6\-no\-route\fP, \fBno\-route\fP, \fBicmp6\-adm\-prohibited\fP,
2028 \fBadm\-prohibited\fP, \fBicmp6\-addr\-unreachable\fP, \fBaddr\-unreach\fP,
2029 \fBicmp6\-port\-unreachable\fP, \fBport\-unreach\fP である。 指定したタイプの適切な IPv6
2030 エラーメッセージが返される (\fBport\-unreach\fP がデフォルトである)。 さらに、 TCP プロトコルにのみマッチするルールに対して、
2031 オプション \fBtcp\-reset\fP を使うことができる。 このオプションを使うと、 TCP RST パケットが送り返される。 主として
2032 \fIident\fP (113/tcp) による探査を阻止するのに役立つ。 \fIident\fP による探査は、 壊れている (メールを受け取らない)
2033 メールホストに メールが送られる場合に頻繁に起こる。 \fBtcp\-reset\fP はバージョン 2.6.14 以降のカーネルでのみ使用できる。
2034 .SS "REJECT (IPv4 の場合)"
2035 マッチしたパケットの応答としてエラーパケットを送信するために使われる。
2036 エラーパケットを送らなければ、 \fBDROP\fP と同じであり、 TARGET を終了し、
2037 ルールの探索を終了する。 このターゲットは、 \fBINPUT\fP, \fBFORWARD\fP,
2038 \fBOUTPUT\fP チェインと、 これらのチェインから呼ばれる ユーザー定義チェイン
2039 だけで有効である。 以下のオプションは、 返されるエラーパケットの特性を
2040 制御する。
2041 .TP 
2042 \fB\-\-reject\-with\fP \fItype\fP
2043 指定できるタイプは \fBicmp\-net\-unreachable\fP, \fBicmp\-host\-unreachable\fP,
2044 \fBicmp\-port\-unreachable\fP, \fBicmp\-proto\-unreachable\fP, \fBicmp\-net\-prohibited\fP,
2045 \fBicmp\-host\-prohibited\fP, \fBicmp\-admin\-prohibited\fP (*) である。指定したタイプの適切な ICMP
2046 エラーメッセージを返す (\fBport\-unreachable\fP がデフォルトである)。 TCP プロトコルにのみマッチするルールに対して、 オプション
2047 \fBtcp\-reset\fP を使うことができる。 このオプションを使うと、 TCP RST パケットが送り返される。 主として \fIident\fP
2048 (113/tcp) による探査を阻止するのに役立つ。 \fIident\fP による探査は、 壊れている (メールを受け取らない) メールホストに
2049 メールが送られる場合に頻繁に起こる。
2050 .PP
2051 (*) icmp\-admin\-prohibited をサポートしないカーネルで、 icmp\-admin\-prohibited を使用すると、
2052 REJECT ではなく単なる DROP になる。
2053 .SS "SAME (IPv4 の場合)"
2054 Similar to SNAT/DNAT depending on chain: it takes a range of addresses
2055 (`\-\-to 1.2.3.4\-1.2.3.7') and gives a client the same
2056 source\-/destination\-address for each connection.
2057 .PP
2058 N.B.: The DNAT target's \fB\-\-persistent\fP option replaced the SAME target.
2059 .TP 
2060 \fB\-\-to\fP \fIipaddr\fP[\fB\-\fP\fIipaddr\fP]
2061 Addresses to map source to. May be specified more than once for multiple
2062 ranges.
2063 .TP 
2064 \fB\-\-nodst\fP
2065 Don't use the destination\-ip in the calculations when selecting the new
2066 source\-ip
2067 .TP 
2068 \fB\-\-random\fP
2069 Port mapping will be forcibly randomized to avoid attacks based on port
2070 prediction (kernel >= 2.6.21).
2071 .SS SECMARK
2072 This is used to set the security mark value associated with the packet for
2073 use by security subsystems such as SELinux.  It is valid in the \fBsecurity\fP
2074 table (for backwards compatibility with older kernels, it is also valid in
2075 the \fBmangle\fP table). The mark is 32 bits wide.
2076 .TP 
2077 \fB\-\-selctx\fP \fIsecurity_context\fP
2078 .SS SET
2079 このモジュールは \fBipsec\fP(8) で定義できる IP 集合のエントリの追加、削除、その両方を行う。
2080 .TP 
2081 \fB\-\-add\-set\fP \fIsetname\fP \fIflag\fP[\fB,\fP\fIflag\fP...]
2082 集合に指定されたアドレス/ポート (複数可) を追加する
2083 .TP 
2084 \fB\-\-del\-set\fP \fIsetname\fP \fIflag\fP[\fB,\fP\fIflag\fP...]
2085 集合から指定されたアドレス/ポート (複数可) を削除する
2086 .IP
2087 \fIflag\fP は \fBsrc\fP や \fBdst\fP の指定であり、 指定できるのは 6 個までである。
2088 .TP 
2089 \fB\-\-timeout\fP \fIvalue\fP
2090 エントリを追加する際に、 集合定義のデフォルト値ではなく指定したタイムアウト値を使用する
2091 .TP 
2092 \fB\-\-exist\fP
2093 エントリを追加する際に、 エントリが存在する場合、 タイムアウト値を、 指定された値か集合定義のデフォルト値にリセットする
2094 .PP
2095 \-j SET を使用するには ipset のカーネルサポートが必要である。 標準のカーネルでは、 Linux 2.6.39 以降で提供されている。
2096 .SS "SNAT (IPv4 の場合)"
2097 このターゲットは \fBnat\fP テーブルの \fBPOSTROUTING\fP チェインのみで有効である。
2098 このターゲットはパケットの送信元アドレスを修正させる (このコネクションの以降のパケットも修正して分からなく (mangle) する)。 さらに、
2099 ルールが評価を中止するように指示する。 このターゲットにはオプションが 1 種類ある:
2100 .TP 
2101 \fB\-\-to\-source\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
2102 1 つの新しい送信元 IP アドレス、 または IP アドレスの範囲が指定できる。 ポートの範囲を指定することもできる (ルールが \fB\-p tcp\fP
2103 または \fB\-p udp\fP を指定している場合にのみ有効)。 ポートの範囲が指定されていない場合、 512 未満の送信元ポートは、 他の 512
2104 未満のポートにマッピングされる。 512 〜 1023 までのポートは、 1024 未満のポートにマッピングされる。 それ以外のポートは、 1024
2105 以上のポートにマッピングされる。 可能であれば、 ポートの変換は起こらない。
2106
2107 2.6.10 以前のカーネルでは、 複数の \-\-to\-source オプションを指定することができる。 これらのカーネルでは、 アドレスの範囲指定や
2108 \-\-to\-source オプションの複数回指定により 2 つ以上の送信元アドレスを指定した場合、
2109 それらのアドレスを使った単純なラウンド・ロビンが行われる。 それ以降のカーネル (>= 2.6.11\-rc1) には複数の範囲を NAT
2110 する機能は存在しない。
2111 .TP 
2112 \fB\-\-random\fP
2113 If option \fB\-\-random\fP is used then port mapping will be randomized (kernel
2114 >= 2.6.21).
2115 .TP 
2116 \fB\-\-persistent\fP
2117 Gives a client the same source\-/destination\-address for each connection.
2118 This supersedes the SAME target. Support for persistent mappings is
2119 available from 2.6.29\-rc2.
2120 .SS TCPMSS
2121 このターゲットを用いると、 TCP の SYN パケットの MSS 値を書き換え、 そのコネクションでの最大サイズを制御できる (通常は、
2122 送信インターフェースの MTU から IPv4 では 40 を、 IPv6 では 60 を引いた値に制限する)。 もちろん \fB\-p tcp\fP
2123 との組み合わせでしか使えない。
2124 .PP
2125 このターゲットは、 "ICMP Fragmentation Needed" や "ICMPv6 Packet Too Big"
2126 パケットをブロックしている犯罪的に頭のいかれた ISP やサーバーを乗り越えるために使用される。 Linux
2127 ファイアウォール/ルーターでは何も問題がないのに、 そこにぶら下がるマシンでは以下のように大きなパケットをやりとりできないというのが、
2128 この問題の兆候である。
2129 .IP 1. 4
2130 ウェブ・ブラウザで接続しようとすると、 何のデータも受け取らずにハングする
2131 .IP 2. 4
2132 短いメールは問題ないが、 長いメールがハングする
2133 .IP 3. 4
2134 ssh は問題ないが、 scp は最初のハンドシェーク後にハングする
2135 .PP
2136 回避方法: このオプションを有効にし、 以下のようなルールを ファイアウォールの設定に追加する。
2137 .IP
2138  iptables \-t mangle \-A FORWARD \-p tcp \-\-tcp\-flags SYN,RST SYN
2139              \-j TCPMSS \-\-clamp\-mss\-to\-pmtu
2140 .TP 
2141 \fB\-\-set\-mss\fP \fIvalue\fP
2142 Explicitly sets MSS option to specified value. If the MSS of the packet is
2143 already lower than \fIvalue\fP, it will \fBnot\fP be increased (from Linux 2.6.25
2144 onwards) to avoid more problems with hosts relying on a proper MSS.
2145 .TP 
2146 \fB\-\-clamp\-mss\-to\-pmtu\fP
2147 Automatically clamp MSS value to (path_MTU \- 40 for IPv4; \-60 for IPv6).
2148 This may not function as desired where asymmetric routes with differing path
2149 MTU exist \(em the kernel uses the path MTU which it would use to send
2150 packets from itself to the source and destination IP addresses. Prior to
2151 Linux 2.6.25, only the path MTU to the destination IP address was considered
2152 by this option; subsequent kernels also consider the path MTU to the source
2153 IP address.
2154 .PP
2155 これらのオプションはどちらか 1 つしか指定できない。
2156 .SS TCPOPTSTRIP
2157 This target will strip TCP options off a TCP packet. (It will actually
2158 replace them by NO\-OPs.) As such, you will need to add the \fB\-p tcp\fP
2159 parameters.
2160 .TP 
2161 \fB\-\-strip\-options\fP \fIoption\fP[\fB,\fP\fIoption\fP...]
2162 Strip the given option(s). The options may be specified by TCP option number
2163 or by symbolic name. The list of recognized options can be obtained by
2164 calling iptables with \fB\-j TCPOPTSTRIP \-h\fP.
2165 .SS TEE
2166 The \fBTEE\fP target will clone a packet and redirect this clone to another
2167 machine on the \fBlocal\fP network segment. In other words, the nexthop must be
2168 the target, or you will have to configure the nexthop to forward it further
2169 if so desired.
2170 .TP 
2171 \fB\-\-gateway\fP \fIipaddr\fP
2172 Send the cloned packet to the host reachable at the given IP address.  Use
2173 of 0.0.0.0 (for IPv4 packets) or :: (IPv6) is invalid.
2174 .PP
2175 To forward all incoming traffic on eth0 to an Network Layer logging box:
2176 .PP
2177 \-t mangle \-A PREROUTING \-i eth0 \-j TEE \-\-gateway 2001:db8::1
2178 .SS TOS
2179 This module sets the Type of Service field in the IPv4 header (including the
2180 "precedence" bits) or the Priority field in the IPv6 header. Note that TOS
2181 shares the same bits as DSCP and ECN. The TOS target is only valid in the
2182 \fBmangle\fP table.
2183 .TP 
2184 \fB\-\-set\-tos\fP \fIvalue\fP[\fB/\fP\fImask\fP]
2185 Zeroes out the bits given by \fImask\fP (see NOTE below) and XORs \fIvalue\fP into
2186 the TOS/Priority field. If \fImask\fP is omitted, 0xFF is assumed.
2187 .TP 
2188 \fB\-\-set\-tos\fP \fIsymbol\fP
2189 You can specify a symbolic name when using the TOS target for IPv4. It
2190 implies a mask of 0xFF (see NOTE below). The list of recognized TOS names
2191 can be obtained by calling iptables with \fB\-j TOS \-h\fP.
2192 .PP
2193 The following mnemonics are available:
2194 .TP 
2195 \fB\-\-and\-tos\fP \fIbits\fP
2196 Binary AND the TOS value with \fIbits\fP. (Mnemonic for \fB\-\-set\-tos
2197 0/\fP\fIinvbits\fP, where \fIinvbits\fP is the binary negation of \fIbits\fP.  See NOTE
2198 below.)
2199 .TP 
2200 \fB\-\-or\-tos\fP \fIbits\fP
2201 Binary OR the TOS value with \fIbits\fP. (Mnemonic for \fB\-\-set\-tos\fP
2202 \fIbits\fP\fB/\fP\fIbits\fP. See NOTE below.)
2203 .TP 
2204 \fB\-\-xor\-tos\fP \fIbits\fP
2205 Binary XOR the TOS value with \fIbits\fP. (Mnemonic for \fB\-\-set\-tos\fP
2206 \fIbits\fP\fB/0\fP. See NOTE below.)
2207 .PP
2208 NOTE: In Linux kernels up to and including 2.6.38, with the exception of
2209 longterm releases 2.6.32 (>=.42), 2.6.33 (>=.15), and 2.6.35
2210 (>=.14), there is a bug whereby IPv6 TOS mangling does not behave as
2211 documented and differs from the IPv4 version. The TOS mask indicates the
2212 bits one wants to zero out, so it needs to be inverted before applying it to
2213 the original TOS field. However, the aformentioned kernels forgo the
2214 inversion which breaks \-\-set\-tos and its mnemonics.
2215 .SS TPROXY
2216 このターゲットは、 \fBmangle\fP テーブルで、 \fBPREROUTING\fP チェインと、 \fBPREROUTING\fP チェインから呼び出される
2217 ユーザー定義チェインでのみ有効である。 このターゲットは、 そのパケットをパケットヘッダーを変更せずにそのままローカルソケットにリダイレクトする。
2218 また、 mark 値を変更することもでき、 この mark 値は後で高度なルーティングルールで使用することができる。 このターゲットにはオプションが 3
2219 つある:
2220 .TP 
2221 \fB\-\-on\-port\fP \fIport\fP
2222 このオプションは使用する宛先ポートを指定する。 このオプションは必須で、 0 は宛先ポートが元々の宛先ポートと同じであることを意味する。 ルールが
2223 \fB\-p tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
2224 .TP 
2225 \fB\-\-on\-ip\fP \fIaddress\fP
2226 このオプションは使用する宛先アドレスを指定する。 デフォルトでは、 パケットが到着したインタフェースの IP アドレスが使用される。 ルールが \fB\-p
2227 tcp\fP または \fB\-p udp\fP を指定している場合にのみ有効である。
2228 .TP 
2229 \fB\-\-tproxy\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
2230 Marks packets with the given value/mask. The fwmark value set here can be
2231 used by advanced routing. (Required for transparent proxying to work:
2232 otherwise these packets will get forwarded, which is probably not what you
2233 want.)
2234 .SS TRACE
2235 This target marks packets so that the kernel will log every rule which match
2236 the packets as those traverse the tables, chains, rules.
2237 .PP
2238 A logging backend, such as ip(6)t_LOG or nfnetlink_log, must be loaded for
2239 this to be visible.  The packets are logged with the string prefix: "TRACE:
2240 tablename:chainname:type:rulenum " where type can be "rule" for plain rule,
2241 "return" for implicit rule at the end of a user defined chain and "policy"
2242 for the policy of the built in chains.
2243 .br
2244 It can only be used in the \fBraw\fP table.
2245 .SS "TTL (IPv4 の場合)"
2246 This is used to modify the IPv4 TTL header field.  The TTL field determines
2247 how many hops (routers) a packet can traverse until it's time to live is
2248 exceeded.
2249 .PP
2250 Setting or incrementing the TTL field can potentially be very dangerous, so
2251 it should be avoided at any cost. This target is only valid in \fBmangle\fP
2252 table.
2253 .PP
2254 \fBDon't ever set or increment the value on packets that leave your local
2255 network!\fP
2256 .TP 
2257 \fB\-\-ttl\-set\fP \fIvalue\fP
2258 Set the TTL value to `value'.
2259 .TP 
2260 \fB\-\-ttl\-dec\fP \fIvalue\fP
2261 Decrement the TTL value `value' times.
2262 .TP 
2263 \fB\-\-ttl\-inc\fP \fIvalue\fP
2264 Increment the TTL value `value' times.
2265 .SS "ULOG (IPv4 の場合)"
2266 このターゲットは、 マッチしたパケットを ユーザー空間でログ記録する機能を提供する。 このターゲットがルールに設定されると、 Linux カーネルは、
2267 そのパケットを \fInetlink\fP ソケットを用いてマルチキャストする。 そして、 1 つ以上のユーザー空間プロセスが
2268 いろいろなマルチキャストグループに登録をおこない、 パケットを受信する。 LOG と同様、 これは "非終了ターゲット" であり、
2269 ルールの探索は次のルールへと継続される。
2270 .TP 
2271 \fB\-\-ulog\-nlgroup\fP \fInlgroup\fP
2272 パケットを送信する netlink グループ (1\-32) を指定する。 デフォルトの値は 1 である。
2273 .TP 
2274 \fB\-\-ulog\-prefix\fP \fIprefix\fP
2275 指定したプレフィックスをログメッセージの前に付ける。 32 文字までの指定できる。 ログの中でメッセージを区別するのに便利である。
2276 .TP 
2277 \fB\-\-ulog\-cprange\fP \fIsize\fP
2278 ユーザー空間にコピーするパケットのバイト数。 値が 0 の場合、 サイズに関係なく全パケットをコピーする。 デフォルトは 0 である。
2279 .TP 
2280 \fB\-\-ulog\-qthreshold\fP \fIsize\fP
2281 カーネル内部のキューに入れられるパケットの数。 例えば、 この値を 10 にした場合、 カーネル内部で 10 個のパケットをまとめ、 1 つの
2282 netlink マルチパートメッセージとしてユーザー空間に送る。 (過去のものとの互換性のため) デフォルトは 1 である。
2283 .br