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