I have a computer with Ubuntu 16.04, that I am trying to connect to my Raspberry Pi.
Here you can see mer Server config:
dev tun
proto udp
port 11941
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/server.crt
key /etc/openvpn/easy-rsa/pki/private/server.key
dh /etc/openvpn/easy-rsa/pki/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
# server and remote endpoints
ifconfig 10.8.0.1 10.8.0.2
# Add route to Client routing table for the OpenVPN Server
push "route 10.8.0.1 255.255.255.255"
# Add route to Client routing table for the OPenVPN Subnet
push "route 10.8.0.0 255.255.255.0"
# your local subnet
push "route 192.168.87.0 255.255.255.0"
# Set your primary domain name server address for clients
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
# Override the Client default gateway by using 0.0.0.0/1 and
# 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of
# overriding but not wiping out the original default gateway.
push "redirect-gateway def1"
client-to-client
duplicate-cn
keepalive 10 120
tls-version-min 1.2
tls-auth /etc/openvpn/easy-rsa/pki/ta.key 0
cipher AES-256-CBC
auth SHA256
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
#crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
log /var/log/openvpn.log
verb 1
# Generated for use by PiVPN.io
And here is my client config
client
dev tun
proto udp
remote xxx.xx.xxx.xxx 11941
resolv-retry infinite
nobind
persist-key
persist-tun
key-direction 1
remote-cert-tls server
tls-version-min 1.2
verify-x509-name server name
cipher AES-256-CBC
auth SHA256
comp-lzo
verb 1
<ca>
-----BEGIN CERTIFICATE-----
Keys, Certificates etc.
Here is the log from the server:
Thu Jul 13 18:17:32 2017 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 27 2017
Thu Jul 13 18:17:32 2017 library versions: OpenSSL 1.0.1t 3 May 2016, LZO 2.08
Thu Jul 13 18:17:32 2017 Control Channel Authentication: using '/etc/openvpn/easy-rsa/pki/ta.key' as a OpenVPN static key file
Thu Jul 13 18:17:32 2017 TUN/TAP device tun0 opened
Thu Jul 13 18:17:32 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Thu Jul 13 18:17:32 2017 /sbin/ip link set dev tun0 up mtu 1500
Thu Jul 13 18:17:32 2017 /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
Thu Jul 13 18:17:32 2017 GID set to nogroup
Thu Jul 13 18:17:32 2017 UID set to nobody
Thu Jul 13 18:17:32 2017 UDPv4 link local (bound): [undef]
Thu Jul 13 18:17:32 2017 UDPv4 link remote: [undef]
Thu Jul 13 18:17:32 2017 Initialization Sequence Completed
And this is the response I get on the client when trying to connect to the server:
sudo openvpn pivpn2.ovpn
[sudo] password for simon:
Thu Jul 13 18:18:33 2017 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
Thu Jul 13 18:18:33 2017 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Enter Private Key Password: ************
Thu Jul 13 18:18:36 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Thu Jul 13 18:18:36 2017 Control Channel Authentication: tls-auth using INLINE static key file
Thu Jul 13 18:18:36 2017 UDPv4 link local: [undef]
Thu Jul 13 18:18:36 2017 UDPv4 link remote: [AF_INET]xxx.xx.xxx.xxx:11941
Thu Jul 13 18:19:36 2017 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Thu Jul 13 18:19:36 2017 TLS Error: TLS handshake failed
Thu Jul 13 18:19:36 2017 SIGUSR1[soft,tls-error] received, process restarting
Thu Jul 13 18:19:38 2017 UDPv4 link local: [undef]
Thu Jul 13 18:19:38 2017 UDPv4 link remote: [AF_INET]xxx.xx.xxx.xxx:11941
Thu Jul 13 18:20:38 2017 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Thu Jul 13 18:20:38 2017 TLS Error: TLS handshake failed
Thu Jul 13 18:20:38 2017 SIGUSR1[soft,tls-error] received, process restarting
Thu Jul 13 18:20:40 2017 UDPv4 link local: [undef]
Thu Jul 13 18:20:40 2017 UDPv4 link remote: [AF_INET]xxx.xx.xxx.xxx:11941
Thu Jul 13 18:21:40 2017 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Thu Jul 13 18:21:40 2017 TLS Error: TLS handshake failed
Thu Jul 13 18:21:40 2017 SIGUSR1[soft,tls-error] received, process restarting
I am a noob in this field, and I don't know what this error means. I have opened port 11941 for 192.168.87.150 internal. Can someone help me with this?