Nov 10, 2018

How to Setup PPTP Server on Ubuntu server

sudo apt-get install pptpd

sudo vi /etc/pptpd.conf

Add to the end:

#localip 192.168.0.1
#remoteip 192.168.0.234-238,192.168.0.245
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245
localip 192.168.4.1
remoteip 192.168.4.2-254

sudo vi /etc/ppp/pptpd-options

Uncomment the ms-dns and add google like below or OpenDNS

ms-dns 8.8.8.8
ms-dns 8.8.4.4

sudo vi /etc/ppp/chap-secrets

# client        server  secret                  IP addresses
username * myPassword *

sudo /etc/init.d/pptpd restart

sudo vi /etc/sysctl.conf


Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

reload the configuration
sudo sysctl -p

sudo vi /etc/rc.local

adding to the bottom just before the exit 0

iptables -t nat -A POSTROUTING -s 192.168.4.0/24 -o eth0 -j MASQUERADE
iptables -A FORWARD -p tcp --syn -s 192.168.4.0/24 -j TCPMSS --set-mss 1356
exit 0

Reboot your server