CentOS/RHEL: How To Use iftop to display network interface bandwidth usage

How Do I monitory network interface bandwidth usage on my centos or rhel linux? How to display network bandwidth usage under centos or rhel operating system? this post will show you how to install and use iftop utility to display network interface bandwidth usage.

You need to install iftop pcakge firstly using yum command . to install iftop pcakge, you have to setup epel repository on your current centos or rhel system.

Download Epel Repo

Using the wget command to download epel package so that to install it.

wget http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm

outputs:

Resolving epel.mirror.net.in... 120.88.47.14, 2401:4800:2121:c0:ff:ee:ee:2

Connecting to epel.mirror.net.in|120.88.47.14|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 14540 (14K) [application/x-redhat-package-manager]

Saving to: “epel-release-6-8.noarch.rpm”

100%[==========================================================================================>] 14,540      54.6K/s   in 0.3s

2014-02-23 12:24:53 (54.6 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]

Install epel repo package 

Issue the following command:

rpm -ivh epel-release-6-8.noarch.rpm

outputs:

warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]

  1:epel-release           ########################################### [100%]

centos install iftop tool

Type the following command to install iftop tool:

yum install iftop

outputs:

[root@devops Desktop]# yum install iftop

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: mirrors.yun-idc.com

 * epel: mirrors.zju.edu.cn

 * extras: mirrors.skyshe.cn

 * updates: mirrors.zju.edu.cn

Resolving Dependencies

--> Running transaction check

---> Package iftop.x86_64 0:1.0-0.7.pre4.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================
 Package            Arch                Version                       Repository         Size
==============================================================================================
Installing:

 iftop              x86_64              1.0-0.7.pre4.el7              epel               51 k

Transaction Summary
==============================================================================================

Install  1 Package

Total download size: 51 k

Installed size: 93 k

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/7/epel/packages/iftop-1.0-0.7.pre4.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

Public key for iftop-1.0-0.7.pre4.el7.x86_64.rpm is not installed

iftop-1.0-0.7.pre4.el7.x86_64.rpm                                      |  51 kB  00:00:01     

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Importing GPG key 0x352C64E5:

 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"

 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

 Package    : epel-release-7-5.noarch (@extras)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : iftop-1.0-0.7.pre4.el7.x86_64                                              1/1 

  Verifying  : iftop-1.0-0.7.pre4.el7.x86_64                                              1/1 

Installed:

  iftop.x86_64 0:1.0-0.7.pre4.el7                                                             
Complete!

Using iftop tools to monitor network bandwidth for enp0s3 or eth0


Type the following command to display network bandwidth for eth0 interface on centos 7:

iftop -i eth0

Outputs:

[root@osetc~]# iftop -i eth0
interface: eth0
IP address is: 192.168.1.10
MAC address is: 00:00:01:8d:9c:8d

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
TX: cum: 187KB peak: 18.4Kb rates: 672b 1.27Kb 2.58Kb
RX: 28.7KB 40.2Kb 160b 298b 2.48Kb
TOTAL: 215KB 58.7Kb 832b 1.56Kb 5.06Kb

Recommended Reading:

You might also like:

Sidebar



back to top