1

I looking for the best solution to log all connecting client's ip to either a text file or a database who logs into my VPN server. Under the IP I mean the public WAN IP on the internet where they are connecting from.

A hack could definitely be to make the openvpn server log to a separate logfile and run logtail periodically to extract the necessary information. So the database I want to build would look like:

  Client_Name | Client_IP    | Connection_date
  roadwarr1   | 72.84.99.11  | 03/04/14 - 22:44:00 Sat

Please don't recommend me to use the commercial Openvpn Access Server. That's not a real solution here. If the disconnection date could be determined that would be even better so I could see how long a client was connected and from where!

Thank you

TossUser
  • 17
  • 1
  • 3

1 Answers1

1

OpenVPN includes the ability to call scripts on certain events. When the script is called various variables are passed to the script like the information you have asked for.

So a simple solution might be to build a --client-connect script that wrote the information to a log file in your prefered format. If you want the disconnection status as well, then add a --client-disconnect script.

Zoredache
  • 130,897
  • 41
  • 276
  • 420