Fedora Linux install vnstat network traffic monitor

How do I install vnstat network traffic monitor on Fedora Linux system to monitor my hourly, daily, weekly, and monthly bandwidth usage?

vnstat is free and open-source software. It is a console-based network traffic monitor that keeps a log of daily network traffic for the selected network interface. It is not a packet sniffer. The traffic information gathered from the /proc file-system so that application can use without root user-level access. This page shows how to install vnstat on Fedora Linux desktop or server.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Fedora Linux
Est. reading time 3 minutes

1. Find information about vnstat

Run the following dnf command:
dnf update
dnf info vnstat

vnstat console-based network traffic monitor for Fedora Linux

2. Fedora Linux install vnstat app

Simply run the following command to install vnstat on Fedora Linux:
sudo dnf install vnstat

How to install vnstat on Fedora Linux

3. Configure the vnstat

You need to edit the file named /etc/vnstat.conf using a text editor such as vim/nano:
sudo vi /etc/vnstat.conf
Set default interface name (use the ip command to obtain interface name):
Interface "wlp1s0"
Save and close the file in vim/vi.

Enable the service

Type the following systemctl command:
sudo systemctl enable vnstat.service
Sample outputs:

Created symlink /etc/systemd/system/vnstatd.service ? /usr/lib/systemd/system/vnstat.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vnstat.service ? /usr/lib/systemd/system/vnstat.service.

Start the service

sudo systemctl start vnstat.service

Stop the service

sudo systemctl stop vnstat.service

Restart the service

sudo systemctl restart vnstat.service

Find status of the vnstat service

sudo systemctl status vnstat.service

4. Learn how to use vnstat

The syntax is as follows:
vnstat -i NIC_NAME
vnstat [options] -i NIC_NAME

Let us see some examples by typing the following command:
vnstat -i eth0

Sample outputs:

Database updated: Thu Jul 11 17:00:51 2019
   eth0 since 06/11/17
          rx:  796.74 TiB      tx:  86.08 TiB      total:  882.81 TiB
                     rx      |     tx      |    total    |   avg. rate
       Jun '19     29.50 GiB |    2.84 GiB |   32.33 GiB |  104.64 kbit/s
       Jul '19     11.95 GiB |    1.05 GiB |   13.00 GiB |  117.89 kbit/s
     estimated     34.59 GiB |    3.04 GiB |   37.63 GiB |
                     rx      |     tx      |    total    |   avg. rate
     yesterday      1.82 GiB |  172.14 MiB |    1.99 GiB |  193.09 kbit/s
         today    901.73 MiB |   92.55 MiB |  994.28 MiB |  132.98 kbit/s
     estimated      1.24 GiB |     129 MiB |    1.37 GiB |

One can display traffic summary for a merge of interfaces eth0, eth3 and eth7:
vnstat -i eth0+eth3+eth7
Want to see information about interface eth9 in xml format? Try:
vnstat -i eth0 --xml
How about see all information of all monitored interfaces in json format? Try:
vnstat --json
vnstat --json -i eth0

Display hours stats

vnstat -h

Show traffic statistics on a hourly basis for the last 24 hours

Daily bandwidth usage stats

vnstat -d

See traffic statistics on a daily basis for the last 30 days

Weekly bandwidth usage stats

vnstat -w

Get network traffic for 7 days, current and previous week

Monthly network usage stats

vnstat -m

My traffic statistics on a monthly basis for the last 12 months

Get top 10 bandwidth usage days

vnstat -t

Find all time top 10 traffic days

Monitor network transfer rate in real time

vnstat -l

Gif 01: vnstat live in action

Force a database update for interface eth0

vnstat -u -i eth0

Delete database of interface eth1 and stop monitoring it

vnstat -i eth1 --delete


This page showed you how to install and use vnStat which a console-based network traffic monitor for Linux that keeps a log of network traffic for the selected interface(s). For more info, see project home page here.

This entry is 4 of 6 in the vnStat Monitor and Log Network Traffic Tutorial series. Keep reading the rest of the series:
  1. How to install vnstat on a CentOS/RHEL/Fedora Linux
  2. View Vnstat Graphs Using PHP Web Interface Frontend
  3. How to install vnstat on FreeBSD Unix server
  4. Fedora Linux install vnstat network traffic monitor
  5. Ubuntu install vnstat console network traffic monitor
  6. Alpine Linux install vnstat

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum