Hi All, apologies in advance for what is probably a foolish error, but I'm hoping your wisdom can help me spot, or troubleshoot it.
Have re-setup OpenVPN on Raspberry Pi following SD Card failure, and can't get it to work. Followed excellent guide on
http://readwrite.com/2014/04/10/raspberry-pi-vpn-tutorial-server-secure-web-browsing which I used last time.
LAN IP of my Pi is 192.168.1.215
Server.conf:
local 192.168.1.215
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/MJH-Pi.crt
key /etc/openvpn/easy-rsa/keys/MJH-Pi.key
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig 10.8.0.1 10.8.0.2
push "route 10.8.0.1 255.255.255.255"
push "route 10.8.0.0 255.255.255.0"
push "route 192.168.1.215 255.255.255.0"
push "dhcp-option DNS 192.168.1.1" # This should already match your router address and not need to be changed.
push "redirect-gateway def1"
client-to-client
duplicate-cn
keepalive 10 120
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
cipher AES-128-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log 20
log /var/log/openvpn.log
verb 1
To eliminate issues with router port forwarding I've created an internal OVPN profile to test within my network first:
client
dev tun
proto udp
remote 192.168.1.215 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ns-cert-type server
key-direction 1
cipher AES-128-CBC
comp-lzo
verb 1
mute 20
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>
I've created a firewall opening script:
#!/bin/sh
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 192.168.1.215
This is chmod 700 and chown root
Finally, I've called this script from my /etc/network/interfaces file:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
pre-up /etc/firewall-openvpn-rules.sh
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
All I get is the following in the client logs:
2015-12-03 16:19:06 LZO-ASYM init swap=0 asym=0
2015-12-03 16:19:06 EVENT: RESOLVE
2015-12-03 16:19:06 Contacting 192.168.1.215:1194 via UDP
2015-12-03 16:19:06 EVENT: WAIT
2015-12-03 16:19:06 SetTunnelSocket returned 1
2015-12-03 16:19:06 Connecting to 192.168.1.215:1194 (192.168.1.215) via UDPv4
2015-12-03 16:19:16 Server poll timeout, trying next remote entry...
2015-12-03 16:19:16 EVENT: RECONNECTING
Any and all assistance as to where I have gone wrong - or tips for how to track down the problem greatly received.
Thanks
Martyn.