OpenVPN server: how to tell if server is listening/working?

I'm trying to set up an OpenVPN server on an EC2 instance. There doesn't seem to be any Ubuntu documentation for OpenVPN, so I'm mostly following the instructions here:

My Android phone reports "connection refused". Tunnelblick says "TLS handshake failed".

I would like to check that OpenVPN actually is listening on my server. But there's no OpenVPN process running - it uses systemd. And it uses UDP rather than TCP, so the usual trick of connecting with telnet doesn't work. Can anyone tell me how I can verify that OpenVPN is actually listening?

The server is running Ubuntu Trusty.

2 Answers

I got OpenVPN working. To answer my question:

There should be a server running like this:

$ ps auxww | grep openvpn
root 536 0.0 0.5 35672 5108 ? Ss 00:47 0:00 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid

In my case there wasn't due to a misconfiguration. It's fairly obvious, but for the record: to find openvpn problems in the syslog:

sudo service openvpn stop
sudo service openvpn start
sudo tail /var/log/syslog
3

I have poor experience with Linux. I've the same issue. I installed openvpn server on Lubuntu 20.04. Then I generated the portasalvo.ovpn file. When I tried to connect from the client, I got the usual no answer "TSL error: TSL key negotiation failed to occour within 60 secs". From the client side I can ping the public address, both directly and via DDNS. On the server side I made an attempt to get some information. Below the output. Any hint?

salvo@salvo-Latitude-E5500:~$ sudo service openvpn stop
salvo@salvo-Latitude-E5500:~$ sudo service openvpn start
salvo@salvo-Latitude-E5500:~$ sudo tail /var/log/syslog
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: Options error: --cert fails with 'server.crt': No such file or directory (errno=2)
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: WARNING: cannot stat file 'server.key': No such file or directory (errno=2)
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: Options error: --key fails with 'server.key': No such file or directory (errno=2)
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: WARNING: cannot stat file 'ta.key': No such file or directory (errno=2)
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: Options error: --tls-auth fails with 'ta.key': No such file or directory (errno=2)
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: Options error: Please correct these errors.
May 19 19:28:40 salvo-Latitude-E5500 ovpn-server[8539]: Use --help for more information.
May 19 19:28:40 salvo-Latitude-E5500 systemd[1]: : Main process exited, code=exited, status=1/FAILURE
May 19 19:28:40 salvo-Latitude-E5500 systemd[1]: : Failed with result 'exit-code'.
May 19 19:28:40 salvo-Latitude-E5500 systemd[1]: Failed to start OpenVPN connection to server.
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like