Is there a way to monitor the traffic (e.g., get a live view of the utilization) over a particular network interface, say eth0?

The catch here is that the set of tools on the box is fixed, and is pretty much a stock RHEL deployment, so add-on tools can't be used.

Looking for something basic and usually present like iostat here.


The data you want to see shows up in good old ifconfig.

watch ifconfig eth0

or to make things stand out better:

watch -n 1 -d ifconfig eth0
| improve this answer | |
  • Thanks - this in addition to the comment by @user239558 was just right. I'm accepting your answer since you were the first to mention ifconfig. – BeeOnRope Jan 22 '16 at 0:28
  • Spot on. This is something I've been looking for and although there are many similar questions to this on different forums, this is the first answer I found that nails it. – Hazok Jun 9 '16 at 18:34
  • ifconfig is not in the default path. /sbin/ifconfig may be required. – kevinf Apr 6 '18 at 21:22

I use iftop command. It shows statistics in realtime.

iftop -i eth0

Checkout some sceenshots here:


| improve this answer | |
  • Looks great, unfortunately I am not able to install any new tools on these locked down boxes. – BeeOnRope Dec 15 '11 at 3:19

Without installing new tools:

while ifconfig eth0 | grep 'RX bytes'; do sleep 10; done

| improve this answer | |

on post-2015 or so linux this might be better watch -n1 -d ip -s link show [interface]

| improve this answer | |
function humanValue()
    h=( '' K M G T P )
    i=1; v=$(( $1 * 8 ))
    while [ $v -gt $(( 1 << 10 * i )) ]; do let i++; done;
    echo -n "$(( $v >> 10 * --i )) ${h[i]}b/s";
ifaces=$(ip addr | grep -E "^[0-9]:" | cut -d" " -f2 | tr -d \:)
declare -A RX2 TX2;
while sleep 1; 
    for INTERFACE in $ifaces;
        RX1=$(cat /sys/class/net/${INTERFACE}/statistics/rx_bytes)
        TX1=$(cat /sys/class/net/${INTERFACE}/statistics/tx_bytes)
        DOWN=$(( RX1 - RX2[$INTERFACE] ))
        UP=$(( TX1 - TX2[$INTERFACE] ))
        echo -e "[ $INTERFACE:\tRX: $(humanValue $DOWN)\t|\tTX: $(humanValue $UP) ]"
| improve this answer | |

There are a lot of utilities:

  1. Nethogs
  2. iptraf
  3. Iptables can be a good solution to but if you are using a firewall set up will be a bit hard to relocate correctly the rules
| improve this answer | |
  • iptraf is exactly what i was looking for. But its last release seems be in IPTraf 3.0.0 - September 19, 2005. can this be a problem? – Al-Alamin Apr 25 '18 at 9:42

You can also use iptables to do such think:

iptables -A INPUT -p tcp --dport $port -i eth0


iptables -A OUTPUT -p tcp --sport $port -i eth0

Then iptables -L -n -v will print you how many packets have been going through the interface, iptables -Z to zero this count

| improve this answer | |
  • Output chain should have -o as interface, -i is illegal – drake7707 Apr 29 '19 at 7:38

Take a look at ntop. It provides a lot of detailed data.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.