iptraf

iptraf is a tool used to monitor the network traffic

To add more ports (beyond 104)
iptraf > Enter > Configure > Additional Ports

To change log interval
iptraf > Enter > Timers > Logging interval

Add/Delete/Active/Unactive Filter
iptraf > Enter > IP

Monitor traffic statistics by port
iptraf > Enter > Statistical breakdowns…

To run iptraf background for 10 min and send data to log files
/usr/bin/iptraf -B -s eth0 -t 10

Log file is under /var/log/iptraf/ by default

vnstat — monitoring network traffic

Install vnstat
tar -zxvf vnstat-1.xx.tar.gz

Compile and install
make all
make install

Use vnstat
create new database
vnstat -u -i eth0
database is created under /var/lib/vnstat/eth0

Setup cron to collect data
copy from examples/vnstat.cron

#vnstat
#vnstat -i eth0
#vnstat -d
#vnstat -m

rx = recieved
tx = transmitted