PPTPD on Ubuntu
Install pptpd:
apt-get install pptpd ufw
Enable ports in ufw:
ufw allow 22 ufw allow 1723 ufw enable
You might also want to enable ports of your other services. (http….)
Add a virtual network interface:
vim /etc/network/interfaces
Sample File:
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 10.0.0.10 netmask 255.255.255.192 gateway 10.0.0.129 # virtual interfaces auto eth0:0 iface eth0:0 inet static address 192.168.89.1 netmask 255.255.255.0 gateway 10.0.0.10 dns-nameservers 10.0.0.12
Add your dns server to:
vim /etc/ppp/pptpd-options
Uncomment ms-dns and add your dns servers, this sample uses the public google dns servers:
ms-dns 8.8.8.8 ms-dns 8.8.4.4
Configure your vpn ip range:
vim /etc/pptpd.conf
Add the following to the end of the file:
localip 192.168.89.1 remoteip 192.168.89.2-20
Add some user account for the vpn server:
vim /etc/ppp/chap-secrets
# Secrets for authentication using CHAP # client server secret IP addresses user pptpd my_password *
Uncomment the following lines in:
vim /etc/sysctl.conf
net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1
In:
vim /etc/default/ufw
Change the following line from:
DEFAULT_FORWARD_POLICY="DROP"
to:
DEFAULT_FORWARD_POLICY="ACCEPT"
In the following file:
vim /etc/ufw/before.rules
Add before the filter section:
# nat Table rules *natOSTROUTING ACCEPT [0:0] # Allow forward traffic from eth0:0 to eth0 -A POSTROUTING -s 192.168.88.0/24 -o eth0 -j MASQUERADE # dont delete the COMMIT line or these nat table rules wont be processed COMMIT
Reboot to enable the new settings.