Skip to content

Instantly share code, notes, and snippets.

@Martin91
Created May 6, 2015 15:38
Show Gist options
  • Select an option

  • Save Martin91/dba61b39cf2344fe4985 to your computer and use it in GitHub Desktop.

Select an option

Save Martin91/dba61b39cf2344fe4985 to your computer and use it in GitHub Desktop.
install pptp on ubuntu vps
# https://www.digitalocean.com/community/tutorials/how-to-setup-your-own-vpn-with-pptp
# Step 1 - PPTP Installation
sudo apt-get install pptpd
# edit /etc/pptpd.conf and add the following lines:
# localip is IP address of your server and remoteip are IPs that will be assigned to clients that connect to it
localip 10.0.0.1
remoteip 10.0.0.100-200
# Step 2 - Add DNS servers to /etc/ppp/pptpd-options
ms-dns 8.8.8.8
ms-dns 8.8.4.4
# start PPTP daemon
sudo service pptpd restart
# Verify
netstat -alpn | grep :1723
# Step 3 - Setup Forwarding
# edit /etc/sysctl.conf and add the following line if it doesn’t exist there already:
net.ipv4.ip_forward = 1
# To make changes active, run sysctl -p
# Step 4 - Create a NAT rule for iptables
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
# If you would also like your PPTP clients to talk to each other, add the following iptables rules:
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT
iptables --append FORWARD --in-interface eth0 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment