How To Setup PPTP VPN on Ubuntu 14.04 LTS

No comments
What is PPTP?
A Point-To-Point Tunneling Protocol (PPTP) allows you to implement your own VPN very quickly, and is compatible with most mobile devices. Even though PPTP is less secure than OpenVPN, it is also faster and uses less CPU resources.

1. Update and Upgrade Repo
sudo apt-get update && sudo apt-get upgrade -y

2. Install PPTPd
sudo apt-get install pptpd -y

3. Setting up PPTP Internal/Private IP Network.
edit /etc/pptpd.conf and add the following lines

4. Add DNS servers to /etc/ppp/pptpd-options

5. Now restart PPTP Daemon 
sudo service pptpd restart

5.1. Check if pptpd is running by run following command.
netstat -lntp | grep -i :1723

6. Setup Forwarding
It is important to enable IP forwarding on your PPTP server. This will allow you to forward packets between public IP and private IPs that you setup with PPTP
edit /etc/sysctl.conf and add the following line if it doesn't exist
net.ipv4.ip_forward = 1

6.1. And run following command to take effect
sudo sysctl -p /etc/sysctl.conf

7. Create a NAT rule for iptables
iptables -t nat -A POSTROUTING -o ##INTERNET INTERFACE## -j MASQUERADE && iptables-save

8. Setup authentication for PPTP by adding users and passwords. Simply add them to /etc/ppp/chap-secrets

9. Allow Only One Connection per User
Refer this article

P/S: bersawang dah blog ni.

No comments :

Post a Comment