The iftop command listens to network traffic on a named network interface, or on the first interface, it can find which looks like an external interface if none is specified, and displays a table of current bandwidth usage by pairs of hosts. The iftop is a perfect tool for remote Linux server over an ssh based session.
iftop must be run by the root or the user who has sufficient permissions to monitor all network traffic on the network interface. See how to install iftop on CentOS/RHEL based server.
Type the command as per your Linux distro:
Install iftop on a Debian/Ubuntu Linux
Install iftop on a CentOS/Fedora/RHEL/Scientific/Oracle Linux
Install iftop on Arch Linux
Type the following pacman command:
$ sudo pacman -S iftop
Install iftop on Alpine Linux
Type the following apk command:
# apk add iftop
Install iftop on Suse/OpenSuse Linux
Type the following zypper command:
# zypper install iftop
A note about installing iftop on Unix-like system
You can install iftop on Unix-like system such as FreeBSD, OpenBSD, MacOS and others too. This page only deals with Linux operating system. For example on FreeBSD one can install iftop using the following pkg command:
# pkg install iftop
On macOS Unix one can install it using the brew command:
$ brew install iftop
The syntax is:
iftop -i interface
Type iftop command at the shell prompt to display traffic:
In this example, I am using eth0 interface:
# iftop -i eth0
However, iftop works best when you use filters. For example, if you want to find out how much bandwidth users are wasting or trying to figure out why the network is slow, run:
# iftop -f icmp
You can display or analyses packet flowing in and out of the 192.168.1.0/24 network:
# iftop -F 192.168.1.0/24
Disable output for DNS traffic by using filter code such as:
# iftop -f 'not port domain'
iftop has many options read man page for further information see its man page – iftop(8)
- Keeping a log of daily network traffic for ADSL or dedicated remote Linux box
- Linux and Unix nload App: Monitor Network Traffic and Bandwidth Usage In Real Time
- CentOS / RHEL: Install vnStat Network Traffic Monitor To Keep a Log Of Daily Traffic
- CentOS / RHEL: View Vnstat Graphs Using PHP Web Interface Frontend
- slurm – An easy to use network load monitor for Linux and Unix-like systems.
- nload project home page – Download source code.