This is a simple utility that allows you to see the load statistics of network interfaces.
You can install VnStat with the following commands:
Debian/Ubuntu
CentOS
Done. Moving on. We can configure the information in the utility’s CLI interface by configuring along the way /etc/vnstat.conf
.
For example, you can specify a network interface to be listened on by default.
![](https://wiki.spacecore.pro/~gitbook/image?url=https%3A%2F%2F287241268-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FyXvdNIxNLIOcexv7AfU2%252Fuploads%252FLRVBl0z6QbnKgMXUHuIt%252Fimage.png%3Falt%3Dmedia%26token%3D657ab13e-2061-487c-8f29-0da8612fdd25&width=768&dpr=4&quality=100&sign=31578f9b&sv=1)
VnStat saves interface statistics databases in/var/lib/vnstat
.
With the vnstat -i eth0
command we can see the total statistics (if it has accumulated) on the load of a particular interface or all, unless you specify the parameter.
Replace eth0 with the required network interface.
![](https://wiki.spacecore.pro/~gitbook/image?url=https%3A%2F%2F287241268-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FyXvdNIxNLIOcexv7AfU2%252Fuploads%252F5dHk1ExN0iQwc6dc2zIB%252Fimage.png%3Falt%3Dmedia%26token%3D30c188a4-0ae4-47c8-8378-5ea58336d8d5&width=768&dpr=4&quality=100&sign=b2d22588&sv=1)
Available arguments:
-l — real-time traffic collection.
-s — summary.
-t — withdrawal of the ten days in which the load was highest.
-h — information for the last hour.
-d — for the last day.
-w — in the last week.
-m — in the last month.
For example, if you want to check the current load of your server’s network channel, this command will work. Remember to specify a correct network interface.
![](https://wiki.spacecore.pro/~gitbook/image?url=https%3A%2F%2F287241268-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FyXvdNIxNLIOcexv7AfU2%252Fuploads%252FzYZh6hpVfmTX3o0z5Xuh%252Fimage.png%3Falt%3Dmedia%26token%3D698f5124-c900-437d-bd81-7e8881a98874&width=768&dpr=4&quality=100&sign=56d4d85f&sv=1)
Such output allows to determine whether the server is under DDoS-attack. High incoming traffic and a large number of incoming packets do not guarantee that this is the type of attack, but you should definitely pay attention to the protection services from DDoS.
Last updated