Monitoring network traffic and bandwidth usage is critical for maintaining server performance, identifying security threats, and troubleshooting connectivity issues. This article explores a selection of essential Linux command-line utilities—including nload, iftop, and netstat—that provide real-time insights into data transfer rates, active connections, and hardware interface statistics, allowing administrators to keep their infrastructure running smoothly.

For any system administrator or web hosting professional, visibility into network activity is non-negotiable. Whether you are managing a single VPS or a complex cluster of compute resources, these five tools will help you identify bottlenecks and monitor data flow effectively.

1. nload: Real-Time Bandwidth Usage

nload is a console-based application that monitors network traffic and bandwidth usage in real time. It provides easy-to-read graphs for incoming and outgoing traffic, making it perfect for a quick visual check of your server's current load.

nload eth0
  • nload → the base command to launch the monitoring interface.
  • eth0 → specifies the particular network interface you wish to monitor.

2. iftop: Network Traffic by Connection

While nload shows the total bandwidth, iftop does for network usage what "top" does for CPU usage. It displays a frequently updated list of network connections between pairs of hosts, showing you exactly who is consuming your bandwidth.

iftop -i eth0 -P
  • -i → allows you to specify the interface to listen on.
  • -P → displays host port numbers in the output, which is helpful for identifying specific services like web or mail traffic.

3. vnStat: Persistent Traffic Logging

Unlike other tools that show live data, vnStat is a network traffic monitor that keeps a log of hourly, daily, and monthly network traffic for the selected interface(s). It does not require root privileges to run and is excellent for tracking monthly data cap usage.

vnstat -d
  • -d → displays the traffic statistics on a daily basis for the last 30 days.

4. Netstat: Comprehensive Network Statistics

Netstat (network statistics) is a versatile tool for finding problems in the network and determining the amount of traffic on the network as a performance measurement. It shows all active TCP connections and the ports on which the computer is listening.

netstat -tulpn
  • -t → displays TCP connections.
  • -u → displays UDP connections.
  • -l → shows only listening sockets.
  • -p → shows the PID and name of the program to which each socket belongs.
  • -n → shows numerical addresses instead of trying to determine symbolic host, port, or user names.

5. IPTraf-ng: IP Network Statistics

IPTraf-ng is a focused, console-based network monitoring utility. It gathers various figures such as TCP connection packet and byte counts, interface statistics and activity indicators, and TCP/UDP traffic breakdowns by protocol.

iptraf-ng -g
  • -g → starts the general interface statistics facility, providing a bird's-eye view of all network activity across the system.

Final thoughts

Effective network monitoring is the backbone of a reliable Linux environment. By combining real-time visual tools like nload with deep-dive connection monitors like iftop and long-term logging utilities like vnStat, you can ensure your server remains optimized and secure. These tools are lightweight enough to run on any AlmaLinux or Debian-based system without impacting performance, making them indispensable additions to your administrative toolkit.

Bu cevap yeterince yardımcı oldu mu? 86 Bu dökümanı faydalı bulan kullanıcılar: (305 Oy)