I'm using ocserv as VPN server in my company on ubuntu, and I want to view how much traffic each user is using. Users are set in ocpsswd file. Do ocserv have this feature or any library I can use? As I search Google and I'm confused. Anybody can help me?
Asked
Active
Viewed 598 times
2 Answers
0
connect your server with putty and run this command
occtl show users
this command will return all connected users with IDs Result of above command
then type this command to view particular user stats
occtl id [ID from the above command first colum]
occtl id 1662451
occtl is built-in command of ocserv

JIbran Saeed
- 1
- 1
-
Really thanks for your answer, as I determined, occtl show id is showing user usage for current session only. Is there a way to see or calculate for a period for example a month? Or any file logging all session info everytime a user disconnects and reconnects? – Hamed Zargar Apr 25 '23 at 04:00
-
I've tested several ways for a lightweight approach. Vnstat is doing great. and Openconnect server is using different interface names VPNS{number}. The problem is that everytime a user connects and opens a session, a new interface name is assigned to him/her. Is there a way to avoid changing interface names per session for each user? – Hamed Zargar Apr 27 '23 at 09:36
0
Consider using ntopng panel to control and monitor traffic. Or you can run multiple instances of ocserv on your server and let each user use one.
-
Thanks a lot. I,ve tried ntopng and seems that most features are premium. Prefer a more lightweight way maybe. Running multiple ocserv for 15 users is so weird. – Hamed Zargar Apr 27 '23 at 14:14