How to Setup PPTP VPN on Raspberry Pi

Home » Guides » How to Setup PPTP VPN on Raspberry Pi
Guides, How to No Comments
No votes yet.
Please wait...

raspberry-pi-logo-720x340

In this guide, we will show you how to easily setup PPTP VPN connection on Raspberry Pi through simple steps. Scroll down for more details.

Getting Things Ready

Before creating a new PPTP VPN connection on your Raspberry Pi, first you will need to set things up:

1- You need an internet connection that works properly.

2- Make sure that your you have a Raspberry Pi device.

3- Make sure that your VPN service subscription is active (e.g: bVPN).

Setting Up PPTP VPN on Raspberry Pi (Manually)

Follow the steps below in order to successfully create a new PPTP VPN connection on your Raspberry Pi:

1- Use the command below in order to install the PPTP client:

sudo apt-get install pptp-linux

2- Using /etc/ppp/peers you can create the file with any name as you prefer. Run the following command:

pty “pptp $VPNHOSTNAME –nolaunchpppd –debug”

name $USERNAME

password $PASSWORD

remotename PPTP

require-mppe-128

require-mschap-v2

refuse-eap

refuse-pap

refuse-chap

refuse-mschap

noauth

debug

persist

maxfail 0

defaultroute

replacedefaultroute

Usepeerdns

3- Finally, run this command to connect your PPTP VPN on your Raspberry Pi:

sudo pon $FILENAME

Voila! You have successfully created a PPTP VPN Connection on Raspberry Pi.

Bonus! How to Share Logs

In order to share logs with your VPN administrators in case you face any technical issues, you can do so by running this command: pon $FILENAME debug dump logfd 2 nodetach.

Bonus #2! How to Automatically Launch PPTP VPN on Startup

#! /bin/sh

case “$1” in
start)
sleep 10
pon $/etc/ppp/peers/FILENAME
echo “PPTP Started”
;;
stop)
poff $/etc/ppp/peers/FILENAME
echo “PPTP Stopped”
;;
*)
echo “Usage: /etc/init.d/pptp {start|stop}”
exit 1
;;
esac

exit 0

Now Run:

update-rc.d [filename of script] defaults

Good job!

LEAVE A COMMENT