Openvpn client can ping the server, but can not ping www.google.com

Solution 1:

You should set up NAT & routing correctly on the server.

If mtr from the server is working correctly, but not from the clients, you should add a rule like this on the server:

# iptables -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source <public IP of server>

Also, be sure that routing is enabled on the server:

# sysctl net.ipv4.ip_forward 
net.ipv4.ip_forward = 0   <<< disabled
# sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1   <<< enabled

Or if you want to enable it at startup, change net.ipv4.ip_forward to 1 in /etc/sysctl.conf and run sysctl -p.