Setup PPTP Server on CentOS

Setup PPTP VPN Server on CentOS7 with Firewalld

Setup pptp, pptpd

rpm -i http://poptop.sourceforge.net/yum/stable/rhel7/pptp-release-current.noarch.rpm
yum -y install pptpd

VPN IP config
vi /etc/pptpd.conf

localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245

Add VPN User
vi /etc/ppp/chap-secrets

# client        server  secret                  IP addresses
userName       pptpd   userPassword       *

Add DNS Server and disable mppe-128
vi /etc/ppp/options.pptpd

#require-mppe-128
ms-dns 8.8.8.8

Service pptpd restart

service pptpd restart

Setup forwarding

net.ipv4.ip_forward = 1

Firewalld configuration

firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i eth0 -p tcp --dport 1723 -j ACCEPT 
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT 
firewall-cmd --permanent --direct --add-rule ipv4 filter POSTROUTING 0 -t nat -o eth0 -j MASQUERADE 
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i ppp+ -o eth0 -j ACCEPT 
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i eth0 -o ppp+ -j ACCEPT
firewall-cmd --reload

Add Service

systemctl start pptpd
systemctl enable pptpd.service

Reference
How To Setup Your Own VPN With PPTP
How To Install PPTP VPN On Centos 7
Centos 7 安装 pptp vpn
PPTP VPN in CentOS 7
Redhat / Centos 7 Firewalld best practice for pptp or L2TP/IPsec rules

2 Replies to “Setup PPTP Server on CentOS”

Leave a Reply