I am trying to connect Raspberry Pi as a client to OpenVPN server(Ubuntu 14.04.3). Following is my server and client side configuration
# server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
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
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 5
# client.ovpn
client
dev tun
proto udp
remote 10.1.2.12 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert pi2.crt
key pi2.key
ns-cert-type server
log-append openvpn.log
verb 5
On client side, I get this log "Initialization Sequence Completed." But I can't ping from client to server by ping 10.8.0.1
or vice-versa.
If I change proto tcp
on both ends, then it works perfectly fine.
To troubleshoot the problem, I did following things.
Tested if my network is capable of handling UDP traffic by
on server
nc -l -u 1194
on client
nc -u 10.1.2.12 1194
I was able to communicate to server from client and vice-versa.
Lower the mtu by adding following configuration in both ends
tun-mtu 1000 fragment 900 mssfix
Changed UDP port to some higher value, like 25000
But still I am not able solve this issue. Any help will be appreciated. Client-Server logs
From OpenVPN manual:
From your client's OpenVPN logs: Line 308:
Hint: you're "pinging" wrong addresses.
Hint2: What's firewall state?
Hint3: Did you enabled IPv4 forwarding by:
echo 1 > /proc/sys/net/ipv4/ip_forward
?