Major cleanup of the base IPFilter:
[dragonfly.git] / contrib / ipfilter / man / ipf.8
1 .\" $FreeBSD: src/contrib/ipfilter/man/ipf.8,v 1.3.2.2 2003/03/01 03:55:53 darrenr Exp $
2 .\" $FreeBSD: src/contrib/ipfilter/man/ipf.8,v 1.3.2.3 2004/07/04 09:24:40 darrenr Exp $
3 .TH IPF 8
4 .SH NAME
5 ipf \- alters packet filtering lists for IP packet input and output
6 .SH SYNOPSIS
7 .B ipf
8 [
9 .B \-6AdDEInoPrsUvVyzZ
10 ] [
11 .B \-l
12 <block|pass|nomatch>
13 ] [
14 .B \-F
15 <i|o|a|s|S>
16 ]
17 .B \-f
18 <\fIfilename\fP>
19 [
20 .B \-f
21 <\fIfilename\fP>
22 [...]]
23 .SH DESCRIPTION
24 .PP
25 \fBipf\fP opens the filenames listed (treating "\-" as stdin) and parses the
26 file for a set of rules which are to be added or removed from the packet
27 filter rule set.
28 .PP
29 Each rule processed by \fBipf\fP
30 is added to the kernel's internal lists if there are no parsing problems.
31 Rules are added to the end of the internal lists, matching the order in
32 which they appear when given to \fBipf\fP.
33 .SH OPTIONS
34 .TP
35 .B \-6
36 This option is required to parse IPv6 rules and to have them loaded.
37 .TP
38 .B \-A
39 Set the list to make changes to the active list (default).
40 .TP
41 .B \-d
42 Turn debug mode on.  Causes a hexdump of filter rules to be generated as
43 it processes each one.
44 .TP
45 .B \-D
46 Disable the filter (if enabled).  Not effective for loadable kernel versions.
47 .TP
48 .B \-E
49 Enable the filter (if disabled).  Not effective for loadable kernel versions.
50 .TP
51 .BR \-F \0<i|o|a>
52 This option specifies which filter list to flush.  The parameter should
53 either be "i" (input), "o" (output) or "a" (remove all filter rules).
54 Either a single letter or an entire word starting with the appropriate
55 letter maybe used.  This option maybe before, or after, any other with
56 the order on the command line being that used to execute options.
57 .TP
58 .BR \-F \0<s|S>
59 To flush entries from the state table, the \fB-F\fP option is used in
60 conjunction with either "s" (removes state information about any non-fully
61 established connections) or "S" (deletes the entire state table).  Only
62 one of the two options may be given.  A fully established connection
63 will show up in \fBipfstat -s\fP output as 4/4, with deviations either
64 way indicating it is not fully established any more.
65 .TP
66 .BR \-f \0<filename>
67 This option specifies which files
68 \fBipf\fP should use to get input from for modifying the packet filter rule
69 lists.
70 .TP
71 .B \-I
72 Set the list to make changes to the inactive list.
73 .TP
74 .B \-l \0<pass|block|nomatch>
75 Use of the \fB-l\fP flag toggles default logging of packets.  Valid
76 arguments to this option are \fBpass\fP, \fBblock\fP and \fBnomatch\fP.
77 When an option is set, any packet which exits filtering and matches the
78 set category is logged.  This is most useful for causing all packets
79 which don't match any of the loaded rules to be logged.
80 .TP
81 .B \-n
82 This flag (no-change) prevents \fBipf\fP from actually making any ioctl
83 calls or doing anything which would alter the currently running kernel.
84 .TP
85 .B \-o
86 Force rules by default to be added/deleted to/from the output list, rather
87 than the (default) input list.
88 .TP
89 .B \-P
90 Add rules as temporary entries in the authentication rule table.
91 .TP
92 .B \-r
93 Remove matching filter rules rather than add them to the internal lists
94 .TP
95 .B \-s
96 Swap the active filter list in use to be the "other" one.
97 .TP
98 .B \-U
99 (SOLARIS 2 ONLY) Block packets travelling along the data stream which aren't
100 recognised as IP packets.  They will be printed out on the console.
101 .TP
102 .B \-v
103 Turn verbose mode on.  Displays information relating to rule processing.
104 .TP
105 .B \-V
106 Show version information.  This will display the version information compiled
107 into the ipf binary and retrieve it from the kernel code (if running/present).
108 If it is present in the kernel, information about its current state will be
109 displayed (whether logging is active, default filtering, etc).
110 .TP
111 .B \-y
112 Manually resync the in-kernel interface list maintained by IP Filter with
113 the current interface status list.
114 .TP
115 .B \-z
116 For each rule in the input file, reset the statistics for it to zero and
117 display the statistics prior to them being zeroed.
118 .TP
119 .B \-Z
120 Zero global statistics held in the kernel for filtering only (this doesn't
121 affect fragment or state statistics).
122 .DT
123 .SH FILES
124 /dev/ipauth
125 .br
126 /dev/ipl
127 .br
128 /dev/ipstate
129 .SH SEE ALSO
130 ipftest(1), mkfilters(1), ipf(4), ipl(4), ipf(5), ipfstat(8), ipmon(8), ipnat(8)
131 .SH DIAGNOSTICS
132 .PP
133 Needs to be run as root for the packet filtering lists to actually
134 be affected inside the kernel.
135 .SH BUGS
136 .PP
137 If you find any, please send email to me at darrenr@pobox.com