PopTop VPN (pptpd)

How to setup and configure a CentOS VPN Server using pptpd

poptop has created some packages to simplify seting up a CentOS Server as a PPTP VPN server. PPTP VPN servers have their advantages including native support from android devices.

Install ppp With Yum:

yum -y install ppp

Setup poptop Yum Repo

Install pptpd (beta repo used for CentOS6 because of ppp version)

yum --enablerepo=poptop-beta -y install pptpd

Add “localip” and “remoteip” to /etc/pptpd.conf
The “localip” setting is the public IP address of this server, and the “remoteip” is the address range you want to assign to connected clients.

echo "localip xxx.xxx.xxx.xx" >> /etc/pptpd.conf
echo "remoteip xxx.xxx.xxx.xx-xx" >> /etc/pptpd.conf

Add dns info to /etc/ppp/options.pptpd


Create a User in /etc/ppp/chap-secrets

echo "mrvpnuser pptpd mrVPNpass12 *" >> /etc/ppp/chap-secrets

Allow IP forwarding by modifying /etc/sysctl.conf

sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g'/etc/sysctl.conf
sysctl -p

Allow iptables to masquerade IPs

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/etc/init.d/iptables save
/etc/init.d/iptables restart

Set Service to Start at Boot & Reboot

/sbin/chkconfig pptpd on

You can grep through the syslog for ppp and pptpd for anything related to this service.