You are on page 1of 17

08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

🐧 nixCraft

Howto

Fedora Linux

Fedora Linux install vnstat network traffic
monitor

Corporate patron

Get Started With Linode - Free $100 Credit

The Developer's Cloud, Simplified

Develop, deploy, and scale Linux servers

Linode.com

Fedora Linux install vnstat network traffic


monitor
Author: Vivek Gite
Last updated: March 31, 2021
0 comments

H ow 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

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 1/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

1. Find information about vnstat


Run the following dnf command:

dnf update

dnf info vnstat

2. Fedora Linux install vnstat app


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

sudo dnf install vnstat

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 2/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

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.

Patreon supporters only guides 🤓


➔ No ads and tracking

➔ In-depth guides for developers and sysadmins at Opensourceflare ✨


https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 3/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

➔ Join my Patreon to support independent content creators and start reading


latest guides:

↪ How to set up Redis sentinel cluster on Ubuntu or Debian Linux

↪ How To Set Up SSH Keys With YubiKey as two-factor authentication


(U2F/FIDO2)

↪ How to set up Mariadb Galera cluster on Ubuntu or Debian Linux

↪ A podman tutorial for beginners – part I (run Linux containers without


Docker and in daemonless mode)

↪ How to protect Linux against rogue USB devices using USBGuard

↪ If your domain is not sending email, set these DNS settings to avoid
spoofing and phishing

Join Patreon ➔

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/system

Start the service

sudo systemctl start vnstat.service

Stop the service


https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 4/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

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

vnstat -i NIC_NAME

vnstat [options] -i NIC_NAME

Let us see some examples by typing the following command:

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 5/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

vnstat

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

monthly

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 |

daily

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

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 6/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

Display hours stats

vnstat -h

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

Daily bandwidth usage stats

vnstat -d

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 7/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

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

Weekly bandwidth usage stats

vnstat -w

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 8/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

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

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 9/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

Find all time top 10 traffic days

Monitor network transfer rate in real time

vnstat -l

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 10/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

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

Conclusion

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 11/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

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

🥺 Was this helpful? Please add your comment below ↓ to show your appreciation or
feedback to the author.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

RSS feed ➔    


Weekly email newsletter ➔

🔎 To search, type & hit enter...


Related Tutorials

Ubuntu install vnstat console network traffic monitor

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 12/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

FreeBSD Install vnStat - A Console-Based Network Traffic…

CentOS / RHEL: Install vnStat Network Traffic Monitor To…

How to install vnstat on Alpine Linux

CentOS / RHEL: View Vnstat Graphs Using PHP Web Interface…

CentOS / RHEL: Change / Copy File SELinux Security Context…

dnstop - Monitor and display DNS server traffic on your…

Category List of Unix and Linux commands

Download
wget
managers

Documentation help • mandb • man • pinfo

Disk space
df • duf • ncdu • pydf
analyzers

File Management cat • cp • less • mkdir • more • tree

Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 •


Firewall
Ubuntu 20.04

Linux Desktop
Skype • Spotify • VLC 3
apps

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 13/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

Category List of Unix and Linux commands

Modern utilities bat • exa

Network Utilities NetHogs • dig • host • ip • nmap • ping

OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04

Package Manager apk • apt-get • apt • yum

Processes bg • chroot • cron • disown • fg • glances • gtop • iotop • jobs • killall • kill • pidof •

Management pstree • pwdx • time • vtop

Searching ag • egrep • grep • whereis • which

Shell builtins compgen • echo • printf

Terminal/ssh tty

Text processing cut • rev

groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami •


User Information
who • w

WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

0 comments… add one ↓

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 14/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

Name

Post Comment

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the
site admin.

Next FAQ: How to upgrade Debian 9 to Debian 10 Buster using the CLI

Previous FAQ: How to check CPU temperature in OpenSUSE Linux



🔎 To search, type & hit enter...


https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 15/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

FEATURED ARTICLES

1 30 Cool Open Source Software I Discovered in 2013

2 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X

3 Top 32 Nmap Command Examples For Linux Sys/Network Admins

4 25 PHP Security Best Practices For Linux Sys Admins

5 30 Linux System Monitoring Tools Every SysAdmin Should Know

6 40 Linux Server Hardening Security Tips

7 Linux: 25 Iptables Netfilter Firewall Examples For New SysAdmins

8 Top 20 OpenSSH Server Best Security Practices

9 Top 25 Nginx Web Server Best Security Practices

10 My 10 UNIX Command Line Mistakes

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 16/17
08/03/2022 12:02 Fedora Linux install vnstat network traffic monitor - nixCraft

SIGN UP FOR MY NEWSLETTER

➔ Linux shell scripting tutorial

➔ RSS/Feed

➔ About nixCraft



©2002-2022 nixCraft • Privacy • ToS • Contact/Email • Corporate patron Linode

https://www.cyberciti.biz/faq/fedora-linux-install-vnstat-network-traffic-monitor/ 17/17

You might also like