]> gitweb.fperrin.net Git - iftop.git/blob - iftop.8
Import de iftop-1.0pre1
[iftop.git] / iftop.8
1 .TH IFTOP 8
2 .\"
3 .\" iftop.8:
4 .\" Manual page for iftop.
5 .\"
6 .\" $Id: iftop.8,v 1.27 2010/11/27 11:06:12 pdw Exp $
7 .\"
8
9 .SH NAME
10 iftop - display bandwidth usage on an interface by host
11
12 .SH SYNOPSIS
13 \fBiftop\fP \fB-h\fP |
14 [\fB-nNpblBP\fP] [\fB-i\fP \fIinterface\fP] [\fB-f\fP \fIfilter code\fP] [\fB-F\fP \fInet\fP/\fImask\fP]
15 [\fB-G\fP \fInet6\fP/\fImask6\fP]
16 .SH DESCRIPTION
17 \fBiftop\fP listens to network traffic on a named \fIinterface\fP, or on the
18 first interface it can find which looks like an external interface if none is
19 specified, and displays a table of current bandwidth usage by pairs of hosts.
20 \fBiftop\fP must be run with sufficient permissions to monitor all network
21 traffic on the \fIinterface\fP; see \fBpcap\fP(3) for more information, but on
22 most systems this means that it must be run as root.
23
24 By default, \fBiftop\fP will look up the hostnames associated with addresses it
25 finds in packets. This can cause substantial traffic of itself, and may result
26 in a confusing display. You may wish to suppress display of DNS traffic by
27 using filter code such as \fBnot port domain\fP, or switch it off entirely,
28 by using the \fB-n\fP option or by pressing \fBr\fP when the program is running.
29
30 By default, \fBiftop\fP counts all IP packets that pass through the filter, and
31 the direction of the packet is determined according to the direction the packet
32 is moving across the interface.  Using the \fB-F\fP option it is possible to
33 get \fBiftop\fP to show packets entering and leaving a given network.  For
34 example, \fBiftop -F 10.0.0.0/255.0.0.0\fP will analyse packets flowing in and
35 out of the 10.* network.
36
37 Some other filter ideas:
38 .TP
39 \fBnot ether host ff:ff:ff:ff:ff:ff\fP
40 Ignore ethernet broadcast packets.
41 .TP
42 \fBport http and not host \fP\fIwebcache.example.com\fP
43 Count web traffic only, unless it is being directed through a local web cache.
44 .TP
45 \fBicmp\fP
46 How much bandwidth are users wasting trying to figure out why the network is
47 slow?
48
49 .SH OPTIONS
50
51 .TP
52 \fB-h\fP
53 Print a summary of usage.
54 .TP
55 \fB-n\fP
56 Don't do hostname lookups. 
57 .TP
58 \fB-N\fP
59 Do not resolve port number to service names
60 .TP
61 \fB-p\fP
62 Run in promiscuous mode, so that traffic which does not pass directly through
63 the specified interface is also counted.
64 .TP
65 \fB-P\fP
66 Turn on port display.
67 .TP
68 \fB-l\fP
69 Display and count datagrams addressed to or from link-local IPv6 addresses.
70 The default is not to display that address category.
71 .TP
72 \fB-b\fP
73 Don't display bar graphs of traffic. 
74 .TP
75 \fB-B\fP
76 Display bandwidth rates in bytes/sec rather than bits/sec.
77 .TP
78 \fB-i\fP \fIinterface\fP
79 Listen to packets on \fIinterface\fP.
80 .TP
81 \fB-f\fP \fIfilter code\fP
82 Use \fIfilter code\fP to select the packets to count. Only IP packets are ever
83 counted, so the specified code is evaluated as \fB(\fP\fIfilter code\fP\fB) and ip\fP.
84 .TP
85 \fB-F\fP \fInet\fP/\fImask\fP
86 Specifies an IPv4 network for traffic analysis.  If specified, iftop will only
87 include packets flowing in to or out of the given network, and packet direction
88 is determined relative to the network boundary, rather than to the interface.
89 You may specify \fImask\fP as a dotted quad, such as /255.255.255.0, or as a
90 single number specifying the number of bits set in the netmask, such as /24.
91 .TP
92 \fB-G\fP \fInet6\fP/\fImask6\fP
93 Specifies an IPv6 network for traffic analysis. The value of \fImask6\fP can be
94 given as a prefix length or as a numerical address string for more compound
95 bitmasking.
96 .TP
97 \fB-c\fP \fIconfig file\fP
98 Specifies an alternate config file.  If not specified, iftop will use
99 \fB~/.iftoprc\fP if it exists.  See below for a description of config files
100
101 .SH DISPLAY
102
103 When running, \fBiftop\fP uses the whole screen to display network usage. At
104 the top of the display is a logarithmic scale for the bar graph which gives a
105 visual indication of traffic.
106
107 The main part of the display lists, for each pair of hosts, the rate at which
108 data has been sent and received over the preceding 2, 10 and 40 second
109 intervals. The direction of data flow is indicated by arrows, <= and =>. For
110 instance,
111 .nf
112
113 foo.example.com  =>  bar.example.com      1Kb  500b   100b
114                  <=                       2Mb    2Mb    2Mb
115
116 .Sp
117 .fi
118 shows, on the first line, traffic from \fBfoo.example.com\fP to
119 \fBbar.example.com\fP; in the preceding 2 seconds, this averaged 1Kbit/s,
120 around half that amount over the preceding 10s, and a fifth of that over the
121 whole of the last 40s. During each of those intervals, the data sent in the
122 other direction was about 2Mbit/s. On the actual display, part of each line
123 is inverted to give a visual indication of the 10s average of traffic.
124 You might expect to see something like this where host \fBfoo\fP is making
125 repeated HTTP requests to \fBbar\fP, which is sending data back which saturates
126 a 2Mbit/s link.
127
128 By default, the pairs of hosts responsible for the most traffic (10 second
129 average) are displayed at the top of the list.
130
131 At the bottom of the display, various totals are shown, including peak traffic
132 over the last 40s, total traffic transferred (after filtering), and total
133 transfer rates averaged over 2s, 10s and 40s.
134
135 .SH SOURCE / DEST AGGREGATION
136
137 By pressing \fBs\fP or \fBd\fP while \fBiftop\fP is running, all traffic
138 for each source or destination will be aggregated together.  This is most
139 useful when \fBiftop\fP is run in promiscuous mode, or is run on a gateway
140 machine.
141
142 .SH PORT DISPLAY
143
144 \fBS\fP or \fBD\fP toggle the display of source and destination ports
145 respectively. \fBp\fP will toggle port display on/off.
146
147 .SH DISPLAY TYPE
148
149 \fBt\fP cycles through the four line display modes; the default 2-line display,
150 with sent and received traffic on separate lines, and 3 1-line displays, with
151 sent, received, or total traffic shown.
152
153 .SH DISPLAY ORDER
154
155 By default, the display is ordered according to the 10s average (2nd column).
156 By pressing \fB1\fP, \fB2\fP or \fB3\fP it is possible to sort by the 1st, 2nd
157 or 3rd column.   By pressing \fB<\fP or \fB>\fP the display will be sorted by
158 source or destination hostname respectively.
159
160 .SH DISPLAY FILTERING
161
162 \fBl\fP allows you to enter a POSIX extended regular expression that will be
163 used to filter hostnames shown in the display.  This is a good way to quickly
164 limit what is shown on the display.  Note that this happens at a much later
165 stage than filter code, and does not affect what is actually captured.  Display
166 filters DO NOT affect the totals at the bottom of the screen.
167
168 .SH PAUSE DISPLAY / FREEZE ORDER
169
170 \fBP\fP will pause the current display.
171
172 \fBo\fP will freeze the current screen order.  This has the side effect that
173 traffic between hosts not shown on the screen at the time will not be shown at
174 all, although it will be included in the totals at the bottom of the screen.
175
176 .SH SCROLL DISPLAY
177
178 \fBj\fP and \fBk\fP will scroll the display of hosts.  This feature is most
179 useful when the display order is frozen (see above).
180
181 .SH FILTER CODE
182
183 \fBf\fP allows you to edit the filter code whilst iftop running.  This
184 can lead to some unexpected behaviour.
185
186 .SH CONFIG FILE
187
188 iftop can read its configuration from a config file.  If the \fB-c\fP option is
189 not specified, iftop will attempt to read its configuration from
190 \fB~/.iftoprc\fP, if it exists.  Any command line options specified will
191 override settings in the config file.
192
193 The config file consists of one configuration directive per line.  Each
194 directive is a name value pair, for example:
195 .nf
196
197 interface: eth0
198
199 .Sp
200 .fi
201 sets the network interface.  The following config directives are supported:
202
203 .TP
204 \fBinterface:\fP \fIif\fP
205 Sets the network interface to \fIif\fP.
206 .TP
207 \fBdns-resolution:\fP \fI(yes|no)\fP
208 Controls reverse lookup of IP addresses.
209 .TP
210 \fBport-resolution:\fP \fI(yes|no)\fP
211 Controls conversion of port numbers to service names.
212 .TP
213 \fBfilter-code:\fP \fIbpf\fP
214 Sets the filter code to \fIbpf\fP.
215 .TP
216 \fBshow-bars:\fP \fI(yes|no)\fP
217 Controls display of bar graphs.
218 .TP
219 \fBpromiscuous:\fP \fI(yes|no)\fP
220 Puts the interface into promiscuous mode.
221 .TP
222 \fBport-display:\fP \fI(off|source-only|destination-only|on)\fP
223 Controls display of port numbers.
224 .TP
225 \fBlink-local:\fP \fI(yes|no)\fP
226 Determines displaying of link-local IPv6 addresses.
227 .TP
228 \fBhide-source:\fP \fI(yes|no)\fP
229 Hides source host names.
230 .TP
231 \fBhide-destination:\fP \fI(yes|no)\fP
232 Hides destination host names.
233 .TP
234 \fBuse-bytes:\fP \fI(yes|no)\fP
235 Use bytes for bandwidth display, rather than bits.
236 .TP
237 \fBsort:\fP \fI(2s|10s|40s|source|destination)\fP
238 Sets which column is used to sort the display.
239 .TP
240 \fBline-display:\fP \fI(two-line|one-line-both|one-line-sent|one-line-received)\fP
241 Controls the appearance of each item in the display.
242 .TP
243 \fBshow-totals:\fP \fI(yes|no)\fP
244 Shows cumulative total for each item.
245 .TP
246 \fBlog-scale:\fP \fI(yes|no)\fP
247 Use a logarithmic scale for bar graphs.
248 .TP
249 \fBmax-bandwidth:\fP \fIbw\fP
250 Fixes the maximum for the bar graph scale to \fIbw\fP, e.g. "10M". Note that the value has to always be in bits, regardless if the option to display in bytes has been chosen.
251 .TP
252 \fBnet-filter:\fP \fInet/mask\fP
253 Defines an IP network boundary for determining packet direction.
254 .TP
255 \fBnet-filter6:\fP \fInet6/mask6\fP
256 Defines an IPv6 network boundary for determining packet direction.
257 .TP
258 \fBscreen-filter:\fP \fIregexp\fP
259 Sets a regular expression to filter screen output.
260
261 .SH QUIRKS (aka they're features, not bugs)
262
263 There are some circumstances in which iftop may not do what you expect.  In
264 most cases what it is doing is logical, and we believe it is correct behaviour,
265 although I'm happy to hear reasoned arguments for alternative behaviour.
266
267 \fBTotals don't add up\fP
268
269 There are several reasons why the totals may not appear to add up.  The
270 most obvious is having a screen filter in effect, or screen ordering
271 frozen.  In this case some captured information is not being shown to
272 you, but is included in the totals.
273
274 A more subtle explanation comes about when running in promiscuous mode
275 without specifying a \fB-F\fP option.  In this case there is no easy way
276 to assign the direction of traffic between two third parties.  For the purposes
277 of the main display this is done in an arbitrary fashion (by ordering of IP
278 addresses), but for the sake of totals all traffic between other hosts is
279 accounted as incoming, because that's what it is from the point of view of your
280 interface.  The \fB-F\fP option allows you to specify an arbitrary network
281 boundary, and to show traffic flowing across it.
282
283 \fBPeak totals don't add up\fP
284
285 Again, this is a feature.  The peak sent and peak received didn't necessarily
286 happen at the same time.  The peak total is the maximum of sent plus received
287 in each captured time division.
288
289 \fBChanging the filter code doesn't seem to work\fP
290
291 Give it time.  Changing the filter code affects what is captured from
292 the time that you entered it, but most of what is on the display is
293 based on some fraction of the last 40s window of capturing.  After
294 changing the filter there may be entries on the display that are
295 disallowed by the current filter for up to 40s.  DISPLAY FILTERING has
296 immediate effect and does not affect what is captured.
297
298 .SH FILES
299
300 .TP
301 \fB~/.iftoprc\fP
302 Configuration file for iftop.
303
304 .SH SEE ALSO
305 .BR tcpdump (8),
306 .BR pcap (3),
307 .BR driftnet (1).
308
309 .SH AUTHOR
310 Paul Warren <pdw@ex-parrot.com>
311
312 .SH VERSION
313 $Id: iftop.8,v 1.27 2010/11/27 11:06:12 pdw Exp $
314
315 .SH COPYING
316 This program is free software; you can redistribute it and/or modify
317 it under the terms of the GNU General Public License as published by
318 the Free Software Foundation; either version 2 of the License, or
319 (at your option) any later version.
320
321 This program is distributed in the hope that it will be useful,
322 but WITHOUT ANY WARRANTY; without even the implied warranty of
323 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
324 GNU General Public License for more details.
325
326 You should have received a copy of the GNU General Public License
327 along with this program; if not, write to the Free Software
328 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
329