How to setup PPTP VPN?

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 also faster and uses less CPU resources.

It is very easy way to use file sharing and access the resources on remote locations -

1. On CentOS 6 x64:
# rpm -i http://poptop.sourceforge.net/yum/stable...noarch.rpm
# yum -y install pptpd

2. On
Ubuntu 12.10 x64:
# apt-get install pptpd

3. Now you should edit '/etc/pptpd.conf' and add the following lines:
localip 10.0.0.1
remoteip 10.0.0.100-200

Note :
Where localip is IP address of your server and remoteip are IPs that will be assigned to clients that connect to it.

4. Next, you should setup authentication for PPTP by adding users and passwords. Simply add them to /etc/ppp/chap-secrets :
---------------------------------------------------------------------
client server secret IP address
For example - test pptd Test123 *
---------------------------------------------------------------------
Note : In the above test is as username and Test123 is password for VPN client.

5. Add DNS servers to /etc/ppp/pptpd-options -
------------------
ms-dns 8.8.8.8
ms-dns 8.8.4.4
------------------

6. Setup Forwarding -

Now important to setup IP forwarding on PPTPD server to allow to forward packets between public IP and private IPs that setup PPTP.
edit file /etc/sysctl.conf and add following line - 
net.ipv4.ip_forward = 1
and now run "sysctl -p" in order to affect the changes.

7. Create a NAT rule for iptables by folowing commands - 
-----------------------------------------------------------
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
-----------------------------------------------------------

If you would also like your PPTP clients to talk to each other, add the following iptables rules :

-----------------------------------------------------------
#iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
#iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT
#iptables --append FORWARD --in-interface eth0 -j ACCEPT
-----------------------------------------------------------
8. Now start or restart PPTPD server -
-----------------------------------------------------------
#service pptpd restart
-----------------------------------------------------------

Now PPTP server also acts as a router.

Note : Allow PPTPD runs on port 1723 so we need to open in firewall.

Refer below commands to do this -
-----------------------------------------------------------
#iptables -A INPUT -p tcp --dport 5015 --jump ACCEPT
#service iptables-save
-----------------------------------------------------------

Was this answer helpful?

 Print this Article

Also Read

How to fix Amazon S3-RequestTimeTooSkewed?

If you have configured a Amazon S3 backup server under cPanl backup configuration to upload...

How to setup the email alert for low disk space?

If you don't want to setup to a full monitoring solution such as Nagios you can create your own...

How to backup and restore large MySQL databases using mysqldump?

1. Backup database: #mysqldump -u username -p[username_password] databasename >...

How to install latest version of git on CentOS release 6.8 (Final)?

Install latest version of git on CentOS release 6.8 - Step 1. Install Dependencies - yum install...

How to install FFMPEG CentOS?

ffmpeg is the most popular opensource video streaming software and its being used on many...

Powered by WHMCompleteSolution