iftop is a command line tool that shows a list of active network connections between local host and any remote host, sorted by their bandwidth usage. The list of top-ranking network connections (in terms of bandwidth usage) is periodically refreshed in a ncurses-based user interface. Using iftop, you can visually check the bidirectional bandwidth usage of different network connections in real time. In order to install iftop on Linux, follow the instructions below.
To install iftop on Ubuntu, Mint or Debian, run:
To install iftop on CentOS or RHEL, first set up Repoforge repository on your system, and then run the following command.
To install iftop on Fedora, simply run:
If you would like to build and install the latest version of iftop manually, do the following.
$ wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
$ tar xvfvz iftop-0.17.tar.gz
$ cd iftop-0.17
$ sudo make install
Monitor Network Traffic in Real-Time with iftop
To monitor network traffic received on a specific network interface (e.g., eth0) with iftop, run the following command.
iftop supports rudimentary packet filtering rules with "-f" option. For example:
To monitor DNS traffic:
To monitor HTTP traffic:
To monitor HTTP traffic while excluding a specific host:
To monitor network traffic while ignoring broadcast packets.
To monitor ICMP traffic:
The screenshot of iftop looks as follows.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to back up a WordPress website to remote cloud storage from the Linux command line - November 24, 2015
- How to access Dropbox from the command line in Linux - November 22, 2015
- How to send email notifications using Gmail SMTP server on Linux - November 9, 2015