iftop – Real Time Linux Network Usage Bandwidth Monitoring Tool Print

  • 12

In this article we have another excellent program called Interface TOP (IFTOP) is a real time console-based network usage bandwidth monitoring tool.

It will show a quick overview of network activities on an interface. iftop shows a real time updated list of network usage bandwidth every 2, 10 and 40 seconds on average. In this post we are going to see the installation and how to use IFTOP via command-line in Linux.


*** Install libpcap and libncurses ***


First start by installing libpcap and libncurses libraries using your Linux distribution package manager as shown.

$ sudo apt install libpcap0.8 libpcap0.8-dev libncurses5 libncurses5-dev  [On Debian/Ubuntu]
# yum  -y install libpcap libpcap-devel ncurses ncurses-devel             [On CentOS/RHEL]
# dnf  -y install libpcap libpcap-devel ncurses ncurses-devel             [On Fedora 22+]


*** 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.

$ sudo 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


On Fedora distribution, iftop is also available from the default system repositories to install using the following command.

# dnf 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


*** Basic usage of Iftop ***

Once installation 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.

$ sudo iftop

 

*** Monitor Linux Network Interface ***

First run the following ifconfig command or ip command to find all attached network interfaces on your Linux system.

$ sudo ifconfig
OR
$ sudo ip addr show


T
hen use the -i flag to specify the interface you want to monitor. For example the command below used to monitor bandwidth on the wireless interface on the test computer.

$ sudo iftop -i eth01


To disable hostname lookups, use the -n flag.

$ sudo iftop -n  eth01


To turn on port display, use the -P switch.

$ sudo iftop -P eth01

 

*** Iftop Options and Usage ***

While running iftop you can use the keys like S, D to see more information like source, destination. Please do run man iftop if you want to more options and details. Press q to quit from running windows.

 


Was this answer helpful?

« Back

Powered by WHMCompleteSolution