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

[/url]memcached.so missing - Memcached installation error

While Memcached installation on Centos server, I was getting the error as '[/url]memcached.so...

How to update MySQL password?

Steps to update the MySQL Password - 1. First stop MySQL service by following command....

How to install Postfix on CentOS?

Postfix is an open-source Mail Transport Agent (MTA), which supports protocols like LDAP, SMTP...

How to setup a WordPress website on plain Centos server?

The following steps have been successfully tested on a plain centos server. Now lets start...

How to perform the Linux Sever Hardening?

1. Check the hostname is setup or not - hostname 2. Check the IP address is assigned to hostname...

Powered by WHMCompleteSolution