Ruan Bekker's Blog

From a Curious mind to Posts on Github

Setup a PPTP VPN on Ubuntu

In this post we will setup a PPTP VPN on Ubuntu 16.04

Disable IPv6 Networking:

Edit the grub config:

1
$ vi /etc/default/grub

Make the following changes:

1
2
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

Update Grub and Reboot:

1
2
$ update-grub
$ reboot

Updates and Install PPTP:

Update Repositories and install PPTPD:

1
2
$ apt update && apt upgrade -y
$ apt install pptpd -y

Configure your Authentication

1
$ vi /etc/ppp/chap-secrets
1
2
# client server  secret          IP addresses
youruser      pptpd   yourpass        *

Configure Local and Remote IP, in this case I want 10.1.1.2 to 10.1.5.1-254

1
$ vi /etc/pptpd.conf
1
2
3
4
5
6
7
option /etc/ppp/pptpd-options
logwtmp
connections 10000
localip 10.1.1.1
remoteip 10.1.1.2-254,10.1.2.1-254,10.1.3.2-254,10.1.4.1-254,10.1.5.1-254
# for a /24 you can set
# remoteip 10.1.1.2-254

Enable IP Forwarding:

Edit the sysctl.conf and enable IP Forwarding:

1
$ vim /etc/sysctl.conf

Populate the following value:

1
net.ipv4.ip_forward=1

Update the Changes:

1
$ sysctl -p

Enable and Start PPTPD:

Enable the service on boot and start the service:

1
2
3
$ systemctl enable pptpd
$ systemctl start pptpd
$ systemctl status pptpd

Connect to your VPN.

Resources:

Comments