Cactus Castle

First step to have a dream - go to sleep

0%

Setup PPTP VPN Server on Ubuntu

Successfully setup a PPTP VPN Server on Ubuntu, following the instructions here.

All went smoothly. Just one thing to be noticed that don’t install OpenVPN and PPTP VPN on the same host. I did that and neither of them work. Guess there might be some kind of confliction.

And for my first impression, PPTP VPN appears easier to use than OpenVPN. Although OpenVPN provides a web page to setup the configuration in graphical UI, but that’s probably becuase there’s too much configurations to set. And PPTP just needs several lines of command to setup everything.

The general process as below.

Installation

1
2
apt-get install pptpd -y
update-rc.d pptpd defaults

##Configuration##

1
2
3
4
5
6
7
8
9
10
vim /etc/pptpd.conf
localip 172.20.1.1
remoteip 172.20.1.2-254

vim /etc/ppp/pptpd-options
ms-dns 8.8.8.8
ms-dns 8.8.4.4

vim /etc/ppp/chap-secrets
username * password *

##Start Service##

1
service pptpd restart

##Forwording##

1
2
3
4
5
6
7
8
9
10
11
12
vim /etc/sysctl.conf
net.ipv4.ip_forward=1

sysctl -p

iptables -I INPUT -p tcp --dport 1723 -m state --state NEW -j ACCEPT
iptables -I INPUT -p gre -j ACCEPT
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -s 172.20.1.0/24 -j TCPMSS --clamp-mss-to-pmtu

iptables -L
iptables-save > /etc/iptables.rules