Iftop (commonly styled iftop) is a free and open-source command-line system monitor that displays real-time network bandwidth usage on a computer's network interface. It lists traffic broken down by pairs of hosts, in a manner analogous to the way the top utility reports processor usage. It is primarily used by system and network administrators to identify which connections or hosts are consuming available bandwidth.
Overview
Iftop functions as a passive monitoring tool. It listens to network traffic on a specified interface—or, if none is specified, on the first interface that appears to be externally facing—and prints a continuously updating table of current bandwidth usage between pairs of hosts. It relies on the libpcap packet-capture library and on curses (libcurses) for its terminal interface.
Because capturing all traffic on an interface generally requires elevated privileges, iftop typically must be run with root permissions. By default it performs reverse DNS lookups to display hostnames, a behaviour that can generate additional network traffic of its own; this can be disabled with the -n option or by filtering out DNS traffic (for example with a filter such as not port domain).
Features
The program provides several monitoring and display capabilities:
- Per-host-pair bandwidth rates averaged over the preceding 2-, 10-, and 40-second intervals.
- A logarithmic bar-graph scale for visual comparison of traffic volumes.
- Directional indication of traffic flow using
=>and<=arrows. - Sorting by source, destination, or any of the three time-averaged columns.
- Aggregation of all traffic per source or destination host, useful in promiscuous mode or on gateway machines.
- Filtering by Berkeley Packet Filter (BPF) expressions, by IPv4 or IPv6 network boundary (
-Fand-G), and by a screen-level regular expression. - Toggleable display of ports, port-resolution, and byte-versus-bit rate units (
-B). - An optional configuration file,
~/.iftoprc, allowing persistent settings such as the default interface, DNS resolution, sort order, and display style.
History and licensing
Iftop was developed by Paul Warren, with the project later credited alongside Chris Lightfoot on its website. According to its documentation and the associated Wikipedia article, it was first released on 2 March 2002 and is written in the C programming language. It is distributed under the GNU General Public License (version 2 or later) and runs on Unix-like operating systems.
The latest stable release is version 0.17; pre-release versions bearing the 1.0pre designation have also been made available. The source code is maintained in a Git repository. The utility has been packaged and adopted as a standard diagnostic tool in most Linux distributions and is widely used on network appliances and servers.
References
- iftop(8) manual page, Linux man pages (linux.die.net, manpages.ubuntu.com).
- Iftop project page, pdw.ex-parrot.com/iftop/.
- Iftop, Wikipedia.
- Rocky Linux and Fedora documentation for the
iftoppackage.