$linuxjunkies
>

iftop(8)

Display bandwidth usage on an interface by socket connections in real-time.

UbuntuDebianFedoraArch

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

FlagWhat it does
-i interfaceListen on a specific network interface (e.g., eth0, wlan0)
-nDon't perform reverse hostname lookups; show IP addresses only
-NDon't convert port numbers to service names; show numeric ports
-pRun in promiscuous mode to see all traffic on the network segment
-PShow port numbers instead of service names
-bDisplay traffic bars using characters instead of a graphical interface
-BDisplay cumulative traffic totals instead of rates
-m limitSet the upper limit for the display in bytes (e.g., 1M for 1 megabyte)
-c configRead configuration options from a specified file
-tUse text UI mode (non-interactive, suitable for scripts)
-s secondsSort 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 eth0

Show bandwidth usage with numeric IP addresses and port numbers only (no DNS lookups)

sudo iftop -i eth0 -n -N

Display wireless interface traffic with port numbers instead of service names

sudo iftop -i wlan0 -P

Limit the display scale to 10 megabytes per second for easier reading on slower links

sudo iftop -i eth0 -m 10M

Run in promiscuous mode to capture and display all traffic passing through the network

sudo iftop -i eth0 -p

Show cumulative traffic totals rather than current rates for each connection

sudo iftop -i eth0 -B

Run in text mode and display the top 20 connections programmatically for scripting

sudo iftop -i eth0 -t -n | head -20

Start iftop with custom configuration options from a file

sudo iftop -i eth0 -c /etc/iftop.conf

Related commands