I have tried to set up a OpenVPN on my pi, using this guide: http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing/#awesm=~oBvYD8BOiTdCQN
I cannot connect with the following error being generated:
UDP link local: (not bound)
UDP link remote: [AF_INET]xx.xxx.x.xx:1194
TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
TLS Error: TLS handshake failed
SIGUSR1[soft,tls-error] received, process restarting
Looking here (https://openvpn.net/index.php/open-source/faq/79-client/253-tls-error-tls-key-negotiation-failed-to-occur-within-60-seconds-check-your-network-connectivity.html) this is a common error which suggests problems with:
- Port forwarding
- Wrong server address
- Windows whitelist problems
Regarding 1: I run the following script prior to connecting, which is meant to punch a hole in the firewall (see step 12 of the guide) - this is meant to be automated but I can't find where to place it to make this happen, but that is a question for another post. For now i run this manually:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 192.1$
I execute with "&& echo OK || echo Failed" and it executes fine.
So, although I am not very well versed in this stuff, I believe the firewall issue is not the issue.
IP address for my PI is static at 192.168.0.20; port forwarding is set to 1194 (see config files below)
I have stared at this for quite a while now, but can't see the problem. Here is my server.config file:
dev tun proto udp
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.0.20 255.255.255.0"
# Set primary domain name server address to the SOHO Router
# If your router does not do DNS, you can use Google DNS 22.214.171.124
push "dhcp-option DNS 192.168.0.1"
# Override the Client default gateway by using 0.0.0.0/1 and
# 126.96.36.199/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"
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
status /var/log/openvpn-status.log 20
I am trying to connect from Ubuntu.
Responding to Goldilock's comment below:
iptables -L POSTROUTING, after running the firewall script, gives:
iptables: No chain/target/match by that name.
iptables -L gives:
Chain INPUT (policy ACCEPT) target prot opt source
Chain FORWARD (policy ACCEPT) target prot opt source
Chain OUTPUT (policy ACCEPT) target prot opt source
I am not sure what I am looking for here.
At this point I remain pretty stumped. I feel like I have looked at numerous server.config files and multiple guides, but I can't see what the problem might be.
If anyone can spot any problems that would be much appreciated.