iftop – A Real Time Linux Network Bandwidth Monitoring Tool
Download and install iftop
Iftop is available in the official software repositories of Debian/Ubuntu Linux, you can install it using apt command as shown.
$ apt install iftop
On RHEL/CentOS, you need to enable the EPEL repository, and then install it as follows.
# yum install epel-release # yum install iftop
Other Linux distributions, can download iftop source package using wget command and compile it from source as shown.
# wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz # tar -zxvf iftop-0.17.tar.gz # cd iftop-0.17 # ./configure # make # make install
Run iftop
Once installation is done, go to your console and run the iftop command without any arguments to view bandwidth usage of default interface, as shown in the screen shot below.
Without additional parameters, iftop will monitor all the inbound and outbound traffic on the default network interface. eg: eth0.
To monitor a different network interface, e.g: eth0 , you would need to pass the interface name to the iftop command using the -i parameter:
# iftop -i eth0
To disable hostname lookups, use the -n
flag.
# iftop -n eth0
To turn on port display, use the -P
switch.
# sudo iftop -P eth0
This concludes our tutorial. For more information on how to use iftop
, please refer to iftop’s website.