Rapsberry Pi PPTP VPN server.


sudo apt-get update
 sudo apt-get upgrade

Then check MPPE support:

sudo modprobe ppp-compress-18

No errors? You are good to go!

Next, install the PPTP server package:

sudo apt-get install pptpd



Now edit the pptp.conf file:

sudo nano /etc/pptpd.conf

At the end of the file, uncomment the following lines


And change the “localip” to your raspberry pi ip adres
Remoteip = are the addresses that will be handed out to clients.

Hit Control + X To close and save the file.


Now, edit the ‘/etc/ppp/pptpd-options’ file.

sudo nano /etc/ppp/pptpd-options

Add the follow txt on the bottom:

mtu 1490
mru 1490

Where the IP used for the ms-dns directive is the DNS server for the local network to which your client will be connecting (quite possibly the IP address of your router). Hit Control + X to close/save the file. Next, edit the ‘/etc/ppp/chap-secrets’ files. This is where you will place your credentials for logging into the VPN server. sudo nano /etc/ppp/chap-secrets


Add your authentication credentials in the following form:



It looks like this:


Control + X to close/save the file.

Now restart the PPTP vpn server with:

sudo service pptpd restart

Now, enable forwarding if you wish to have access to your entire home network while away. Edit the ‘sysctl’ file.

sudo vi /etc/sysctl.conf

Find “net.ipv4.ip_forward=1” and uncomment it (or change =0 to =1)

CONTROL + X to close/save the file.

to enable forwarding. Now, execute the following command to apply change

sudo sysctl -p

Last step: Adding iptables rules

sudo nano /etc/rc.local

Add this line just above “exit 0”

sudo iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to IPADRESOFYOURRASPBERRYPI

Hit left control + x and save the file.

(The is the begin first ip adres handed out by the vpn server)

Now forward port 1723 in your router/modem

You are ready to go!