Linux – Client unable to reach Internet through OpenVPN

iptablesipv4linuxopenvpn

The clients can all connect through OpenVPN.

OpenVPN serves the following pool: server 10.8.0.0 255.255.255.0

I've configured the server's iptable with the following rule:

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

and

echo 1 > /proc/sys/net/ipv4/ip_forward

This used to work back on the old vps I used. Now I've migrated to a vps which has ipv6 connectivity.

Is it possible that Ipv6 has something to do with the fact that the clients can't reach the internet?

Best Answer

I was having the same problem, it was being caused by this iptables rule:

iptables -A FORWARD -j DROP

To fix it, I added these rules before the rule above:

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
iptables -t filter -A FORWARD -i tun0 -o eth0 -j ACCEPT
iptables -t filter -A FORWARD -i eth0 -o tun0 -j ACCEPT
iptables -A INPUT -i tun0 -j ACCEPT

Also, make sure to do this:

echo 1 > /proc/sys/net/ipv4/ip_forward