Openvpn – How to identify and list openvpn connected clients

openvpn

I need to know, how can I identify an OpenVPN clients, connecting to an OpenVPN gateway with a username, for example? Where would I put it in the connection profile file? Or generate a personal certificate with a name for it?

Another question – when I have two OpenVPN clients connected, user1 and user2, how do I list them and their assigned IP's from OpenVPN server machine? Commands in OpenVPN telnet management interface don't seem to provide this.

Best Answer

Generally, your situation seems to predicate CCD, "client config dir". CCD is a directory containing one file per connection profile. The file is tied to a unique client key, so that the key "johndoe" gets the profile specified in ccd/johndoe assigned when connecting. With this approach, you know which IP a specific client has. However, if you just want to list connected clients together with IPs, you can specify "status openvpn-status.log" in your config file. Then openvpn-status.log will contain an updated list of connected clients.