tcptrack command displays the status of TCP connections that it sees on a given network interface. tcptrack monitors their state and displays information such as state, source/destination addresses and bandwidth usage in a sorted, updated list very much like the top command.
Install tcptrack
# cd /usr/src
# wget http://dag.wieers.com/rpm/packages/tcptrack/tcptrack-1.1.5-1.2.el5.rf.x86_64.rpm
# rpm -ivh tcptrack-1.1.5-1.2.el5.rf.x86_64.rpm
Sometimes, you may find dependency errors while trying to install tcptrack command.
# rpm -ivh tcptrack-1.1.5-1.2.el5.rf.x86_64.rpm
warning: tcptrack-1.1.5-1.2.el5.rf.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
libpcap.so.0.9.4()(64bit) is needed by tcptrack-1.1.5-1.2.el5.rf.x86_64
In such cases, install the dependency package. In this case, do the following:
# yum install libpcap
tcptrack requires only one parameter to run i.e. the name of an interface such as eth0, eth1 etc. Use the -i flag followed by an interface name that you want tcptrack to monitor.
# tcptrack -i eth0
# tcptrack -i eth1
You can also monitor a particular port using tcptrack.
# tcptrack -i eth0 port 25
# tcptrack -i eth1 port 80