Which IP address is using more bandwidth?

→ Are you a new visitor? Please visit the page guidance for new visitors ←

Which IP address is using more bandwidth?

I’ve made before another article similar to this one about tracking and monitoring your server bandwidth, this however, is something a bit different, with more in depth view per IP address. Before you could see only the total amount of bandwidth used IN or OUT of your server, however perhaps in certain cases you wish to know more detail, like to which server IP is being used more bandwidth, or more specifically, which IP is using the most bandwidth in real time.

This article is about just that, you can use the application tool called iftop to monitor in real time each IP bandwidth usage and to which server public IP is being pointed. This will help you determine more information on who’s the culprit using the bandwidth and if necessary take action against it.

How to install iftop

To install iftop is really simple, you just need to run the command:

By default when running the command iftop

this will also try to resolve the IP addresses for you. In some cases however you would not want this. For example, on my server it would look similar to bellow:

It would resolve the entire IP address where possible. To avoid this, you can run the command:

This in turn will only show you the server IP addresses along with the connections IPs and their usage. You can also go more in detail with this, for instance, if you hit the ‘t‘ key you can change how you group the IP addresses and their view in:

  • total usage (upload and download together) on one line
  • only upload / received traffic
  • only download / sent traffic
  • total usage (upload and download separated) on two lines

This will help you more depending on each case what you want to see.

If you have multiple interfaces with more IP addresses, you can select which interface you want to monitor, by default it should load eth0, but you can change to a different one using command:

That’s a bit all you would mostly use, consult the manual if you want more details, but mostly this is what you would mostly be using.

Will see you again in our next article.

Request an article ←