]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/man/ipfstat.8
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / man / ipfstat.8
1 .\" $FreeBSD$
2 .TH ipfstat 8
3 .SH NAME
4 ipfstat \- reports on packet filter statistics and filter list
5 .SH SYNOPSIS
6 .B ipfstat
7 [
8 .B \-6aAdfghIilnoRsv
9 ]
10 .br
11 .B ipfstat -t
12 [
13 .B \-6C
14 ] [
15 .B \-D
16 <addrport>
17 ] [
18 .B \-P
19 <protocol>
20 ] [
21 .B \-S
22 <addrport>
23 ] [
24 .B \-T
25 <refresh time>
26 ]
27 .SH DESCRIPTION
28 \fBipfstat\fP examines /dev/kmem using the symbols \fB_fr_flags\fP,
29 \fB_frstats\fP, \fB_filterin\fP, and \fB_filterout\fP.
30 To run and work, it needs to be able to read both /dev/kmem and the
31 kernel itself.  The kernel name defaults to \fB/boot/kernel/kernel\fP.
32 .PP
33 The default behaviour of \fBipfstat\fP
34 is to retrieve and display the accumulated statistics which have been
35 accumulated over time as the kernel has put packets through the filter.
36 .SH OPTIONS
37 .TP
38 .B \-6
39 Display filter lists and states for IPv6, if available.
40 .TP
41 .B \-a
42 Display the accounting filter list and show bytes counted against each rule.
43 .TP
44 .B \-A
45 Display packet authentication statistics.
46 .TP 
47 .B \-C
48 This option is only valid in combination with \fB\-t\fP.
49 Display "closed" states as well in the top. Normally, a TCP connection is
50 not displayed when it reaches the CLOSE_WAIT protocol state. With this
51 option enabled, all state entries are displayed.
52 .TP
53 .BR \-d
54 Produce debugging output when displaying data.
55 .TP
56 .BR \-D \0<addrport>
57 This option is only valid in combination with \fB\-t\fP. Limit the state top
58 display to show only state entries whose destination IP address and port
59 match the addrport argument. The addrport specification is of the form
60 ipaddress[,port].  The ipaddress and port should be either numerical or the
61 string "any" (specifying any IP address resp. any port). If the \fB\-D\fP
62 option is not specified, it defaults to "\fB\-D\fP any,any".
63 .TP
64 .B \-f
65 Show fragment state information (statistics) and held state information (in
66 the kernel) if any is present.
67 .TP
68 .B \-g
69 Show groups currently configured (both active and inactive).
70 .TP
71 .B \-h
72 Show per-rule the number of times each one scores a "hit".  For use in
73 combination with \fB\-i\fP.
74 .TP
75 .B \-i
76 Display the filter list used for the input side of the kernel IP processing.
77 .TP
78 .B \-I
79 Swap between retrieving "inactive"/"active" filter list details.  For use
80 in combination with \fB\-i\fP.
81 .TP
82 .B \-n
83 Show the "rule number" for each rule as it is printed.
84 .TP
85 .B \-o
86 Display the filter list used for the output side of the kernel IP processing.
87 .TP
88 .BR \-P \0<protocol>
89 This option is only valid in combination with \fB\-t\fP. Limit the state top
90 display to show only state entries that match a specific protocol. The
91 argument can be a protocol name (as defined in \fB/etc/protocols\fP) or a
92 protocol number. If this option is not specified, state entries for any
93 protocol are specified.
94 .TP
95 .BR \-R
96 Don't try to resolve addresses to hostnames and ports to services while
97 printing statistics.
98 .TP
99 .B \-s
100 Show packet/flow state information (statistics only).
101 .TP
102 .B \-sl
103 Show held state information (in the kernel) if any is present (no statistics).
104 .TP
105 .BR \-S \0<addrport>
106 This option is only valid in combination with \fB\-t\fP. Limit the state top
107 display to show only state entries whose source IP address and port match
108 the addrport argument. The addrport specification is of the form
109 ipaddress[,port].  The ipaddress and port should be either numerical or the
110 string "any" (specifying any IP address resp. any port). If the \fB\-S\fP
111 option is not specified, it defaults to "\fB\-S\fP any,any".
112 .TP
113 .B \-t
114 Show the state table in a way similar to the way \fBtop(1)\fP shows the process
115 table. States can be sorted using a number of different ways. This option
116 requires \fBcurses(3)\fP and needs to be compiled in. It may not be available on
117 all operating systems. See below, for more information on the keys that can
118 be used while ipfstat is in top mode.
119 .TP
120 .BR \-T \0<refreshtime>
121 This option is only valid in combination with \fB\-t\fP. Specifies how often
122 the state top display should be updated. The refresh time is the number of
123 seconds between an update. Any positive integer can be used. The default (and
124 minimal update time) is 1.
125 .TP
126 .B \-v
127 Turn verbose mode on.  Displays more debugging information.  When used with
128 either \fB-i\fP or \fB-o\fP, counters associated with the rule, such as the
129 number of times it has been matched and the number of bytes from such packets
130 is displayed.  For "keep state" rules, a count of the number of state sessions
131 active against the rule is also displayed.
132 .SH SYNOPSIS
133 The role of \fBipfstat\fP is to display current kernel statistics gathered
134 as a result of applying the filters in place (if any) to packets going in and
135 out of the kernel.  This is the default operation when no command line
136 parameters are present.
137 .PP
138 When supplied with either \fB\-i\fP or \fB\-o\fP, it will retrieve and display
139 the appropriate list of filter rules currently installed and in use by the
140 kernel.
141 .PP
142 One of the statistics that \fBipfstat\fP shows is \fBticks\fP.
143 This number indicates how long the filter has been enabled.
144 The number is incremented every half\-second.
145 .SH STATE TOP
146 Using the \fB\-t\fP option \fBipfstat\fP will enter the state top mode. In
147 this mode the state table is displayed similar to the way \fBtop\fP displays
148 the process table. The \fB\-C\fP, \fB\-D\fP, \fB\-P\fP, \fB\-S\fP and \fB\-T\fP 
149 command line options can be used to restrict the state entries that will be 
150 shown and to specify the frequency of display updates.
151 .PP
152 In state top mode, the following keys can be used to influence the displayed
153 information:
154 .TP
155 \fBb\fP show packets/bytes from backward direction.
156 .TP
157 \fBf\fP show packets/bytes from forward direction. (default)
158 .TP
159 \fBl\fP redraw the screen.
160 .TP
161 \fBq\fP quit the program. 
162 .TP
163 \fBs\fP switch between different sorting criterion.
164 .TP
165 \fBr\fP reverse the sorting criterion.
166 .PP
167 States can be sorted by protocol number, by number of IP packets, by number
168 of bytes and by time-to-live of the state entry. The default is to sort by
169 the number of bytes. States are sorted in descending order, but you can use
170 the \fBr\fP key to sort them in ascending order.
171 .SH STATE TOP LIMITATIONS
172 It is currently not possible to interactively change the source, destination
173 and protocol filters or the refresh frequency. This must be done from the
174 command line.
175 .PP
176 The screen must have at least 80 columns. This is however not checked.
177 When running state top in IPv6 mode, the screen must be much wider to display
178 the very long IPv6 addresses.
179 .PP
180 Only the first X-5 entries that match the sort and filter criteria are
181 displayed (where X is the number of rows on the display. The only way to see
182 more entries is to resize the screen.
183 .SH FILES
184 /dev/kmem
185 .br
186 /dev/ipl
187 .br
188 /dev/ipstate
189 .br
190 /kernel
191 .SH SEE ALSO
192 ipf(8)
193 .SH BUGS
194 none known.