How To Install PPTP VPN On Centos 7 ?

August 10, 2014 31.5k views

Please Help Me With Tutorial.

Thanks...........

2 Answers

To install PPTP on Centos 7, simply run:

yum install ppp pptp pptp-setup

Then you can follow the configuration steps laid out in this article. Even though it is written from CentOS 6, it should be largely the same:

How To Setup Your Own VPN With PPTP

by Bulat Khamitov
A Point-To-Point Tunneling Protocol (PPTP) allows you to implement your own VPN very quickly, and is compatible with most mobile devices. Even though PPTP is less secure than OpenVPN, it is faster and uses less CPU resources.

Lazy mode<<<<<<<

rpm -Uvh http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm
yum -y install ppp pptpd

cp /etc/pptpd.conf /etc/pptpd.conf.bak
cat >/etc/pptpd.conf<<EOF
option /etc/ppp/options.pptpd
logwtmp
localip 10.0.10.1
remoteip 10.0.10.2-254
EOF

cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak
cat >/etc/ppp/options.pptpd<<EOF
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
ms-dns 8.8.8.8
ms-dns 8.8.4.4
EOF

cp /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak
cat >/etc/ppp/chap-secrets<<EOF
USERNAME pptpd PASSWORD *
EOF

cp /etc/sysctl.conf /etc/sysctl.conf.bak
cat >/etc/sysctl.conf<<EOF
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.ip_forward = 1
EOF
sysctl -p


chmod +x /etc/rc.d/rc.local
echo "iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o eth0 -j MASQUERADE" >> /etc/rc.d/rc.local
iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o eth0 -j MASQUERADE

systemctl start pptpd
systemctl enable pptpd.service

CentOS 7 testing through on DigitalOcean<<<<<<<

  • @JetsoX Shall we use firewalld instead of iptables in CentOS 7 ?

  • @liweijian Please see the following reference:

    #!/bin/sh
    # firewalld
    zone=public
    firewall-cmd --permanent --new-service=pptp
    cat >/etc/firewalld/services/pptp.xml<<EOF
    <?xml version="1.0" encoding="utf-8"?>
    <service>
      <port protocol="tcp" port="1723"/>
    </service>
    EOF
    firewall-cmd --permanent --zone=$zone --add-service=pptp
    firewall-cmd --permanent --zone=$zone --add-masquerade
    firewall-cmd --reload
    
  • this is really for dummies....

Have another answer? Share your knowledge.