1

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?

0

3 Answers 3

2

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


management 192.168.0.100 5555 /etc/openvpn/password

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:


telnet 192.168.0.100 5555

Furthermore, you can also manage who is connected to your OpenVPN server using a python script, please take a look at ovpnview

0
2

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< -----

OpenVPN CLIENT LIST
Updated,Mon Aug 17 12:20:18 2009
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
siteX,x.x.x.x:16597,14377206,74214704,Mon Aug 10 13:36:21 2009
siteY,y.y.y.y:6983,42178125,396122560,Thu Aug  6 00:30:17 2009
[...]
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
10.100.7.0/24,siteX,x.x.x.x:16597,Mon Aug 17 12:19:18 2009
10.100.8.0/24,siteY,y.y.y.y:6983,Mon Aug 17 12:19:18 2009
[...]
GLOBAL STATS
Max bcast/mcast queue length,0
END

----- 8< -----

Hope this helps :)

1
  • thanks too, didn't knew all this, I can use it in case of emergencies also... Aug 17, 2009 at 22:54
-2

if red-hat OS Based

grep openvpn /var/log/messages

if Debian based

grep openvpn /var/log/syslog

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .