]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ipfilter/man/ipf.8
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ipfilter / man / ipf.8
1 .\" $FreeBSD$
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 \-6AcdDEInoPrsvVyzZ
9 ] [
10 .B \-l
11 <block|pass|nomatch>
12 ] [
13 .B \-T
14 <optionlist>
15 ] [
16 .B \-F
17 <i|o|a|s|S>
18 ]
19 .B \-f
20 <\fIfilename\fP>
21 [
22 .B \-f
23 <\fIfilename\fP>
24 [...]]
25 .SH DESCRIPTION
26 .PP
27 \fBipf\fP opens the filenames listed (treating "\-" as stdin) and parses the
28 file for a set of rules which are to be added or removed from the packet
29 filter rule set.
30 .PP
31 Each rule processed by \fBipf\fP
32 is added to the kernel's internal lists if there are no parsing problems.
33 Rules are added to the end of the internal lists, matching the order in
34 which they appear when given to \fBipf\fP.
35 .SH OPTIONS
36 .TP
37 .B \-6
38 This option is required to parse IPv6 rules and to have them loaded.
39 .TP
40 .B \-A
41 Set the list to make changes to the active list (default).
42 .TP
43 .B \-c <language>
44 This option causes \fBipf\fP to generate output files for a compiler that
45 supports \fBlanguage\fI.  At present, the only target language supported is
46 \fBC\fB (-cc) for which two files - \fBip_rules.c\fP
47 and \fBip_rules.h\fP are generated in the \fBCURRENT DIRECTORY\fP when
48 \fBipf\fP is being run.  These files can be used with the
49 \fBIPFILTER_COMPILED\fP kernel option to build filter rules staticlly into
50 the kernel.
51 .TP
52 .B \-d
53 Turn debug mode on.  Causes a hexdump of filter rules to be generated as
54 it processes each one.
55 .TP
56 .B \-D
57 Disable the filter (if enabled).  Not effective for loadable kernel versions.
58 .TP
59 .B \-E
60 Enable the filter (if disabled).  Not effective for loadable kernel versions.
61 .TP
62 .BR \-F \0<i|o|a>
63 This option specifies which filter list to flush.  The parameter should
64 either be "i" (input), "o" (output) or "a" (remove all filter rules).
65 Either a single letter or an entire word starting with the appropriate
66 letter maybe used.  This option maybe before, or after, any other with
67 the order on the command line being that used to execute options.
68 .TP
69 .BR \-F \0<s|S>
70 To flush entries from the state table, the \fB-F\fP option is used in
71 conjunction with either "s" (removes state information about any non-fully
72 established connections) or "S" (deletes the entire state table).  Only
73 one of the two options may be given.  A fully established connection
74 will show up in \fBipfstat -s\fP output as 5/5, with deviations either
75 way indicating it is not fully established any more.
76 .TP
77 .BR \-F <5|6|7|8|9|10|11>
78 For the TCP states that represent the closing of a connection has begun,
79 be it only one side or the complete connection, it is possible to flush
80 those states directly using the number corresponding to that state.
81 The numbers relate to the states as follows: 5 = close-wait, 6 = fin-wait-1,
82 7 = closing, 8 = last-ack, 9 = fin-wait-2, 10 = time-wait, 11 = closed.
83 .TP
84 .BR \-F <number>
85 If the argument supplied to \fB-F\fP is greater than 30, then state table
86 entries that have been idle for more than this many seconds will be flushed.
87 .TP
88 .BR \-f \0<filename>
89 This option specifies which files
90 \fBipf\fP should use to get input from for modifying the packet filter rule
91 lists.
92 .TP
93 .B \-I
94 Set the list to make changes to the inactive list.
95 .TP
96 .B \-l \0<pass|block|nomatch>
97 Use of the \fB-l\fP flag toggles default logging of packets.  Valid
98 arguments to this option are \fBpass\fP, \fBblock\fP and \fBnomatch\fP.
99 When an option is set, any packet which exits filtering and matches the
100 set category is logged.  This is most useful for causing all packets
101 which don't match any of the loaded rules to be logged.
102 .TP
103 .B \-n
104 This flag (no-change) prevents \fBipf\fP from actually making any ioctl
105 calls or doing anything which would alter the currently running kernel.
106 .TP
107 .B \-o
108 Force rules by default to be added/deleted to/from the output list, rather
109 than the (default) input list.
110 .TP
111 .B \-P
112 Add rules as temporary entries in the authentication rule table.
113 .TP
114 .B \-r
115 Remove matching filter rules rather than add them to the internal lists
116 .TP
117 .B \-s
118 Swap the active filter list in use to be the "other" one.
119 .TP
120 .B \-T <optionlist>
121 This option allows run-time changing of IPFilter kernel variables.  Some
122 variables require IPFilter to be in a disabled state (\fB-D\fP) for changing,
123 others do not.  The optionlist parameter is a comma separated list of tuning
124 commands.  A tuning command is either "list" (retrieve a list of all variables
125 in the kernel, their maximum, minimum and current value), a single variable
126 name (retrieve its current value) and a variable name with a following
127 assignment to set a new value.  Some examples follow.
128 .nf
129 # Print out all IPFilter kernel tunable parameters
130 ipf -T list
131 # Display the current TCP idle timeout and then set it to 3600
132 ipf -D -T fr_tcpidletimeout,fr_tcpidletimeout=3600 -E
133 # Display current values for fr_pass and fr_chksrc, then set fr_chksrc to 1.
134 ipf -T fr_pass,fr_chksrc,fr_chksrc=1
135 .fi
136 .TP
137 .B \-v
138 Turn verbose mode on.  Displays information relating to rule processing.
139 .TP
140 .B \-V
141 Show version information.  This will display the version information compiled
142 into the ipf binary and retrieve it from the kernel code (if running/present).
143 If it is present in the kernel, information about its current state will be
144 displayed (whether logging is active, default filtering, etc).
145 .TP
146 .B \-y
147 Manually resync the in-kernel interface list maintained by IP Filter with
148 the current interface status list.
149 .TP
150 .B \-z
151 For each rule in the input file, reset the statistics for it to zero and
152 display the statistics prior to them being zeroed.
153 .TP
154 .B \-Z
155 Zero global statistics held in the kernel for filtering only (this doesn't
156 affect fragment or state statistics).
157 .DT
158 .SH FILES
159 /dev/ipauth
160 .br
161 /dev/ipl
162 .br
163 /dev/ipstate
164 .SH SEE ALSO
165 ipftest(1), mkfilters(1), ipf(4), ipl(4), ipf(5), ipfstat(8), ipmon(8), ipnat(8)
166 .SH DIAGNOSTICS
167 .PP
168 Needs to be run as root for the packet filtering lists to actually
169 be affected inside the kernel.
170 .SH BUGS
171 .PP
172 If you find any, please send email to me at darrenr@pobox.com