Linux VPN Server

In this guide we will setup a PPTP VPN Server on a CentOS 7 Linux server and connect from a Windows pc.

1). Open TCP port 1723 and allow GRE in your firewall

2). Login to the server with SSH.

3). yum -y install epel-release

4). yum -y install ppp pptpd net-tools iptables-services

5). mv /etc/pptpd.conf /etc/pptpd.conf.bkp

6). mv -f /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bkp

7).

echo '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' > /etc/ppp/options.pptpd

8).

echo 'option /etc/ppp/options.pptpd
logwtmp
localip 10.0.10.1
remoteip 10.0.10.2-254' > /etc/pptpd.conf

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

10).

systemctl stop firewalld.service

systemctl disable firewalld.service

service iptables save

service iptables stop

chkconfig iptables off

iptables -F

chmod +x /etc/rc.d/rc.local

11).

echo "iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE" >> /etc/rc.d/rc.local

iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE

echo "iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu" >> /etc/rc.d/rc.local

iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

iptables-save

12). vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
myuser pptpd mypassword *

Make sure to replace myuser and mypassword with the username and password you want to use to connect.

13). service pptpd restart

14). systemctl enable pptpd

Now your PPTP Linux VPN Server has been configured.

You can now login with your Username and Password you configured earlier.

If you have issues you may need to restart your Server.

To setup your Windows VPN client please reference the guide linked below starting at Step 20:

Marv has written 28 articles

6 thoughts on “Linux VPN Server

  1. Howard says:

    Thank you for another magnificent post. Where else may anybody get that type of info in such an ideal method of writing? I’ve a presentation subsequent week, and I’m on the look for such information.|

Cancel reply

Leave a Reply to Walton

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>