Login

How to setup PPTP VPN server on CentOS 7 VPS

Below instructions will guide you through installing and configuring PPTP VPN server.

1. Install EPEL Repository

yum -y install epel-release

2. Install Poptop and required packages

yum -y install ppp pptpd net-tools iptables-services

3. Edit /etc/ppp/options.pptpd to make it look like below:

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′

4. Edit /etc/pptpd.conf to look like below:

option /etc/ppp/options.pptpd
logwtmp
localip 10.0.10.1
remoteip 10.0.10.2-254′

5. Enable IP Forwarding:
Run the following command to enable IP forwarding:

echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf

To verify run the following command.

sysctl -p
You will get output similar to:

net.ipv4.ip_forward = 1

net.ipv4.ip_forward should have the value 1.

6. Enable IP Masquerade

iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
iptables-save

7. Add/Edit PPTP Users:
You can add or edit VPN users by editing /etc/ppp/chap-secrets. It contains user and password pairs in each line.

8. Start and enable Poptop

systemctl enable pptpd
systemctl start pptpd-