en
  English
Phone:  +1 (217) 636-4164
Skype:  onegbits
  1. Home
  2. Blog
  3. How To Install PPTP VPN on CentOS 7

How To Install PPTP VPN on CentOS 7

How To Install PPTP VPN on CentOS 7

24

Sep, 16

9939

How To Install PPTP VPN

How To Install PPTP VPN on CentOS 7

How To Install PPTP VPN on CentOS 7? A virtual private network (VPN) is network that extends a private network (i.e. LAN) across a public network, such as the Internet. It enables a communications between computers and devices across shared or public networks as if it were directly connected to the private network, while benefiting from the functionality, security and management policies of the private network. This is done by establishing a virtual point-to-point connection through the use of dedicated connections, encryption, or a combination of the two. Basically, if two computers are connected through a VPN, they can communicate directly the same way as if they were in local network. Although the two computers could be physically very distant, the other computers on the internet are not able to intercept their communication.

First install pptpd

yum install ppp iptables nano
cd /usr/local/src
#For 64bit OS
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm
rpm -Uhvpptpd-1.4.0-1.el6.x86_64.rpm
#For 32bit os
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.i686.rpm
rmp -Uhv pptpd-1.4.0-1.el6.i686.rpm

Setup pptpd

Edit IP setttings in /etc/pptpd.conf:
#nano /etc/pptpd.conf
localip 192.168.0.1 # your VPS/Dedicated Server IP address 
remoteip 192.168.0.101-200
And the following settings to /etc/ppp/options.pptpd:
ms-dns 8.8.8.8
ms-dns 4.4.4.4

Create user to access the VPN server

Add user account in/etc/ppp/chap-secrets (assign username and password):
#nano /etc/ppp/chap-secrets
vpn pptpd vpnpassword *

Enable network forwarding in /etc/sysctl.conf

#nano /etc/sysctl.conf
net.ipv4.ip_forward = 1
#To make the changes to sysctl.conf take effect, use the following command.
sysctl -p

Setup iptables

You need to add the following iptables rules in order to open the correct ports and properly forward the data packets:
iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Start PPTP VPN server

service pptpd restart
chkconfig pptpd on
Congratulation’s! You have successfully installed PPTP VPN
Leave A Comment