Question

Cannot reach internet through PPTP VPN

  • Posted June 9, 2014

I built a VPN Server. I can connect VPN server with my pc but after the connection i can’t reach to internet. syslog: http://sudrap.org/paste/text/335723/ route -n: http://sudrap.org/paste/text/335724/

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Solved, thanks for your help!

Newline not work as intended … view source for proper format … anyone can tell me what happened about post formatting?

Seems like you didn’t set the localip & remoteip at /etc/pptpd.conf properly. <pre> localip 192.168.122.1 remoteip 192.168.122.100-200 </pre> You should choose within the private network ip ranges to avoid ip conflict. Check private network ip range at here: http://en.wikipedia.org/wiki/Private_network

Enable IP forwarding at /etc/sysctl.conf (ubuntu) by uncomment/add the following line: <pre> net.ipv4.ip_forward=1 </pre> Then add the following iptable rules (change the private network ip accordingly): <pre> iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE iptables -I INPUT -s 192.168.122.0/24 -i ppp0 -j ACCEPT iptables --append FORWARD --in-interface eth0 -j ACCEPT </pre> Install iptables-persistent to persist the iptables rules: <pre> sudo apt-get install iptables-persistent </pre> If you already installed iptables-persistent just save it <pre> sudo service iptables-persistent save </pre> You may also the following article, in case I get it wrong … https://www.digitalocean.com/community/tutorials/how-to-setup-your-own-vpn-with-pptp