Monitor Network Traffic in CentOS
To monitor live traffic in CentOS, a utility like IFTOP would need to be installed. Follow the instructions below to do so.
1. Log into the remote server using SSH. Our demonstration is with the root account.
2. Make sure that the Repo is installed by executing this command.
If on CentOS 5.x, use this command:
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
If on CentOS 6.x, use this command:
# wget http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
3. Execute the epel install command as such:
For CentOS 5.x:
# yum install epel-release-5-4.noarch.rpm
For CentOS 6.x:
# yum install epel-release-6-8.noarch.rpm
4. Install IFTOP:
# yum -y install iftop
5. Execute the following command to run iftop:
6. To exit iftop run this keyboard command:
To change the screen display, use this command:
To turn off display bar graph, use this command:
# iftop -b -i eth0
To display bandwidth rates in bytes/sec, use this command:
# iftop -B -i eth0