OVPN 2.4 - How to log both bandwidth and data use per client?

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
TommyKL
OpenVPN User
Posts: 35
Joined: Sat Sep 15, 2018 4:44 pm

OVPN 2.4 - How to log both bandwidth and data use per client?

Post by TommyKL » Tue May 11, 2021 4:21 pm

I've been scouring the net for two days and have come across a lot of interesting articles and solutions that seem to work for some but so far, not for me. From the posts I've read, many others have sought this answer but for what ever reason, this still eludes me. I figure it's time to post here just to get some leads since Google is leading me down rabbit holes left and right.

I know about the disconnect script but the reason this doesn't work for me is because some of the clients keep their tunnels open 24/7.
I'm using a script to update an ongoing record of each clients Bytes Received and Bytes Sent but this doesn't give me a way to know how much bandwidth and data a client has used at any given period, a day, a month, etc. If I could know that, then I could have a method of making sure that no one client uses up too much bandwidth or data using shaping and other methods.

I am testing this also;
https://github.com/jofrep/scripts/blob/ ... n-users.pl

However, I wonder if there are already tools built into ovpn that I have simply not been able to find yet that could do what I'm after.

So again, to be clear, I know about the tools I can use later to control bandwidth and limit usage but the first thing I cannot solve is finding a simple way of knowing how much resource any one client is using up since they aren't always logging off.

I hope this makes sense as I'm quite new to ovpn.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OVPN 2.4 - How to log both bandwidth and data use per client?

Post by TinCanTech » Tue May 11, 2021 4:48 pm

Openvpn does not do any traffic control, except in P2P mode via --shaper.

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: OVPN 2.4 - How to log both bandwidth and data use per client?

Post by Pippin » Tue May 11, 2021 5:08 pm

I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

TommyKL
OpenVPN User
Posts: 35
Joined: Sat Sep 15, 2018 4:44 pm

Re: OVPN 2.4 - How to log both bandwidth and data use per client?

Post by TommyKL » Wed May 12, 2021 7:10 pm

Not using P2P mode so i guess controls will be with the Linux OS and not ovpn.

Thanks, I had found this in my searching but I'll look again now. It doesn't really give much info other than what I can find from the command line however.

Post Reply