[Solved]Handshake Failed | OpenVZ Ubuntu 14.04 lts

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Locked
singul4r1ty
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 23, 2015 2:32 pm

[Solved]Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by singul4r1ty » Mon Feb 23, 2015 3:05 pm

I've setup successfully OpenVPN last weekend, however yesterday I had to reinstall ubuntu lts on my openvz vps.
(the only difference is I took the 64bit img of ubuntu this time)

I get the following error when trying to connect:
TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
TLS handshake failed
So I assume there is no connection/talking narrows it down to Firewall issue or VPN Service is not running?
I don't know where to go from here?

Service:
no tun0 but there is venet0?
Image

Iptables (I disabled UFW):
Because of OpenVZ masquerade does not work:

Code: Select all

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source 107.161.162.16
Image

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by maikcat » Tue Feb 24, 2015 7:19 am

since you are trying to start openvpn in server mode and tun is not up you must:

Post your config used,
post your log

also make sure your vz has tun/tap support enabled.

Michael.

singul4r1ty
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 23, 2015 2:32 pm

Re: Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by singul4r1ty » Thu Feb 26, 2015 6:08 pm

TUN/TAP: ON
Image

However the service openvpn never starts:

Code: Select all

# service openvpn start
 * Starting virtual private network daemon(s)...                                 
 *   Autostarting VPN 'server'                                                  
# service openvpn stop
 * Stopping virtual private network daemon(s)...                                 
 *   No VPN is running.
server.conf

Code: Select all

port 1194
proto udp
dev tun
ca ca.crt
cert vps.crt
key vps.key  # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

singul4r1ty
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 23, 2015 2:32 pm

Re: Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by singul4r1ty » Thu Feb 26, 2015 6:11 pm

TUN/TAP: ON
Image

However the service never starts running:

Code: Select all

# service openvpn start
 * Starting virtual private network daemon(s)...                                 
 *   Autostarting VPN 'server'                                                  
# service openvpn stop
 * Stopping virtual private network daemon(s)...                                 
 *   No VPN is running.
server.conf

Code: Select all

port 1194
proto udp
dev tun
ca ca.crt
cert vps.crt
key vps.key  # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by maikcat » Fri Feb 27, 2015 7:20 am

use log directive to create a log file and post its contents here...

Michael.

singul4r1ty
OpenVpn Newbie
Posts: 4
Joined: Mon Feb 23, 2015 2:32 pm

Re: Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by singul4r1ty » Fri Feb 27, 2015 10:57 am

:o doh!!! I enabled the log verbose 6 in the server.conf file and on 'service openvpn start' it logged the error that it couldnt find the ca.crt, vps.crt, vps.key, dh2048.pem... turns out they were still in the keys directory, forgot to move them to /etc/openvpn.... Everything is working fine now!
Thanks for your help Michael!

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Handshake Failed | OpenVZ Ubuntu 14.04 lts

Post by maikcat » Fri Feb 27, 2015 11:50 am

you welcome,

Marked as solved,

Closing topic,

Regards,

Michael.

Locked