4 .\" Manual page for iftop.
6 .\" $Id: iftop.8,v 1.27 2010/11/27 11:06:12 pdw Exp $
10 iftop - display bandwidth usage on an interface by host
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]
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.
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.
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.
37 Some other filter ideas:
39 \fBnot ether host ff:ff:ff:ff:ff:ff\fP
40 Ignore ethernet broadcast packets.
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.
46 How much bandwidth are users wasting trying to figure out why the network is
53 Print a summary of usage.
56 Don't do hostname lookups.
59 Do not resolve port number to service names
62 Run in promiscuous mode, so that traffic which does not pass directly through
63 the specified interface is also counted.
69 Display and count datagrams addressed to or from link-local IPv6 addresses.
70 The default is not to display that address category.
73 Don't display bar graphs of traffic.
76 Display bandwidth rates in bytes/sec rather than bits/sec.
78 \fB-i\fP \fIinterface\fP
79 Listen to packets on \fIinterface\fP.
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.
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.
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
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
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.
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
113 foo.example.com => bar.example.com 1Kb 500b 100b
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
128 By default, the pairs of hosts responsible for the most traffic (10 second
129 average) are displayed at the top of the list.
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.
135 .SH SOURCE / DEST AGGREGATION
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
144 \fBS\fP or \fBD\fP toggle the display of source and destination ports
145 respectively. \fBp\fP will toggle port display on/off.
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.
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.
160 .SH DISPLAY FILTERING
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.
168 .SH PAUSE DISPLAY / FREEZE ORDER
170 \fBP\fP will pause the current display.
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.
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).
183 \fBf\fP allows you to edit the filter code whilst iftop running. This
184 can lead to some unexpected behaviour.
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.
193 The config file consists of one configuration directive per line. Each
194 directive is a name value pair, for example:
201 sets the network interface. The following config directives are supported:
204 \fBinterface:\fP \fIif\fP
205 Sets the network interface to \fIif\fP.
207 \fBdns-resolution:\fP \fI(yes|no)\fP
208 Controls reverse lookup of IP addresses.
210 \fBport-resolution:\fP \fI(yes|no)\fP
211 Controls conversion of port numbers to service names.
213 \fBfilter-code:\fP \fIbpf\fP
214 Sets the filter code to \fIbpf\fP.
216 \fBshow-bars:\fP \fI(yes|no)\fP
217 Controls display of bar graphs.
219 \fBpromiscuous:\fP \fI(yes|no)\fP
220 Puts the interface into promiscuous mode.
222 \fBport-display:\fP \fI(off|source-only|destination-only|on)\fP
223 Controls display of port numbers.
225 \fBlink-local:\fP \fI(yes|no)\fP
226 Determines displaying of link-local IPv6 addresses.
228 \fBhide-source:\fP \fI(yes|no)\fP
229 Hides source host names.
231 \fBhide-destination:\fP \fI(yes|no)\fP
232 Hides destination host names.
234 \fBuse-bytes:\fP \fI(yes|no)\fP
235 Use bytes for bandwidth display, rather than bits.
237 \fBsort:\fP \fI(2s|10s|40s|source|destination)\fP
238 Sets which column is used to sort the display.
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.
243 \fBshow-totals:\fP \fI(yes|no)\fP
244 Shows cumulative total for each item.
246 \fBlog-scale:\fP \fI(yes|no)\fP
247 Use a logarithmic scale for bar graphs.
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.
252 \fBnet-filter:\fP \fInet/mask\fP
253 Defines an IP network boundary for determining packet direction.
255 \fBnet-filter6:\fP \fInet6/mask6\fP
256 Defines an IPv6 network boundary for determining packet direction.
258 \fBscreen-filter:\fP \fIregexp\fP
259 Sets a regular expression to filter screen output.
261 .SH QUIRKS (aka they're features, not bugs)
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.
267 \fBTotals don't add up\fP
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.
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.
283 \fBPeak totals don't add up\fP
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.
289 \fBChanging the filter code doesn't seem to work\fP
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.
302 Configuration file for iftop.
310 Paul Warren <pdw@ex-parrot.com>
313 $Id: iftop.8,v 1.27 2010/11/27 11:06:12 pdw Exp $
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.
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.
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.