Can Connect to OpenVPN but no internet access
16,867
Needed to add this to /etc/rc.local
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $MY_IP
Which probably would have shown up had I checked out route
earlier!
Related videos on Youtube
Author by
bak202
Updated on September 18, 2022Comments
-
bak202 over 1 year
I have set up an openvpn server, generated a certificate and downloaded it to my client machine.
After importing the client.ovpn file in the network manager, I can still ssh into the server itself, but cannot access the internet.
In my sever's openvpn server.conf, I have:
push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 208.67.222.222" push "dhcp-option DNS 208.67.220.220"
all uncommented.
In the global sysctl.conf file I also have:
net.ipv4.ip_forward=1
Is there anything I am missing configuration wise? What can I do to help debug the problem?
-
Fabby about 9 yearsWhere can't you access the Internet? On your client or on the server?
-
bak202 about 9 yearsClient, the server can access it fine
-
Fabby about 9 yearsCould you give the output to
route
on the client before and after connecting to the server? Please edit your question to provise this.
-
-
James Hyde about 8 yearsTo the server's.
-
Chuck Dries almost 8 yearsAny chance you can explain why we need this on the server side? What does it do?