I have an OpenVPN server. I have troubles connecting to it.
I have followed step by step (a few times) the instructions on How to Set Up an OpenVPN Server on Ubuntu 18.04. However, when I run
sudo openvpn --config client1.ovpn
I get:
Sat Aug 8 21:45:34 2020 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
Sat Aug 8 21:45:34 2020 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
Sat Aug 8 21:45:34 2020 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Sat Aug 8 21:45:34 2020 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Sat Aug 8 21:45:34 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]185.2.52.91:1194
Sat Aug 8 21:45:34 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sat Aug 8 21:45:34 2020 UDP link local: (not bound)
Sat Aug 8 21:45:34 2020 UDP link remote: [AF_INET]185.2.52.91:1194
Sat Aug 8 21:46:34 2020 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sat Aug 8 21:46:34 2020 TLS Error: TLS handshake failed
Sat Aug 8 21:46:34 2020 SIGUSR1[soft,tls-error] received, process restarting
Sat Aug 8 21:46:34 2020 Restart pause, 5 second(s)
Sat Aug 8 21:46:39 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]185.2.52.91:1194
Sat Aug 8 21:46:39 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sat Aug 8 21:46:39 2020 UDP link local: (not bound)
Sat Aug 8 21:46:39 2020 UDP link remote: [AF_INET]185.2.52.91:1194
Sat Aug 8 21:47:39 2020 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sat Aug 8 21:47:39 2020 TLS Error: TLS handshake failed
Sat Aug 8 21:47:39 2020 SIGUSR1[soft,tls-error] received, process restarting
Sat Aug 8 21:47:39 2020 Restart pause, 5 second(s)
This was tried from the same network where the server is. I have also tried to connect from an Android device from another network, without much luck.
Questions:
- For testing purposes, can I connect to the server from the local network?
- Does the IP that one needs to introduce in the
client.conf
have to be the public IP which one can get e.g. from https://api.ipify.org/? - Since there are multiple machines connected to this network, how can the connection be established simply via the public IP? Don't I have to tell specify somewhere the private IP the server has on the network?
- The contents of
client.ovpn
seem to be a concatenation ofclient.conf
, the key, cert and ca files. Is this right? I was expecting the client configuration to look more like an ssh key.