I have posted this same thing at stackOverflow and someone pointed me at the fact that this should be here instead...
I'm looking for possible solutions to the following need:
I have a VPN configured (using openVPN over Linux, BTW), and I want to know at any moment which hosts are connected to it. I recognize that it probably is the same thing as trying to know which hosts are connected to a lan, so any of the solutions might do the job...
The fact is that I once used a hamachi vpn on linux and with it I had the chance to know which hosts were connected to a particular network where I belonged, so I was wondering if something similar might be possible in openVPN (or even any VPN and/or any LAN).
Preferably, I'm looking for opensource/free sw solutions, or maybe the hints to program it myself (in the most simple way if possible, not that I don't know how to program, but I'm trying to achieve this in a simple manner). But anyway, if there are no os/fsw solutions, any other one might do...
Thanks a lot!
Javier, Mexico city
ok! thanks for you reply
I'm trying to deploy the management interface, but I'm facing some trouble I don't know how to handle.
I added the following line to my server conf file:
management 10.8.0.1 2308 /etc/openvpn/password
I am sure port 2308 is unused, and 10.8.0.1 happens to be the address openVPN gives to my server (am I right with this? perhaps I understood this upside down :( ) and I echoed a password of my choice into the password file.
After restarting openvpn I get this:
MANAGEMENT: Cannot bind TCP socket on 10.8.0.1:2308: Cannot assign requested address (errno=99)
any ideas?
In your OpenVPN server.conf file, include the directive: "status /var/log/openvpn-status.log" if it's not there already. (Restart OpenVPN if you do have to make this change.)
...Then, to see what hosts are connected remotely:
$ cat /var/log/openvpn-status.log
You'll get something like this:
----- 8< -----
----- 8< -----
Hope this helps :)
OpenVPN comes with a management interface that can provide some useful information. Please see http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html
It requires some changes to your OpenVPN configuration file: You can activate the management interface by adding these lines
Change the address 192.168.0.100 by the OpenVPN default address and 5555 by any unused port, setup a file (e.g /etc/openvpn/password) that will contain the management interface password. Later do a telnet to target like this:
Furthermore, you can also manage who is connected to your OpenVPN server using a python script, please take a look at ovpnview
if red-hat OS Based
grep openvpn /var/log/messages
if Debian based
grep openvpn /var/log/syslog