ruby on rails engineer
Setup PPTP VPN server on CentOS 7
16 Nov 2014

This guide has been tested with CentOS 7 server.

Setup PPTP Server

First we need to install pptp server using yum

# yum install ppp pptp pptpd pptp-setup

Then we need to configure the pptpd

# vim /etc/pptpd.conf

Add server IP and client IP at the end of the file like below


This sets up the PPTP server to use IP while distributing the IP range to to PPTP clients. Change these as you wish as long as they are private IP addresses and do not conflict with IP addresses already used by your server.
Configure DNS servers to use when clients connect to this PPTP server

# vim /etc/ppp/options.pptpd

Uncomment the ms-dns and change them to google like below or OpenDNS


Now add a VPN user in /etc/ppp/chap-secrets file

# vim /etc/ppp/chap-secrets

The column is username. Second column is server name, you can put pptpd in there. Third column is password. The last column is the IP addresses, you can put * to allow all IP.

# client    server      secret          IP addresses
username    *       myPassword      *

Finally start your server

# service pptpd restart

To start PPTP Daemon automatically when rebooting next time, use the following command

# chkconfig pptpd on

Setup IP Forwarding

To enable IPv4 forward. Change /etc/sysctl.conf file, add forward rule bellow

# vim /etc/sysctl.conf

Add the following line


Then reload the configuration

# sysctl -p

Add forward rule to iptables

# vim /etc/rc.local
iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE
iptables -A FORWARD -p tcp --syn -s -j TCPMSS --set-mss 1356

To ensure that /etc/rc.local script is executed during boot run the following

# chmod +x /etc/rc.d/rc.local

You are done. Just reboot your server and you should be able to connect to using PPTPD and send all your traffic through this server.