Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

How can I see or even control a client cert traffic in OpenVPN? Is it possible? I'm programming a Client Control Web App and I find nothing about it. Is there any script or commands for that? In OpenVPN Access Server I've seen such thing.

Edit: To be clear I want users traffic usage.

share|improve this question

marked as duplicate by Zoredache, Dave M, mdpc, Ward, voretaq7 Feb 7 '14 at 21:11

This question was marked as an exact duplicate of an existing question.

What do you mean by "control a client cert traffic"? Are you looking for something as simple as a packet capture? Or perhaps just watching the OpenVPN log? – EEAA Feb 5 '14 at 20:24
@EEAA What I mean is I want to see a user traffic usage. – Hamid FzM Feb 5 '14 at 20:25
OK. Thanks for the clarification. Please edit your question and include that information. – EEAA Feb 5 '14 at 20:35
You ask many question about openvpn and each time you say in OpenVPN Access Server I've seen such thing. Maybe, one day, you should consider bying a license for it... – krisFR Feb 5 '14 at 20:52
Also look at scripting hooks. OpenVPN passes some data to the scripting hooks, which you can have your scripts captures/store. You might for example want need to have the down-pre hook connect to the management interface and grab the status for that client. – Zoredache Feb 5 '14 at 23:46

If you're willing to step down to IP based user identification, you can expect openvpn to reassign the same VPN-IP for a user's lifetime. See assigned IPs in ipp.txt (/etc/openvpn/servers/VPN/logs, path may vary). Then, check if traffic passes through linux kernel. It might stay within the OpenVPN daemon, not sure about that. tcpdump and see what happens. If it passes through the linux kernel, normal IP accounting would work well (MRTG et al). If it does stay in the daemon, openvpn-status.log contains the external IPs of the currently connected users. Correlating that with MRTG data may be a tough exercise, though. So check if there's any config option for openvpn to force traffic through the kernel.

You're using a Linux server, right?

share|improve this answer
Yes, an ubuntu server – Hamid FzM Feb 6 '14 at 20:36
up vote 0 down vote accepted

I think after searching throw internet I finally found my proper answer. I can enable management in my config file and use telnet to connect to management. Then I can use status command to print log for connected users. In there I can see byes received and sent by connected users. And I think OpenVPN has a database some where for storing user status logs!

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.