iftop(8)
Display bandwidth usage on an interface by socket connections in real-time.
Synopsis
iftop [OPTION]... [-i INTERFACE]Description
iftop listens to network traffic on a named interface and displays a table of current IP traffic flows sorted by bandwidth usage. It shows source and destination IP addresses, ports, protocol, and data rates (sent, received, and peak) for each connection.
iftop captures packets at the data link layer using libpcap, so it works with any interface type including wireless. The display updates in real-time and requires root or appropriate capabilities to run.
Common options
| Flag | What it does |
|---|---|
-i interface | Listen on a specific network interface (e.g., eth0, wlan0) |
-n | Don't perform reverse hostname lookups; show IP addresses only |
-N | Don't convert port numbers to service names; show numeric ports |
-p | Run in promiscuous mode to see all traffic on the network segment |
-P | Show port numbers instead of service names |
-b | Display traffic bars using characters instead of a graphical interface |
-B | Display cumulative traffic totals instead of rates |
-m limit | Set the upper limit for the display in bytes (e.g., 1M for 1 megabyte) |
-c config | Read configuration options from a specified file |
-t | Use text UI mode (non-interactive, suitable for scripts) |
-s seconds | Sort by the specified column (2=source, 3=dest, 4=bytes, 5=packets) |
Examples
Monitor bandwidth on eth0 interface with hostname lookups and service names resolved
sudo iftop -i eth0Show bandwidth usage with numeric IP addresses and port numbers only (no DNS lookups)
sudo iftop -i eth0 -n -NDisplay wireless interface traffic with port numbers instead of service names
sudo iftop -i wlan0 -PLimit the display scale to 10 megabytes per second for easier reading on slower links
sudo iftop -i eth0 -m 10MRun in promiscuous mode to capture and display all traffic passing through the network
sudo iftop -i eth0 -pShow cumulative traffic totals rather than current rates for each connection
sudo iftop -i eth0 -BRun in text mode and display the top 20 connections programmatically for scripting
sudo iftop -i eth0 -t -n | head -20Start iftop with custom configuration options from a file
sudo iftop -i eth0 -c /etc/iftop.conf