Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to check the utilization of the network interface card while running a communication-intensive benchmark . Can anybody tell me which unix/linux command I can use to monitor the network traffic ?

share|improve this question

3 Answers 3

On Unix systems, the netstat command will show number of bytes in or out on one or all interfaces. In OS X the following command will count bytes in and out every 2 seconds on interface en1:

 netstat -I en1 -w 2
share|improve this answer
    
The windows netstat command will also show network statistics, but uses different options and has a different output. –  Marnix A. van Ammers Apr 27 '10 at 17:59
    
I see you specifically asked for unix/linux . Again, the netstat command will show statistics, but the options available are different in linux (and maybe in different linux versions). Check with 'man netstat'. You might also be able to make use of /proc/net/tcp , /proc/net/udp , and the like via a shell script to get at the data you need. –  Marnix A. van Ammers Apr 27 '10 at 18:09

$ cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:2177834690 1139773238    0    0    0     0          0         0 2177834690 1139773238    0    0    0     0       0          0
 bond0:3681835441 1226421522    0    0    0     0          0         0 944494243 1166445844    0    0    0     0       0          0
  eth0:4102575683 1178937980    0    0    0     0          0         0 944490971 1166445811    0    0    0     0       0          0
  eth1:3874227054 47483542    0    0    0     0          0         0     3272      33    0    0    0     0       0          0
  eth2:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth3:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth4:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth5:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

If you want more detailed stats 'ethtool' or a driver specific utilities would be your best bet.

share|improve this answer

Which Linux are you using - it will depend on that. If you are on Centos or ubuntu then you can use Iptraf. It shows individual connections and the amount of data flowing between the hosts(interface wise).

To install the util :

\# Centos (base repo)
$ yum install iptraf

\# fedora or centos (with epel)
$ yum install iptraf-ng -y

\# ubuntu or debian
$ sudo apt-get install iptraf iptraf-ng

To run the util :

\# iptraf
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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