furlongm / openvpn-monitor

openvpn-monitor is a web based OpenVPN monitor, that shows current connection information, such as users, location and data transferred.
http://openvpn-monitor.openbytes.ie
GNU General Public License v3.0
967 stars 293 forks source link

Connection refused to localhost:5555 #23

Closed jomsky10 closed 7 years ago

jomsky10 commented 7 years ago

Am I missing something on configuration? I'm trying to connect the monitoring through outside web browser.

furlongm commented 7 years ago

Did you add the 'management 5555' line to your openvpn config?

jomsky10 commented 7 years ago

yep I've already added 'management 127.0.0.1 5555' on openvpn server.conf but I can't get to work. To clarify, I'm accessing the openvpn monitor on outside web browser... not on the same host... it only displays the whole page with GEOIP but the monitoring won't work...
Connection refused to localhost:5555

DFlower66 commented 7 years ago

Hello, I have OpenVPN working on my Raspberry Pi and I tried to installing the OpenVPN monitor following your instructions but I don't get it working :-(.

I hope you can point me in the right direction. See also the attached error log.

error.zip

furlongm commented 7 years ago

@DFlower66 your error is "The mod_python module can not be used on conjunction with mod_wsgi 4.0+. Remove the mod_python module from the Apache configuration." You need to run a2dismod python to disable to the python module. In future please open a new issue, rather than commenting on an existing issue.

@jomzki03 Are openvpn and openvpn-monitor running on the same server? Can you run telnet localhost 5555?

DFlower66 commented 7 years ago

@furlongm thank you for your response. I disabled the python module.

In the future I will open a new issue. I was searching and I had the same/similar problems like @jomzki03. I'm new to this so please give me some slack ;-)

Thanks!

jomsky10 commented 7 years ago

@furlongm yes they're running at the same server and and I'm connected to telnet via localhost 5555

furlongm commented 7 years ago

If you run python openvpn-monitor.py -d on the host, what is the output?

jomsky10 commented 7 years ago

Here's the output ... image

furlongm commented 7 years ago

Are you connected via telnet already? The management interface can only accept one connection at a time.

If that is ok, can you try changing localhost to 127.0.0.1 in your conf?

jomsky10 commented 7 years ago

got it now working on same host image

now the only problem when I access the monitoring on other host it gives me the refused error image

furlongm commented 7 years ago

The IP address of the VPN (e.g. 127.0.0.1 above) would have to match the IP of the host where you are running the openvpn server. You would also need to expose the openvpn management interface on the external IP address, rather than 127.0.0.1, and you should definitely firewall it.

It might be easier to run everything on the same host?

jomsky10 commented 7 years ago

I've already tried matching the IP of the host on management but still the error persist when I tried to access the site on other machine.

furlongm commented 7 years ago

Are the openvpn server and the openvpn-monitor running on the same host?

jomsky10 commented 7 years ago

Got it working! changed the IP and port of the openvpn management and opened the port to firewall just like you've said. Thanks sir @furlongm :+1:

jomsky10 commented 7 years ago

May I request a feature in your future build sir if you have spare time.

  1. button to disconnect user
  2. client history logs
  3. show client dual/multiple log in at the same time
  4. Log in panel

last question: how can I change the refresh time?

anyways thank you for this great work :))

furlongm commented 7 years ago
  1. The disconnect feature should be there now, please test and let me know if it works for you. See #17 for more details.
  2. Please open a new issue for this feature.
  3. This doesn't work for you?
  4. For now, you'll need to use http auth.
  5. I could also make this configurable, please open a new issue for this feature.
jomsky10 commented 7 years ago

Thank you @furlongm. I'll open a new issue for some additional features.

DonZheng commented 6 years ago

Hi @furlongm,

First of all, I LOVE your work.

I'm quite new to openVPN and Linux. So pls accept my apologies if my questions are too dump.

I setup an OpenVPN server on a VPS with ufw being inactive. Then I put management 127.0.0.1 7505 at the bottom of my server's conf. But when I telnet localhost 7505, I got Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused and

root@mintLover:~# sudo netstat -plnt Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 632/sshd tcp6 0 0 :::22 Can you please shed some light on this issue? I have been googling for the whole night but got no luck so far.

Kindly advise what additional info you need for investigation.

P.S. Previously I encountered the issue that once OpenVPN access server is installed, my client cannot access the openVPN server (with TLS handshake error). Uninstalling it fixed the issue. Then I came here for a solution, but stuck at the first step.