Page 1 of 1

OpenVPN connection fails from RHEL 7.3 client on EC2

Posted: Wed Feb 08, 2017 9:11 pm
by amphibient
I have a working OpenVPN configuration on Windows 7. I am able to connect to it via the GUI as well as from the command line (openvpn --config .\openvpn.ovpn).

I copied all my config files over to an EC2 instance of RHEL 7.3 and installed openvpn. However, when I try to run sudo openvpn --config ./openvpn.ovpn), the trace ends up showing

Code: Select all

Wed Feb  8 14:52:27 2017 Restart pause, 5 second(s)
Wed Feb  8 14:52:32 2017 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Wed Feb  8 14:52:32 2017 Socket Buffers: R=[87380->87380] S=[16384->16384]
Wed Feb  8 14:52:32 2017 Attempting to establish TCP connection with [AF_INET]<OPENVPN_IP>:443 [nonblock]
Wed Feb  8 14:52:42 2017 TCP: connect to [AF_INET]<OPENVPN_IP>:443 failed, will try again in 5 seconds: Connection timed out
Wed Feb  8 14:52:57 2017 TCP: connect to [AF_INET]<OPENVPN_IP>:443 failed, will try again in 5 seconds: Connection timed out
Wed Feb  8 14:53:13 2017 TCP: connect to [AF_INET]<OPENVPN_IP>:443 failed, will try again in 5 seconds: Connection timed out
Wed Feb  8 14:53:28 2017 TCP: connect to [AF_INET]<OPENVPN_IP>:443 failed, will try again in 5 seconds: Connection timed out
Wed Feb  8 14:53:43 2017 TCP: connect to [AF_INET]<OPENVPN_IP>:443 failed, will try again in 5 seconds: Connection timed out
Wed Feb  8 14:53:58 2017 TCP: connect to [AF_INET]<OPENVPN_IP>:443 failed, will try again in 5 seconds: Connection timed out
Please note that the EC2 instance is just an openvpn client, not a server. I am trying to establish a connection from it to a server, which is what the above log placeholder is the IP of.

Why does the same configuration fail on the cloud VM that succeeds locally on Windows 7 and what should I do to fix it?

This question has also been asked here: http://serverfault.com/questions/831431 ... ent-on-ec2.

Re: OpenVPN connection fails from RHEL 7.3 client on EC2

Posted: Wed Feb 08, 2017 9:33 pm
by TinCanTech
How about you paste the config file :roll:

Re: OpenVPN connection fails from RHEL 7.3 client on EC2

Posted: Wed Feb 08, 2017 9:43 pm
by amphibient
Here is the config file:

## acme.ovpn ##
client
proto tcp
dev tun
persist-key
persist-tun
ca ca.crt
cert mycert.crt
key mykey.key
remote <REMOTE_IP> 443
route <SOME_OTHER_IP> 255.255.255.0
resolv-retry infinite
status openvpn-status.log
verb 3

Re: OpenVPN connection fails from RHEL 7.3 client on EC2

Posted: Thu Feb 09, 2017 6:35 am
by ShelLuser
When you say you're able to connect to it, what do you mean? Do you connect locally or remotely?