Installing Poptop (pptpd) VPN Server on CentOS 6
By Leo Gaggl
For roaming mobile clients PPTP (Point-to-Point Tunneling Protocol) is still the quickest way to get VPN connections to tunnel traffic over a secure link.
Installation
I always prefer installation via a yum repository as this will ensure patches are applied during regular system updates
sudo rpm --import http://poptop.sourceforge.net/yum/RPM-GPG-KEY-PPTP<br></br>sudo rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm<br></br>sudo yum install ppp pptpd -y
Configuration
Note: replace $USERNAME and $PASSWORD with actual values
IP configuration
echo "localip 192.168.0.1" >> /etc/pptpd.conf<br></br>echo "remoteip 192.168.0.100-199" >> /etc/pptpd.conf
DNS configuration
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd<br></br>echo "ms-dns 4.2.2.1" >> /etc/ppp/options.pptpd
Authentication configuration
echo "$USERNAME pptpd $PASSWORD *" >> /etc/ppp/chap-secrets
Firewall config
service iptables start<br></br>echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf<br></br>sysctl -p<br></br>echo "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" >> /etc/rc.local<br></br>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<br></br>service iptables restart<br></br>service iptables save<br></br>chkconfig iptables on
Start ppptd
chkconfig pptpd on<br></br>service pptpd start