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
).
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
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
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, as has been misunderstood. 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.
RELATED:
Getting "Cannot ioctl TUNSETIFF tun: Operation not permitted" when trying to connect to OpenVPN