iftop is a command-line system monitor tool that produces a frequently-updated list of network connections. By default, the connections are ordered by bandwidth usage, with only the “top” bandwidth consumers shown. iftop must be run with sufficient permissions to monitor all network traffic on the interface.
Step 1. Installation.
apt-get install iftop
Step 2. Usage.
iftop is easy to use if you just want to see your current network connections and how much bandwidth is being used by each remote host.
Simply launch it from the command line, passing the -i option with the interface you want to monitor, and optionally the -B
option to display values in bytes.
Some other options:
-h display this message -n don't do hostname lookups -N don't convert port numbers to services -p run in promiscuous mode (show traffic between other hosts on the same network segment) -b don't display a bar graph of traffic -B Display bandwidth in bytes -i interface listen on named interface -f filter code use filter code to select packets to count (default: none, but only IP packets are counted) -F net/mask show traffic flows in/out of network -P show ports as well as hosts -m limit sets the upper limit for the bandwidth scale -c config file specifies an alternative configuration file
Example:
To monitor the eth0 device in bytes, you would run:
iftop -i eth0 -B