IFTOP(8)
๐
IFTOP(8) โ the iftop glow-up ๐
okay bestie, grab your iced coffee, because this is the iftop(8) manual page from the System Manager's Manual and we're about to make bandwidth monitoring actually make sense. no cap.
โจ NAME โจ
iftop โ shows you who's eating all your bandwidth, host by host. it's giving network detective energy ๐
๐ฆ SYNOPSIS ๐ฆ
iftop -h | [-nNpblBP] [-i interface] [-f filter code] [-F net/mask] [-G
net6/mask6]
๐ธ DESCRIPTION ๐ธ
so iftop literally just sits there and listens to the network traffic on a named interface. and if you don't name one? it'll go find the first interface that looks like an external interface and vibe with that instead. then it shows you a whole little table of current bandwidth usage by pairs of hosts. iconic.
important though: iftop needs sufficient permissions to monitor all the network traffic on that interface. check pcap(3) for the full tea, but on most systems that means you gotta run it as root. sorry babe ๐
by default, iftop looks up the hostnames associated with the addresses it finds in packets. and like... that's cute in theory but it can cause substantial traffic of itself, which can result in a genuinely confusing display. so you might wanna suppress the DNS traffic using filter code like not port domain, or switch the lookups off entirely with the -n option, or by pressing r while the program is running. your call, bestie โจ
by default, iftop counts all IP packets that pass through the filter, and the direction of the packet is determined by the direction the packet is moving across the interface. but with the -F option you can get iftop to show packets entering and leaving a given network. for example, iftop -F 10.0.0.0/255.0.0.0 will analyse packets flowing in and out of the 10.* network. slay ๐ฅ
some other filter ideas, because I know you're gonna ask:
not ether host ff:ff:ff:ff:ff:ffโ ignore ethernet broadcast packets. bye felicia ๐port http and not host webcache.example.comโ count web traffic only, unless it's being directed through a local web cache. very "don't count the middleman" of it.icmpโ how much bandwidth are users wasting trying to figure out why the network is slow? ๐ญ this one is a read.
๐ OPTIONS ๐
-hโ print a summary of usage. the classic "help me" button ๐ซถ-nโ don't do hostname lookups. we stay on IPs, no DNS drama.-Nโ do not resolve port numbers to service names.-pโ run in promiscuous mode, so traffic that doesn't pass directly through the specified interface is also counted. nosy in the best way ๐-Pโ turn on port display.-lโ display and count datagrams addressed to or from link-local IPv6 addresses. the default is not to display that address category, jsyk.-bโ don't display bar graphs of traffic. minimalism era.-m limitโ set the upper limit for the bandwidth scale. specify it as a number with a'K','M'or'G'suffix.-Bโ display bandwidth rates in bytes/sec rather than bits/sec. choose your fighter.-i interfaceโ listen to packets on interface.-f filter codeโ use filter code to select the packets to count. only IP packets are ever counted, so the specified code is evaluated as(filter code) and ip. lowkey important detail, don't forget it.-F net/maskโ specifies an IPv4 network for traffic analysis. if specified,iftopwill only include packets flowing in to or out of the given network, and packet direction is determined relative to the network boundary, rather than to the interface. you may specify mask as a dotted quad, such as/255.255.255.0, or as a single number specifying the number of bits set in the netmask, such as/24. both valid, pick your fave ๐-G net6/mask6โ specifies an IPv6 network for traffic analysis. the value of mask6 can be given as a prefix length or as a numerical address string for more compound bitmasking. highkey fancy.-c config fileโ specifies an alternate config file. if not specified,iftopwill use~/.iftoprcif it exists. see below for a description of config files ๐-t text output modeโ use text interface without ncurses and print the output toSTDOUT. for the script girlies ๐ง
๐ DISPLAY ๐
when running, iftop uses the whole screen to display network usage. main character energy, honestly. at the top of the display is a logarithmic scale for the bar graph, which gives you a visual indication of traffic.
the main part of the display lists, for each pair of hosts, the rate at which data has been sent and received over the preceding 2, 10 and 40 second intervals. the direction of data flow is indicated by arrows, <= and =>. for instance:
foo.example.com => bar.example.com 1Kb 500b 100b
<= 2Mb 2Mb 2Mb
so this shows, on the first line, traffic from foo.example.com to bar.example.com; in the preceding 2 seconds this averaged 1Kbit/s, around half that amount over the preceding 10s, and a fifth of that over the whole of the last 40s. during each of those intervals, the data sent in the other direction was about 2Mbit/s. and on the actual display, part of each line is inverted to give a visual indication of the 10s average of traffic. you might expect to see something like this where host foo is making repeated HTTP requests to bar, which is sending data back that saturates a 2Mbit/s link. the whole story, right there ๐ญ๐ฅ
by default, the pairs of hosts responsible for the most traffic (10 second average) are displayed at the top of the list. top of the leaderboard = biggest bandwidth consumer.
at the bottom of the display, various totals are shown, including peak traffic over the last 40s, total traffic transferred (after filtering), and total transfer rates averaged over 2s, 10s and 40s. the receipts, basically ๐งพ
๐ SOURCE / DEST AGGREGATION ๐
by pressing s or d while iftop is running, all traffic for each source or destination will be aggregated together. this is most useful when iftop is run in promiscuous mode, or is run on a gateway machine. group-chat energy: everyone's messages in one thread ๐ซถ
๐ PORT DISPLAY ๐
S or D toggle the display of source and destination ports respectively. and p will toggle port display on/off. three ways to do the same vibe check.
โญ DISPLAY TYPE โญ
t cycles through the four line display modes; the default 2-line display, with sent and received traffic on separate lines, and 3 1-line displays, with sent, received, or total traffic shown. cycle through until it hits different โจ
๐ฆ DISPLAY ORDER ๐ฆ
by default, the display is ordered according to the 10s average (2nd column). by pressing 1, 2 or 3 it's possible to sort by the 1st, 2nd or 3rd column. and by pressing < or > the display will be sorted by source or destination hostname respectively. sort your life out, literally ๐
๐ DISPLAY FILTERING ๐
l allows you to enter a POSIX extended regular expression that will be used to filter hostnames shown in the display. this is a good way to quickly limit what's shown on the display. but note โ this happens at a much later stage than filter code, and does not affect what is actually captured. also: display filters DO NOT affect the totals at the bottom of the screen. read that again, bestie, it matters. ๐
๐ PAUSE DISPLAY / FREEZE ORDER ๐
P will pause the current display. everything just stops. vibe freeze.
o will freeze the current screen order. this has the side effect that traffic between hosts not shown on the screen at the time will not be shown at all โ although it will be included in the totals at the bottom of the screen. so it's still counted, just invisible. no cap, that's the whole caveat.
๐ SCROLL DISPLAY ๐
j and k will scroll the display of hosts. this feature is most useful when the display order is frozen (see above). scroll responsibly.
๐ง FILTER CODE ๐ง
f allows you to edit the filter code whilst iftop is running. this can lead to some unexpected behaviour. that's it. that's the warning. proceed with whimsy and slight caution ๐ญ
๐ธ CONFIG FILE ๐ธ
iftop can read its configuration from a config file. if the -c option is not specified, iftop will attempt to read its configuration from ~/.iftoprc, if it exists. any command line options specified will override settings in the config file. command line stays winning ๐
the config file consists of one configuration directive per line. each directive is a name value pair, for example:
interface: eth0
sets the network interface. the following config directives are supported:
interface: ifโ sets the network interface to if.dns-resolution: (yes|no)โ controls reverse lookup of IP addresses.port-resolution: (yes|no)โ controls conversion of port numbers to service names.filter-code: bpfโ sets the filter code to bpf.show-bars: (yes|no)โ controls display of bar graphs.promiscuous: (yes|no)โ puts the interface into promiscuous mode.port-display: (off|source-only|destination-only|on)โ controls display of port numbers.link-local: (yes|no)โ determines displaying of link-local IPv6 addresses.hide-source: (yes|no)โ hides source host names.hide-destination: (yes|no)โ hides destination host names.use-bytes: (yes|no)โ use bytes for bandwidth display, rather than bits.sort: (2s|10s|40s|source|destination)โ sets which column is used to sort the display.line-display: (two-line|one-line-both|one-line-sent|one-line-received)โ controls the appearance of each item in the display.show-totals: (yes|no)โ shows cumulative total for each item.log-scale: (yes|no)โ use a logarithmic scale for bar graphs.max-bandwidth: bwโ fixes the maximum for the bar graph scale to bw, e.g."10M". note that the value has to always be in bits, regardless if the option to display in bytes has been chosen. do not mess this one up, ok? ๐ซถnet-filter: net/maskโ defines an IP network boundary for determining packet direction.net-filter6: net6/mask6โ defines an IPv6 network boundary for determining packet direction.screen-filter: regexpโ sets a regular expression to filter screen output.
๐ QUIRKS (aka they're features, not bugs)
Okay bestie, real talk: there are some circumstances where iftop might not do exactly what you expect. In most cases what it's doing is totally logical, and the author believes it's correct behaviour โ but he's happy to hear reasoned arguments for alternative behaviour. So like, bring receipts, not vibes. ๐ซถ
Totals don't add up
Not me gaslighting you, but there are several reasons why the totals may not appear to add up. The most obvious one? You've got a screen filter in effect, or your screen ordering is frozen. In that case some captured information just isn't being shown to you โ but bestie, it's still included in the totals. ๐
A more subtle explanation comes about when you're running in promiscuous mode without specifying a -F option. In this case there's no easy way to assign the direction of traffic between two third parties. For the purposes of the main display this is done in an arbitrary fashion (by ordering of IP addresses), but for the sake of totals, all traffic between other hosts is accounted as incoming โ because that's literally what it is from the point of view of your interface. The -F option lets you specify an arbitrary network boundary, and show traffic flowing across it. โจ
Peak totals don't add up
Again โ this is a feature, not a bug, and honestly it ate. ๐ The peak sent and peak received didn't necessarily happen at the same time. The peak total is the maximum of sent plus received in each captured time division.
Changing the filter code doesn't seem to work
Give it time, queen. โณ Changing the filter code affects what is captured from the time that you entered it, but most of what is on the display is based on some fraction of the last 40s window of capturing. After changing the filter there may be entries on the display that are disallowed by the current filter for up to 40s. DISPLAY FILTERING has immediate effect and does not affect what is captured.
๐๏ธ FILES
~/.iftoprcโ configuration file foriftop.
๐ SEE ALSO
tcpdump(8), pcap(3), driftnet(1).
๐ AUTHOR
Paul Warren <pdw@ex-parrot.com>
โญ VERSION
$Id: iftop.8,v 1.31 2014/01/05 17:22:39 pdw Exp $
๐ COPYING
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILTY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
And that's the whole page, bestie โ no cap, you made it to the end. ๐ฆ This one's the IFTOP(8) manual, sourced from version 1.31 dated 2014/01/05, and honestly it understood the assignment. Go watch your bandwidth, you icon. ๐โจ
๐ฆ where this page comes from
- alpine 3.23: iftop-doc 1.0_pre4-r0 ยท GPL-2.0-or-later
- alpine 3.24: iftop-doc 1.0_pre4-r0 ยท GPL-2.0-or-later
- arch rolling: iftop 1.0pre4-6 ยท GPL
- debian bookworm: iftop 1.0~pre4-9 ยท GPL-2.0-or-later
- debian trixie: iftop 1.0~pre4-9+b1 ยท GPL-2.0-or-later
- nixos 26.05: iftop 1.0pre4
- nixpkgs unstable: iftop 1.0pre4
- opensuse-leap 16.0: iftop 0.99.4-bp160.1.13 ยท GPL-2.0-or-later
- opensuse-leap 16.0: iftop 0.99.4-bp160.1.13 ยท GPL-2.0-or-later
- opensuse-leap 16.0: iftop 0.99.4-bp160.1.13 ยท GPL-2.0-or-later
- opensuse-leap 16.0: iftop 0.99.4-bp160.1.13 ยท GPL-2.0-or-later
- ubuntu jammy: iftop 1.0~pre4-7 ยท GPL-2.0-or-later
- ubuntu noble: iftop 1.0~pre4-9build2 ยท GPL-2.0-or-later
- ubuntu questing: iftop 1.0~pre4-9.1
- ubuntu resolute: iftop 1.0~pre4-10 ยท GPL-2.0-or-later
- ubuntu stonking: iftop 1.0~pre4-10 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms