FreeBSD Install vnStat – A Console-Based Network Traffic Monitor
vnStat is a console-based network traffic monitor for Linux and BSD systems that can be used to keep track of network traffic usage. Here's how to install vnStat on FreeBSD:
- Install vnStat using the package manager:
sudo pkg install vnstat- Create the vnStat database and configure the default interface:
sudo vnstat -u -i re0Replace "re0" with the name of your network interface.
- Start the vnStat daemon and enable it to start at boot:
sudo service vnstat startrnsudo sysrc vnstat_enable=YES- Verify that vnStat is running:
sudo service vnstat status- To view the network traffic statistics, use the following command:
vnstatBy default, vnStat displays the traffic statistics for the last hour, day, week, month, and year. You can also use the "-h", "-d", "-w", "-m", and "-y" options to view the statistics for specific time periods.
For example, to view the hourly statistics for the last day:
vnstat -hTo view the daily statistics for the last week:
vnstat -dTo view the weekly statistics for the last month:
vnstat -wTo view the monthly statistics for the last year:
vnstat -mTo view the yearly statistics:
vnstat -yWith these steps, you should have vnStat installed and running on your FreeBSD system, and be able to monitor network traffic usage.
