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.(Source: Wikipedia)
The PPTP specification does not describe encryption or authentication features and relies on the Point-to-Point Protocol being tunneled to implement security functionality. However the most common PPTP implementation, shipping with the Microsoft Windows product families, implements various levels of authentication and encryption natively as standard features of the Windows PPTP stack. The intended use of this protocol is to provide security levels and remote access levels comparable with typical VPN products. (Source: Wikipedia)
Fulfilling Prerequisite
- Install PPTPD DEB Package through aptitude
# aptitude install pptpd
OR
# apt-get install pptpd
- Enable Routing for VPN
Go to /etc/sysctl.conf and enable forwarding
# vi /etc/sysctl.conf
Check for below line if it is commented uncomment it and change value from 0 to 1 , else add it to sysctl.conf
net.ipv4.ip_forward=1
- Enable Masquerading using IPTables
# iptables –t nat –A POSTROUTING –j MASQUERADE
Save the iptables configuration
# iptables-save
- Append below lines in /etc/rc.local so that iptables rules can be saved at boot time
iptables –t nat –A POSTROUTING –j MASQUERADE
iptables-save
Configuring PPTP VPN
- Open /etc/pptpd.conf to configure the IP address
# vi /etc/pptpd.conf
- Change the local ip directive to IP address of the server and remote IP to any IP range which needs to be provided to the clients connecting to VPN
localip 10.1.0.214
remoteip 192.168.101.234-245
- Create Username/Password for VPN Connection
# vi /etc/ppp/chap-secrets
user1 pptpd PASSWORD *
user2 pptpd PASSWORD *
user3 pptpd PASSWORD *
user4 pptpd PASSWORD *
user5 pptpd PASSWORD *
user6 pptpd PASSWORD *
user7 pptpd PASSWORD *
- Restart the service
#/etc/init.d/pptpd stop
#/etc/init.d/pptpd start