PPTP VPN Server: Built on a Raspberry Pi
A Virtual Private Network (VPN) is a method of adding a layer of security and privacy to both private and public networks. A VPN can allow you to securely access your home or business network even while connected to an untrusted public network like a wifi hotspot. In a VPN you can access all your private network resources as if you were on your home network. There are many options when it comes to VPN's. I am using a Raspberry Pi, so I need a solution that will utilize few resources. In this tutorial I will show you how to setup a Point-to-Point Tunneling Protocol (PPTP) VPN on a Raspberry Pi. PPTP is least secure VPN method but is simple to setup.
As always, update package lists to insure we get the latest packages. Then Upgrade. Check MPPE support. Then install the required vpn package(pptpd).
sudo apt-get update sudo apt-get upgrade sudo modprobe ppp-compress-18 sudo apt-get install pptpd
Now we need to edit a few files.
The first is the pptpd.conf file.
sudo nano /etc/pptpd.conf
At the end of the file, uncomment the following lines and add your information. localip is your server IP and remoteip is the range for your clients.
localip 192.168.0.1 remoteip 192.168.1.245-255
sudo nano /etc/ppp/pptpd-options
Add the follow txt on the bottom:
ms-dns 192.168.1.1 noipx mtu 1490 mru 1490
sudo nano /etc/ppp/chap-secrets
Add your credentials using the following syntax:
Restart the PPTP VPN Server
sudo service pptpd restart
sudo vi /etc/sysctl.conf
sudo sysctl -p
sudo nano /etc/rc.local
Add the following right above “exit 0”
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
IMPORTANT!! Make sure to forward port 1723 on your router and you should be good to go!!