Linux offers a variety of tools for monitoring network traffic and bandwidth usage. These tools help you maintain a stable network, pinpoint the cause of slow speeds, and fix faults quickly.
You can monitor network bandwidth usage on Linux systems using command-line (CLI) or graphical user interface (GUI) tools.
Command-line network monitoring tools are ideal for Linux servers without a graphical interface. With a few simple commands, users can quickly get an overview of network bandwidth metrics directly in the terminal shell. Administrators often use these tools in scripts to automate monitoring tasks, track changes in real-time, and reduce response times.
GUI tools typically visually organize and present network data in the form of graphs and charts. This simplifies the process of monitoring network bandwidth and performance, even for users with limited technical experience. Users who run analytics or other tasks that require a detailed representation of network usage will work more efficiently using GUI tools.
Command Line Linux Network Monitoring Tools, this section lists the most commonly used Linux CLI tools for monitoring network traffic and bandwidth.
iftop - Shows bandwidth usage
iftop displays the bandwidth usage of each connection in real-time and provides an overview of the total bandwidth usage. This utility is also very useful for checking network speed.
iftop does not store historical data or track traffic by process ID (PID), which can be a significant drawback for many users. To install iftop, use the command associated with your distribution:
| Linux distributions | iftop installation command | | Debian/Ubuntu | sudo apt install iftop | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install iftop -y | | Fedora | sudo dnf install iftop -y | | Arch Linux | sudo pacman -S iftop | | OpenSUSE | sudo zypper install iftop |
To start iftop, enter the following command:
Press Q to exit IFTOP and return to the command prompt.
nload – Shows network usage
nload is a command-line utility that reports inbound and outbound traffic. The output includes real-time charts that help provide a quick overview of network activity.
However, nload does not display traffic by PID or socket, nor does it store historical data. Enter the command for your distro to install nload:
| Linux distributions | nload installation command | | Debian/Ubuntu | sudo apt install nload | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install nload -y | | Fedora | sudo dnf install nload -y | | Arch Linux | sudo pacman -S nload | | OpenSUSE | sudo zypper install nload |
Start nload with the following command:
Press q to exit nload and return to the command line.
NetHogs - Monitor network traffic bandwidth
The NetHogs utility tracks network usage for each process/application. It allows administrators to diagnose bandwidth spikes and determine which applications are consuming bandwidth excessively. Its main advantage is that it sorts data by process ID. To install NetHogs, enter:
| Linux distributions | Nethogs installation command | | Debian/Ubuntu | sudo apt install nethogs | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install nethogs -y | | Fedora | sudo dnf install nethogs -y | | Arch Linux | sudo pacman -S nethogs | | OpenSUSE | sudo zypper install nethogs |
Once the installation is complete, start the NetHogs service with the following command:
Press q to exit NetHogs and return to the command prompt.
BMON – Bandwidth Monitor and Rate Estimator
BMON monitors bandwidth utilization and provides usage for each device. Users can track the bandwidth of multiple network adapters. It captures network statistics and provides a user-friendly output in graphical form. It does not store historical data but can be used for real-time diagnostics.
To install bmon, enter the command that applies to your distro:
| Linux distributions | bmon installation command | | Debian/Ubuntu | sudo apt install bmon -y | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install bmon -y | | Fedora | sudo dnf install bmon -y | | Arch Linux | sudo pacman -S bmon | | OpenSUSE | sudo zypper install bmon |
To start BMON, enter:
Press q to exit the BMON chart.
vnStat - Network Traffic Monitor
vnStat runs a background daemon to capture bandwidth data. It reads data from the kernel to understand resource usage. Persistent logging is the main feature of vnStat - it collects and stores bandwidth usage logs while the daemon is running.
The vnstat command can be used to display usage statistics and is best suited for statistical reports.
To install vnStat, enter the command that applies to your distribution:
| Linux distributions | vnstat installation command | | Debian/Ubuntu | sudo apt install vnstat | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install vnstat -y | | Fedora | sudo dnf install vnstat -y | | Arch Linux | sudo pacman -S vnstat | | OpenSUSE | sudo zypper install vnstat |
The tool can be run in real-time by specifying the following options:
Press Ctrl+C to stop real-time monitoring.
BWM-NG - Next-Generation Bandwidth Monitor
BWM-NG is a lightweight, Curses-based bandwidth monitor. It provides real-time statistics on network interfaces, showing bandwidth usage in a simple way. To install bwm-ng, enter the command that applies to your distro:
| Linux distributions | bwm-ng installation command | | Debian/Ubuntu | sudo apt install bwm-ng | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install bwm-ng -y | | Fedora | sudo dnf install bwm-ng -y | | Arch Linux | sudo pacman -S bwm-ng | | OpenSUSE | sudo zypper install bwm-ng |
Use the following commands to monitor real-time bandwidth usage for all interfaces:
Press q to exit BWM-NG and return to the terminal.
iPerf/iPerf3 - Network bandwidth measurement tool
iPerf monitors network bandwidth through protocols such as TCP, UDP, and SCTP and is best suited for tuning and maximizing network performance for specific protocols. iPerf requires a server and a client to test, and if you only need to measure network speed, then it is not a candidate.
To install iPerf3, enter the command that applies to your distribution:
| Linux distributions | iPerf3 installation command | | Debian/Ubuntu | sudo apt install iperf3 -y | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install iperf3 -y | | Fedora | sudo dnf install iperf3 -y | | Arch Linux | sudo pacman -S iperf3 | | OpenSUSE | sudo zypper install iperf3 |
Start iPerf3 in server mode with the -s option and listen for the connection:
Press Ctrl+C to terminate the server connection.
ss - socket statistics
The ss command is part of the iproute2 package, which is pre-installed in most Linux distributions. It replaces the older netstat command and provides detailed statistics about network connections, open sockets, and listening ports. SS doesn't focus on bandwidth monitoring like other tools on the list. However, it is essential for socket-level network diagnostics.
Enter the following command to view network connection statistics:
To display all active TCP connections, enter:
Netperf - Network Bandwidth Testing
Netperf helps monitor network bandwidth using Unix domain sockets, TCP, SCTP, DLPI, and UDP over BSD sockets. Like iPerf, Netperf also requires servers and clients for testing. Key features include numerous predefined tests for measuring performance or data transfer speed.
Use the command corresponding to your distro to install Netperf:
| Linux distributions | Netperf installation command | | Debian/Ubuntu | sudo apt install netperf | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install netperf -y | | Fedora | sudo dnf install netperf -y | | Arch Linux | sudo pacman -S netperf | | OpenSUSE | sudo zypper install netperf |
Start the service with the following command:
Netperf runs for a predefined amount of time and then terminates automatically.
CBM - Color Bandwidth Meter
A color bandmeter (CBM) is a small command-line utility that displays the current network traffic on all devices connected to the network. Curses-based output is displayed in color and shows each network interface, number of bytes received, bytes sent, and total bytes.
Use the corresponding command to install cbm on your distribution:
| Linux distributions | Netperf installation command | | Debian/Ubuntu | sudo apt install cbm | | RHEL/Rocky Linux | sudo yum install epel-release -y sudo yum install cbm -y | | Fedora | sudo dnf install cbm -y | | Arch Linux | sudo pacman -S cbm | | OpenSUSE | sudo zypper install cbm |
To start monitoring with CBM, enter:
Press q to close the window.
Original:The hyperlink login is visible. |