Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setup PPTP VPN
#1
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

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 
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. allows to forward packts 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 take afftect 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
-----------------------------------------------------------
  


Forum Jump:


Users browsing this thread:
1 Guest(s)