Member-only story

How To Monitor Network Traffic with vnStat

John Ali
3 min readJun 30, 2024

--

Monitoring network traffic is essential for managing network performance and ensuring security. One of the effective tools for this purpose is vnStat, a console-based network traffic monitor for Linux systems. It is designed to be simple, requiring minimal system resources, while providing valuable insights into bandwidth usage.

Photo by Austin Distel on Unsplash

What is vnStat?

vnStat is a network traffic monitor that tracks traffic for selected network interfaces, logging data to a database for easy retrieval and analysis. Unlike other network monitoring tools that actively listen to network interfaces, vnStat passively reads the information provided by the kernel. This means it doesn’t introduce additional network overhead, making it highly efficient.

Installing vnStat

To get started with vnStat, installation is straightforward. On most Linux distributions, you can install it using the package manager. For instance, on Debian-based systems like Ubuntu, you can use:

sudo apt update
sudo apt install vnstat

On Red Hat-based systems like CentOS or Fedora, the command is:

sudo yum install vnstat

After installation, you need to start and enable the vnStat service to ensure it runs continuously:

--

--

John Ali
John Ali

Written by John Ali

Versatile Content Creator & Tech Enthusiast: DevSecOps, Machine Learning, Software Engineering, Backend & Frontend Development, Data Engineering

No responses yet