]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/ipfilter/man/ipfstat.8
MFC 361721:
[FreeBSD/stable/10.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".
73 .TP
74 .B \-i
75 Display the filter list used for the input side of the kernel IP processing.
76 .TP
77 .B \-I
78 Swap between retrieving "inactive"/"active" filter list details.  For use
79 in combination with \fB\-i\fP.
80 .TP
81 .B \-n
82 Show the "rule number" for each rule as it is printed.
83 .TP
84 .B \-o
85 Display the filter list used for the output side of the kernel IP processing.
86 .TP
87 .BR \-P \0<protocol>
88 This option is only valid in combination with \fB\-t\fP. Limit the state top
89 display to show only state entries that match a specific protocol. The
90 argument can be a protocol name (as defined in \fB/etc/protocols\fP) or a
91 protocol number. If this option is not specified, state entries for any
92 protocol are specified.
93 .TP
94 .BR \-R
95 Don't try to resolve addresses to hostnames and ports to services while
96 printing statistics.
97 .TP
98 .B \-s
99 Show packet/flow state information (statistics only).
100 .TP
101 .B \-sl
102 Show held state information (in the kernel) if any is present (no statistics).
103 .TP
104 .BR \-S \0<addrport>
105 This option is only valid in combination with \fB\-t\fP. Limit the state top
106 display to show only state entries whose source IP address and port match
107 the addrport argument. The addrport specification is of the form
108 ipaddress[,port].  The ipaddress and port should be either numerical or the
109 string "any" (specifying any IP address resp. any port). If the \fB\-S\fP
110 option is not specified, it defaults to "\fB\-S\fP any,any".
111 .TP
112 .B \-t
113 Show the state table in a way similar to the way \fBtop(1)\fP shows the process
114 table. States can be sorted using a number of different ways. This option
115 requires \fBcurses(3)\fP and needs to be compiled in. It may not be available on
116 all operating systems. See below, for more information on the keys that can
117 be used while ipfstat is in top mode.
118 .TP
119 .BR \-T \0<refreshtime>
120 This option is only valid in combination with \fB\-t\fP. Specifies how often
121 the state top display should be updated. The refresh time is the number of
122 seconds between an update. Any positive integer can be used. The default (and
123 minimal update time) is 1.
124 .TP
125 .B \-v
126 Turn verbose mode on.  Displays more debugging information.  When used with
127 either \fB-i\fP or \fB-o\fP, counters associated with the rule, such as the
128 number of times it has been matched and the number of bytes from such packets
129 is displayed.  For "keep state" rules, a count of the number of state sessions
130 active against the rule is also displayed.
131 .SH SYNOPSIS
132 The role of \fBipfstat\fP is to display current kernel statistics gathered
133 as a result of applying the filters in place (if any) to packets going in and
134 out of the kernel.  This is the default operation when no command line
135 parameters are present.
136 .PP
137 When supplied with either \fB\-i\fP or \fB\-o\fP, it will retrieve and display
138 the appropriate list of filter rules currently installed and in use by the
139 kernel.
140 .PP
141 One of the statistics that \fBipfstat\fP shows is \fBticks\fP.
142 This number indicates how long the filter has been enabled.
143 The number is incremented every half\-second.
144 .SH STATE TOP
145 Using the \fB\-t\fP option \fBipfstat\fP will enter the state top mode. In
146 this mode the state table is displayed similar to the way \fBtop\fP displays
147 the process table. The \fB\-C\fP, \fB\-D\fP, \fB\-P\fP, \fB\-S\fP and \fB\-T\fP
148 command line options can be used to restrict the state entries that will be
149 shown and to specify the frequency of display updates.
150 .PP
151 In state top mode, the following keys can be used to influence the displayed
152 information:
153 .TP
154 \fBb\fP show packets/bytes from backward direction.
155 .TP
156 \fBf\fP show packets/bytes from forward direction. (default)
157 .TP
158 \fBl\fP redraw the screen.
159 .TP
160 \fBq\fP quit the program.
161 .TP
162 \fBs\fP switch between different sorting criterion.
163 .TP
164 \fBr\fP reverse the sorting criterion.
165 .PP
166 States can be sorted by protocol number, by number of IP packets, by number
167 of bytes and by time-to-live of the state entry. The default is to sort by
168 the number of bytes. States are sorted in descending order, but you can use
169 the \fBr\fP key to sort them in ascending order.
170 .SH STATE TOP LIMITATIONS
171 It is currently not possible to interactively change the source, destination
172 and protocol filters or the refresh frequency. This must be done from the
173 command line.
174 .PP
175 The screen must have at least 80 columns. This is however not checked.
176 When running state top in IPv6 mode, the screen must be much wider to display
177 the very long IPv6 addresses.
178 .PP
179 Only the first X-5 entries that match the sort and filter criteria are
180 displayed (where X is the number of rows on the display. The only way to see
181 more entries is to resize the screen.
182 .SH FILES
183 /dev/kmem
184 .br
185 /dev/ipl
186 .br
187 /dev/ipstate
188 .br
189 /kernel
190 .SH SEE ALSO
191 ipf(8)
192 .SH BUGS
193 none known.