How to Installing Poptop (pptpd) VPN Server on CentOS 6.3

There are mainly 3 types of VPN servers: Point-to-Point Tunneling Protocol (PPTP), Layer 2 Tunneling Protocol (L2TP) and OpenVPN. In this tutorial, we use PPTP because it is supported natively on almost all devices, WindowsLinux, Android, IOS and Mac OS.


I always prefer installation via a yum repository as this will ensure patches are applied during regular system updates
$ sudo rpm --import
$ sudo rpm -Uvh
$ sudo yum install ppp pptpd -y


Note: replace $USERNAME and $PASSWORD with actual values
IP configuration
$ sudo vi /etc/pptpd.conf
DNS configuration
$ sudo vi /etc/ppp/options.pptpd
Authentication configuration
$ sudo vi /etc/ppp/chap-secrets
vpnuser pptpd yourpassword *
Start PPTP VPN server
$ sudo service pptpd restart
Enable network forwarding in /etc/sysctl.conf
$ sudo vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
use the following command to apply the change:
$ sudo sysctl -p
Firewall config
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ sudo iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
$ sudo iptables -A INPUT -i eth0 -p gre -j ACCEPT
$ sudo service iptables save
$ sudo service iptables restart
Turn on the pptpd service at startup and reboot the server:
$ sudo chkconfig pptpd on
Now you can test the VPN server from any client: Windows PCs, Linux PCs, Android phones/tablets, or iPhone and iPad.
The log of the VPN server, by default, is combined with system log located at /var/log/messages.