blob: 8aaa69d4b52f6f0509ed2cd4c91f220a88555908 [file] [log] [blame]
Marc Bouchere6869a82000-03-20 06:03:29 +00001.TH IPTABLES 8 "Mar 20, 2000" "" ""
2.\"
3.\" Man page written by Herve Eychenne <eychenne@info.enserb.u-bordeaux.fr>
4.\" It is based on ipchains man page.
5.\"
6.\" ipchains page by Paul ``Rusty'' Russell March 1997
7.\" Based on the original ipfwadm man page by Jos Vos <jos@xos.nl> (see README)
8.\"
9.\" This program is free software; you can redistribute it and/or modify
10.\" it under the terms of the GNU General Public License as published by
11.\" the Free Software Foundation; either version 2 of the License, or
12.\" (at your option) any later version.
13.\"
14.\" This program is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public License
20.\" along with this program; if not, write to the Free Software
21.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22.\"
23.\"
24.SH NAME
25iptables \- IP packet filter administration
26.SH SYNOPSIS
27.BR "iptables -[ADC] " "chain rule-specification [options]"
28.br
29.BR "iptables -[RI] " "chain rulenum rule-specification [options]"
30.br
31.BR "iptables -D " "chain rulenum [options]"
32.br
33.BR "iptables -[LFZ] " "[chain] [options]"
34.br
35.BR "iptables -[NX] " "chain"
36.br
37.BR "iptables -P " "chain target [options]"
38.br
39.BR "iptables -E " "old-chain-name new-chain-name"
40.SH DESCRIPTION
41.B Iptables
42is used to set up, maintain, and inspect the tables of IP packet
43filter rules in the Linux kernel. There are several different tables
44which may be defined, and each table contains a number of built-in
45chains, and may contain user-defined chains.
46
47Each chain is a list of rules which can match a set of packets: each
48rule specifies what to do with a packet which matches. This is called
49a `target', which may be a jump to a user-defined chain in the same
50table.
51
52.SH TARGETS
53A firewall rule specifies criteria for a packet, and a target. If the
54packet does not match, the next rule in the chain is the examined; if
55it does match, then the next rule is specified by the value of the
56target, which can be the name of a user-defined chain, or one of the
57special values
58.IR ACCEPT ,
59.IR DROP ,
60.IR QUEUE ,
61or
62.IR RETURN .
63.PP
64.I ACCEPT
65means to let the packet through.
66.I DROP
67means to drop the packet on the floor.
68.I QUEUE
69means to pass the packet to userspace.
70.I RETURN
71means stop traversing this chain, and resume at the next rule in the
72previous (calling) chain. If the end of a built-in chain is reached,
73or a rule in a built-in chain with target
74.I RETURN
75is matched, the target specified by the chain policy determines the
76fate of the packet.
77.SH TABLES
78There are current three tables (which tables are present at any time
79depends on the kernel configuration options and which modules are
80present).
81.TP
82.B "-t, --table"
83This option specifies the packet matching table which the command
84should operate on. If the kernel is configured with automatic module
85loading, an attempt will be made to load the appropriate module for
86that table if it is not already there.
87
88The tables are as follows:
89.BR "filter"
90This is the default table, and contains the built-in chains INPUT (for
91packets coming into the box itself), FORWARD (for packets being routed
92through the box), and OUTPUT (for locally-generated packets).
93.BR "nat"
94This table is consulted when a packet which is creates a new
95connection is encountered. It consists of three built-ins: PREROUTING
96(for altering packets as soon as they come in), OUTPUT (for altering
97locally-generated packets before routing), and POSTROUTING (for
98altering packets as they are about to go out).
99.BR "mangle"
100This table is used for specialized packet alteration. It has two
101built-in chains: PREROUTING (for altering incoming packets before
102routing) and OUTPUT (for altering locally-generated packets before
103routing).
104.SH OPTIONS
105The options that are recognized by
106.B iptables
107can be divided into several different groups.
108.SS COMMANDS
109These options specify the specific action to perform; only one of them
110can be specified on the command line, unless otherwise specified
111below. For all the long versions of the command and option names, you
112only need to use enough letters to ensure that
113.B iptables
114can differentiate it from all other options.
115.TP
116.BR "-A, --append"
117Append one or more rules to the end of the selected chain.
118When the source and/or destination names resolve to more than one
119address, a rule will be added for each possible address combination.
120.TP
121.BR "-D, --delete"
122Delete one or more rules from the selected chain. There are two
123versions of this command: the rule can be specified as a number in the
124chain (starting at 1 for the first rule) or a rule to match.
125.TP
126.B "-R, --replace"
127Replace a rule in the selected chain. If the source and/or
128destination names resolve to multiple addresses, the command will
129fail. Rules are numbered starting at 1.
130.TP
131.B "-I, --insert"
132Insert one or more rules in the selected chain as the given rule
133number. So, if the rule number is 1, the rule or rules are inserted
134at the head of the chain. This is also the default if no rule number
135is specified.
136.TP
137.B "-L, --list"
138List all rules in the selected chain. If no chain is selected, all
139chains are listed. It is legal to specify the
140.B -Z
141(zero) option as well, in which case the chain(s) will be atomically
142listed and zeroed. The exact output is effected by the other
143arguments given.
144.TP
145.B "-F, --flush"
146Flush the selected chain. This is equivalent to deleting all the
147rules one by one.
148.TP
149.B "-Z, --zero"
150Zero the packet and byte counters in all chains. It is legal to
151specify the
152.B "-L, --list"
153(list) option as well, to see the counters immediately before they are
154cleared; see above.
155.TP
156.B "-N, --new-chain"
157Create a new user-defined chain of the given name. There must be no
158target of that name already.
159.TP
160.B "-X, --delete-chain"
161Delete the specified user-defined chain. There must be no references
162to the chain (if there are you must delete or replace the referring
163rules before the chain can be deleted). If no argument is given, it
164will attempt to delete every non-builtin chain.
165.TP
166.B "-P, --policy"
167Set the policy for the chain to the given target. See the section
168.TP
169.B "-E, --rename-chain"
170Rename the user specified chain to the user supplied name; this is
171cosmetic, and has no effect on the structure of the table.
172.B TARGETS
173for the legal targets. Only non-userdefined chains can have policies,
174and neither built-in nor user-defined chains can be policy targets.
175.TP
176.B -h
177Help.
178Give a (currently very brief) description of the command syntax.
179.SS PARAMETERS
180The following parameters make up a rule specification (as used in the
181add, delete, replace, append and check commands).
182.TP
Rusty Russell2e0a3212000-04-19 11:23:18 +0000183.BR "-p, --protocol " "[!] \fIprotocol\fP"
Marc Bouchere6869a82000-03-20 06:03:29 +0000184The protocol of the rule or of the packet to check.
185The specified protocol can be one of
186.IR tcp ,
187.IR udp ,
188.IR icmp ,
189or
190.IR all ,
191or it can be a numeric value, representing one of these protocols or a
192different one. Also a protocol name from /etc/protocols is allowed.
193A "!" argument before the protocol inverts the
194test. The number zero is equivalent to
195.IR all .
196Protocol
197.I all
198will match with all protocols and is taken as default when this
199option is omitted.
200.I All
201may not be used in in combination with the check command.
202.TP
203.BR "-s, --source " "[!] \fIaddress\fP[/\fImask\fP]"
204Source specification.
205.I Address
206can be either a hostname, a network name, or a plain IP address.
207The
208.I mask
209can be either a network mask or a plain number,
210specifying the number of 1's at the left side of the network mask.
211Thus, a mask of
212.I 24
213is equivalent to
214.IR 255.255.255.0 .
215A "!" argument before the address specification inverts the sense of
216the address. The flag
217.B --src
218is a convenient alias for this option.
219.TP
220.BR "-d, --destination " "[!] \fIaddress\fP[/\fImask\fP]"
221Destination specification.
222See the description of the
223.B -s
224(source) flag for a detailed description of the syntax. The flag
225.B --dst
226is an alias for this option.
227.TP
228.BI "-j, --jump " "target"
229This specifies the target of the rule; ie. what to do if the packet
230matches it. The target can be a user-defined chain (not the one this
231rule is in), one of the special builtin targets which decide the fate
232of the packet immediately, or an extension (see
233.B EXTENSIONS
234below). If this
235option is omitted in a rule, then matching the rule will have no
236effect on the packet's fate, but the counters on the rule will be
237incremented.
238.TP
239.BR "-i, --in-interface " "[!] [\fIname\fP]"
240Optional name of an interface via which a packet is received (for
241packets entering the
242.BR INPUT ,
243.B FORWARD
244and
245.B PREROUTING
246chains). When the "!" argument is used before the interface name, the
247sense is inverted. If the interface name ends in a "+", then any
248interface which begins with this name will match. If this option is
249omitted, the string "+" is assumed, which will match with any
250interface name.
251.TP
252.BR "-o, --out-interface " "[!] [\fIname\fP]"
253Optional name of an interface via which a packet is going to
254be sent (for packets entering the
255.BR FORWARD ,
256.B OUTPUT
257and
258.B POSTROUTING
259chains). When the "!" argument is used before the interface name,
260the sense is inverted. If the interface name ends in a "+", then any
261interface which begins with this name will match. If this option is
262omitted, the string "+" is assumed, which will match with any
263interface name.
264.TP
265.B "[!] " "-f, --fragment"
266This means that the rule only refers to second and further fragments
267of fragmented packets. Since there is no way to tell the source or
268destination ports of such a packet (or ICMP type), such a packet will
269not match any rules which specify them. When the "!" argument
270precedes the "-f" flag, the sense is inverted.
271.SS "OTHER OPTIONS"
272The following additional options can be specified:
273.TP
274.B "-v, --verbose"
275Verbose output. This option makes the list command show the interface
276address, the rule options (if any), and the TOS masks. The packet and
277byte counters are also listed, with the suffix 'K', 'M' or 'G' for
2781000, 1,000,000 and 1,000,000,000 multipliers respectively (but see
279the
280.B -x
281flag to change this).
282For appending, insertion, deletion and replacement, this causes
283detailed information on the rule or rules to be printed.
284.TP
285.B "-n, --numeric"
286Numeric output.
287IP addresses and port numbers will be printed in numeric format.
288By default, the program will try to display them as host names,
289network names, or services (whenever applicable).
290.TP
291.B "-x, --exact"
292Expand numbers.
293Display the exact value of the packet and byte counters,
294instead of only the rounded number in K's (multiples of 1000)
295M's (multiples of 1000K) or G's (multiples of 1000M). This option is
Marc Boucherf127a192000-03-20 08:32:15 +0000296only relevant for the
Marc Bouchere6869a82000-03-20 06:03:29 +0000297.B -L
298command.
299.TP
300.B "--line-numbers"
301When listing rules, add line numbers to the beginning of each rule,
302corresponding to that rule's position in the chain.
303.SH MATCH EXTENSIONS
304iptables can use extended packet matching modules. The following are
Marc Boucherf127a192000-03-20 08:32:15 +0000305included in the base package, and most of these can be preceded by a
Marc Bouchere6869a82000-03-20 06:03:29 +0000306.B !
307to invert the sense of the match.
308.SS tcp
309These extensions are loaded if `--protocol tcp' is specified, and no
310other match is specified. It provides the following options:
311.TP
312.BR "--source-port " "[!] [\fIport[:port]\fP] or [\fIport[-port]]\fP]"
313Source port or port range specification. This can either be a service
314name or a port number. An inclusive range can also be specified,
315using the format
316.IR port : port
317or
318.IR port - port .
319If the first port is omitted, "0" is assumed; if the last is omitted,
320"65535" is assumed.
321If the second port greater then the first they will be swapped.
322The flag
323.B --sport
324is an alias for this option.
325.TP
326.BR "--destination-port " "[!] [\fIport[:port]\fP] or [\fIport[-port]]\fP"
327Destination port or port range specification. The flag
328.B --dport
329is an alias for this option.
330.TP
331.BR "--tcp-flags " "[!] \fImask\fP \fIcomp\fP"
332Match when the TCP flags are as specified. The first argument is the
333flags which we should examine, written as a comma-separated list, and
334the second argument is a comma-separated list of flags which must be
335set. Flags are:
336.BR "SYN ACK FIN RST URG PSH ALL NONE" .
337Hence the command
338.br
Marc Boucherf127a192000-03-20 08:32:15 +0000339 iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST SYN
Marc Bouchere6869a82000-03-20 06:03:29 +0000340.br
341will only match packets with the SYN flag set, and the ACK, FIN and
342RST flags unset.
343.TP
344.B "[!] --syn"
345Only match TCP packets with the SYN bit set and the ACK and FIN bits
346cleared. Such packets are used to request TCP connection initiation;
347for example, blocking such packets coming in an interface will prevent
348incoming TCP connections, but outgoing TCP connections will be
349unaffected.
350It is equivalent to \fB--tcp-flags SYN,RST,ACK SYN\fP.
351If the "!" flag precedes the "--syn", the sense of the
352option is inverted.
353.TP
354.BR "--tcp-option " "[!] \fInumber\fP"
355Match if TCP option set.
356.SS udp
357These extensions are loaded if `--protocol udp' is specified, and no
358other match is specified. It provides the following options:
359.TP
360.BR "--source-port " "[!] [\fIport[:port]\fP] or [\fIport[-port]]\fP"
361Source port or port range specification.
362See the description of the
363.B --source-port
364option of the TCP extension for details.
365.TP
366.BR "--destination-port " "[!] [\fIport[:port]\fP] or [\fIport[-port]]\fP"
367Destination port or port range specification.
368See the description of the
369.B --destination-port
370option of the TCP extension for details.
371.SS icmp
372This extension is loaded if `--protocol icmp' is specified, and no
373other match is specified. It provides the following option:
374.TP
375.BR "--icmp-type " "[!] \fItypename\fP"
376This allows specification of the ICMP type, which can be a numeric
377ICMP type, or one of the ICMP type names shown by the command
378.br
379 iptables -p icmp -h
380.br
381.SS mac
382.TP
383.BR "--mac-source " "[!] \fIaddress\fP"
384Match source MAC address. It must be of the form XX:XX:XX:XX:XX:XX.
385Note that this only makes sense for packets entering the
386.BR PREROUTING ,
387or
388.B INPUT
389chains from an ethernet device.
390.SS limit
391This module matches at a limited rate using a token bucket filter: it
392can be used in combination with the LOG target to give limited
393logging. A rule using this extension will match until this limit is
394reached (unless the `!' flag is used).
395.TP
396.BI "--limit " "rate"
397Maximum average matching rate: specified as a number, with an optional
398`/second', `/minute', `/hour', or `/day' suffix; the default is
3993/hour.
400.TP
401.BI "--limit-burst " "number"
402The maximum initial number of packets to match: this number gets
403recharged by one every time the limit specified above is not reached,
404up to this number; the default is 5.
405.SS multiport
406This module matches a set of source or destination ports. Up to 15
407ports can be specified. It can only be used in conjunction with
408.B "-p tcp"
409or
410.BR "-p udp" .
411.TP
412.BR "--source-port" " [\fIport[,port]\fP]"
413Match if the source port is one of the given ports.
414.TP
415.BR "--destination-port" " [\fIport[,port]\fP]"
416Match if the destination port is one of the given ports.
417.TP
418.BR "--port" " [\fIport[,port]\fP]"
419Match if the both the source and destination ports are equal to each
420other and to one of the given ports.
421.SS mark
422This module matches the netfilter mark field associated with a packet
423(which can be set using the
424.B MARK
425target below).
426.TP
427.BI "--mark " "value[/mask]"
428Matches packets with the given unsigned mark value (if a mask is
429specified, this is logically ANDed with the mark before the
430comparison).
431.SS owner
432This module attempts to match various characteristics of the packet
433creator, for locally-generated packets. It is only valid in the
434OUTPUT chain, and even this some packets (such as ICMP ping responses)
435may have no owner, and hence never match.
436.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000437.BI "--uid-owner " "userid"
Marc Bouchere6869a82000-03-20 06:03:29 +0000438Matches if the packet was created by a process with the given
439effective user id.
440.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000441.BI "--gid-owner " "groupid"
Marc Bouchere6869a82000-03-20 06:03:29 +0000442Matches if the packet was created by a process with the given
443effective group id.
444.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000445.BI "--pid-owner " "processid"
Marc Bouchere6869a82000-03-20 06:03:29 +0000446Matches if the packet was created by a process with the given
447process id.
448.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000449.BI "--sid-owner " "sessionid"
Marc Bouchere6869a82000-03-20 06:03:29 +0000450Matches if the packet was created by a process in the given session
451group.
452.SS state
453This module, when combined with connection tracking, allows access to
454the connection tracking state for this packet.
455.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000456.BI "--state " "state"
Marc Bouchere6869a82000-03-20 06:03:29 +0000457Where state is a comma separated list of the connection states to
458match. Possible states are
459.B INVALID
460meaning that the packet is associated with no known connection,
461.B ESTABLISHED
462meaning that the packet is associated with a connection which has seen
463packets in both directions,
464.B NEW
465meaning that the packet has started a new connection, or otherwise
466associated with a connection which has not seen packets in both
467directions, and
468.B RELATED
469meaning that the packet is starting a new connection, but is
470associated with an existing connection, such as an FTP data transfer,
471or an ICMP error.
472.SS unclean
473This module takes no options, but attempts to match packets which seem
474malformed or unusual. This is regarded as experimental.
475.SS tos
476This module matches the 8 bits of Type of Service field in the IP
477header (ie. including the precedence bits).
478.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000479.BI "--tos " "tos"
Marc Bouchere6869a82000-03-20 06:03:29 +0000480The argument is either a standard name, (use
481.br
482 iptables -m tos -h
483.br
484to see the list), or a numeric value to match.
485.SH TARGET EXTENSIONS
486iptables can use extended target modules: the following are included
487in the standard distribution.
488.SS LOG
489Turn on kernel logging of matching packets. When this option is set
490for a rule, the Linux kernel will print some information on all
491matching packets (like most IP header fields) via
492.IR printk ().
493.TP
494.BI "--log-level " "level"
495Level of logging (numeric or see \fIsyslog.conf\fP(5)).
496.TP
497.BI "--log-prefix " "prefix"
498Prefix log messages with the specified prefix; up to 14 letters long,
499and useful for distinguishing messages in the logs.
500.TP
501.B --log-tcp-sequence
502Log TCP sequence numbers. This is a security risk if the log is
503readable by users.
504.TP
505.B --log-tcp-options
506Log options from the TCP packet header.
507.TP
508.B --log-ip-options
509Log options from the IP packet header.
510.SS MARK
511This is used to set the netfilter mark value associated with the
512packet. It is only valid in the
513.B mangle
514table.
515.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000516.BI "--set-mark " "mark"
Marc Bouchere6869a82000-03-20 06:03:29 +0000517.SS REJECT
518This is used to send back an error packet in response to the matched
519packet: otherwise it is equivalent to
520.BR DROP .
521This target is only valid in the
522.BR INPUT ,
523.B FORWARD
524and
525.B OUTPUT
526chains. Several options control the nature of the error packet
527returned:
528.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000529.BI "--reject-with " "type"
Marc Bouchere6869a82000-03-20 06:03:29 +0000530The type given can be
531.BR icmp-net-unreachable ,
532.BR icmp-host-unreachable ,
533.BR icmp-port-unreachable or
534.BR icmp-proto-unreachable
535which return the appropriate ICMP error message (net-unreachable is
Rusty Russella1ce9f92000-03-24 08:39:16 +0000536the default). The option
Marc Bouchere6869a82000-03-20 06:03:29 +0000537.B echo-reply
Rusty Russella1ce9f92000-03-24 08:39:16 +0000538is also allowed; it can only be used for rules which specify an ICMP
539ping packet, and generates a ping reply.
Marc Bouchere6869a82000-03-20 06:03:29 +0000540.SS TOS
541This is used to set the 8-bit Type of Service field in the IP header.
542It is only valid in the
543.B mangle
544table.
545.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000546.BI "--set-tos " "tos"
Marc Bouchere6869a82000-03-20 06:03:29 +0000547You can use a numeric TOS values, or use
548.br
549 iptables -j TOS -h
550.br
551to see the list of valid TOS names.
552.SS MIRROR
553This is an experimental demonstration target which inverts the source
554and destination fields in the IP header and retransmits the packet.
555It is only valid in the
556.BR INPUT ,
557.B FORWARD
558and
559.B OUTPUT
560chains.
561.SS SNAT
562This target is only valid in the
563.B nat
564table, in the
565.B POSTROUTING
566chain. It specifies that the source address of the packet should be
567modified (and all future packets in this connection will also be
568mangled), and rules should cease being examined. It takes one option:
569.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000570.BI "--to-source " "<ipaddr>[-<ipaddr>][:port-port]"
Marc Bouchere6869a82000-03-20 06:03:29 +0000571which can specify a single new source IP address, an inclusive range
572of IP addresses, and optionally, a port range (which is only valid if
573the rule also specifies
574.B "-p tcp"
575or
576.BR "-p udp" ).
577If no port range is specified, then source ports below 512 will be
578mapped to other ports below 512: those between 1024 will be mapped to
579ports below 1024, and other ports will be mapped to 1024 or above.
580Where possible, no port alteration will occur.
581.SS DNAT
582This target is only valid in the
583.B nat
584table, in the
585.B PREROUTING
586and
587.B OUTPUT
588chains. It specifies that the destination address of the packet
589should be modified (and all future packets in this connection will
590also be mangled), and rules should cease being examined. It takes one
591option:
592.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000593.BI "--to-destination " "<ipaddr>[-<ipaddr>][:port-port]"
Marc Bouchere6869a82000-03-20 06:03:29 +0000594which can specify a single new destination IP address, an inclusive
595range of IP addresses, and optionally, a port range (which is only
596valid if the rule also specifies
597.B "-p tcp"
598or
599.BR "-p udp" ).
600If no port range is specified, then the destination port will never be
601modified.
602.SS MASQUERADE
603This target is only valid in the
604.B nat
605table, in the
606.B POSTROUTING
607chain. It should only be used with dynamically assigned IP (dialup)
608connections: if you have a static IP address, you should use the SNAT
609target. Masquerading is equivalent to specifying a mapping to the IP
610address of the interface the packet is going out, but also has the
611effect that connections are
612.I forgotten
Marc Boucherf127a192000-03-20 08:32:15 +0000613when the interface goes down. This is the correct behavior when the
Marc Bouchere6869a82000-03-20 06:03:29 +0000614next dialup is unlikely to have the same interface address (and hence
615any established connections are lost anyway). It takes one option:
616.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000617.BI "--to-ports " "<port>[-<port>]"
Marc Bouchere6869a82000-03-20 06:03:29 +0000618This specifies a range of source ports to use, overriding the default
619.B SNAT
620source port-selection heuristics (see above). This is only valid with
621if the rule also specifies
622.B "-p tcp"
623or
624.BR "-p udp" ).
625.SS REDIRECT
626This target is only valid in the
627.B nat
628table, in the
629.B PREROUTING
630and
631.B OUTPUT
632chains. It alters the destination IP address to send the packet to
633the machine itself (locally-generated packets are mapped to the
634127.0.0.1 address).
635It takes one option:
636.TP
Bert Hubert20ecf7a2000-03-24 01:56:37 +0000637.BI "--to-ports " "<port>[-<port>]"
Marc Bouchere6869a82000-03-20 06:03:29 +0000638This specifies a destination port or range or ports to use: without
639this, the destination port is never altered. This is only valid with
640if the rule also specifies
641.B "-p tcp"
642or
643.BR "-p udp" ).
644.TP
645.SH DIAGNOSTICS
646Various error messages are printed to standard error. The exit code
647is 0 for correct functioning. Errors which appear to be caused by
648invalid or abused command line parameters cause an exit code of 2, and
649other errors cause an exit code of 1.
650.SH BUGS
651Check is not implemented (yet).
652.SH COMPATIBILITY WITH IPCHAINS
653This
654.B iptables
655is very similar to ipchains by Rusty Russell. The main difference is
656that the chains
657.B INPUT
658and
659.B OUTPUT
660are only traversed for packets coming into the local host and
661originating from the local host respectively. Hence every packet only
662passes through one of the three chains; previously a forwarded packet
663would pass through all three.
664.PP
665The other main difference is that
666.B -i
667refers to the input interface;
668.B -o
669refers to the output interface, and both are available for packets
670entering the
671.B FORWARD
672chain.
673.PP The various forms of NAT have been separated out;
674.B iptables
675is a pure packet filter when using the default `filter' table, with
676optional extension modules. This should simplify much of the previous
677confusion over the combination of IP masquerading and packet filtering
678seen previously. So the following options are handled differently:
679.br
680 -j MASQ
681.br
682 -M -S
683.br
684 -M -L
685.br
686There are several other changes in iptables.
687.SH SEE ALSO
688The iptables-HOWTO, which details more iptables usage, and the
689netfilter-hacking-HOWTO which details the internals.
Marc Boucherf127a192000-03-20 08:32:15 +0000690.SH AUTHORS
Marc Bouchere6869a82000-03-20 06:03:29 +0000691Rusty Russell wrote iptables, in early consultation with Michael
692Neuling.
693.PP
Marc Boucherf127a192000-03-20 08:32:15 +0000694Marc Boucher made Rusty abandon ipnatctl by lobbying for a generic packet
695selection framework in iptables, then wrote the mangle table, the owner match,
696the mark stuff, and ran around doing cool stuff everywhere.
Marc Bouchere6869a82000-03-20 06:03:29 +0000697.PP
698James Morris wrote the TOS target, and tos match.
699.PP
700Jozsef Kadlecsik wrote the REJECT target.
701.PP
702The Netfilter Core Team is: Marc Boucher, Rusty Russell.
703.\" .. and did I mention that we are incredibly cool people?