OpenVPN Issue, no internet

Hi there,

I’ve setup OpenVPN on my FreePBX server (Manual Setup, not paid), I can connect just fine to the server, ping it’s IP address and register my phone, but the issue that I’m running into is that I can’t ping 8.8.8.8 or browser while connected to the VPN. I’m using the redirect-gateway option and I think this must be an iptables issue. I added this to the /etc/firewall-4.rules file:

# Enable NAT for the VPN
-t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
# Allow TUN interface connections to OpenVPN server
-A INPUT -i tun0 -j ACCEPT
# Allow TUN interface connections to be forwarded through other interfaces
-A FORWARD -i tun0 -j ACCEPT
-A OUTPUT -o tun0 -j ACCEPT
-A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
# Allow outbound access to all networks on the Internet from the VPN
-A FORWARD -i tun0 -s 10.8.0.0/24 -d 0.0.0.0/0 -j ACCEPT

That didn’t help, I saw that the rules were loading in the /tmp/firewall.log file, at this point I know that I must be missing something really silly.

Any ideas?

Sorry, I was missing net.ipv4.ip_forward=1.

Thanks!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.