CentOSLinuxTutorials

How To Install PPTP VPN on CentOS 6

Install PPTP VPN on CentOS 6

In this tutorial, we will show you how to install and configuration of PPTP VPN on your CentOS 6 server. For those of you who didn’t know, The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. PPTP uses a control channel over TCP and a GRE tunnel operating to encapsulate PPP packets. The PPTP specification does not describe encryption or authentication features and relies on the Point-to-Point Protocol being tunneled to implement security functionality. We use PPTP because it is supported natively on almost all devices, Windows, Linux, Android, iOS, and Mac OS.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. Here are the steps to install PPTP VPN on CentOS 6.

Prerequisites

  • A server running one of the following operating systems: CentOS 6.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install PPTP VPN on CentOS 6

Step 1. First, install PPTP

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

Step 2. Setup PPTP

Edit IP settings 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

Step 3. Create a 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 *

Step 4. 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

Step 5. Set up 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

Step 6. Start PPTP VPN server

service pptpd restart
chkconfig pptpd on

Congratulations! You have successfully installed PPTP VPN. Thanks for using this tutorial for installing PPTP VPN on CentOS 6 system. For additional help or useful information, we recommend you to check the official PPTP VPN website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button