VPN PPTP Setup

Share your expert knowledge and show off your skills.

VPN PPTP Setup

Postby mudasir » Sun Feb 01, 2009 5:12 pm

To setup a Linux based PPTP Server.

This setup is for RedHat Enterprise Linux 5. (this should also work on Fedora and CentOS).

------------------------------------------------------------------------------------------------

Step 1. (Installation of PPP Package)

First we need to check whether we already have ppp package installed or not.

Code: Select all

[root@crystalnet.com]# rpm -qa | grep ppp

The above command will show us all packages that contain ppp in their name. RHEL5 comes with a ppp package named "ppp-2.4.4-1.el5", which is already installed.

If the package in not installed you can download the package from
http://coolmudasir.googlepages.com/ppp- ... 5.i386.rpm
and install it using any of the two methods described below

Online installation: (Method 1)

Code: Select all

[root@crystalnet.com]# rpm -ivh http://coolmudasir.googlepages.com/ppp-2.4.4-1.el5.i386.rpm

OR

To download: (Method 2 - Part 1)

Code: Select all

[root@crystalnet.com]# wget -ivh http://coolmudasir.googlepages.com/ppp-2.4.4-1.el5.i386.rpm

To Install: (Method 2 - Part 2)

Code: Select all

[root@crystalnet.com]# rpm -ivh ppp-2.4.4-1.el5.i386.rpm



You can also check for PPP latest packages at
http://sourceforge.net/project/showfile ... _id=118989
------------------------------------------------------------------------------------------------

Step 2. (Installation of PPTP Package)

Again we will check if we the pptp package is already installed or not.

Code: Select all

[root@crystalnet.com]# rpm -qa | grep -t pptp

If the package is not installed then install it. The package can be downloaded from
http://coolmudasir.googlepages.com/pptp ... 4.i386.rpm

and install the package using the command below

Code: Select all

[root@crystalnet.com]# rpm -ivh pptpd-1.3.3-1.rhel4.i386.rpm

All pptp related RPM's and SOURCE are at
http://sourceforge.net/project/showfile ... e_id=51373
------------------------------------------------------------------------------------------------

Step 3. (Check whether kernel supports MPPE-Microsoft Point-to-Point Encryption).

To check whether kernel supports MPPE simply issue the following.

Code: Select all

[root@crystalnet.com]# modprobe ppp-compress-18 && echo "MPPE Support available"

The above command will check the kernel modules related to MPPE and if found will echo "MPPE Support available".
If the support for MPPE is not available then you will need to install DKMS and kernel_ppp_mppe RPM. You can check for latest DKMS and Kernel_ppp_mppe RPM at
http://sourceforge.net/project/showfile ... _id=120221

For convenience i have uploaded related RPM's to my web-site and can be easily downloaded and installed from there.

To install DKMS rpm

Code: Select all

[root@crystalnet.com]# rpm -ivh http://coolmudasir.googlepages.com/dkms-2.0.10-1.noarch.rpm

This will automatically download and install DKMS RPM

To install Kernel_ppp_mppe RPM

Code: Select all

[root@crystalnet.com]# rpm -ivh http://coolmudasir.googlepages.com/kernel_ppp_mppe-0.0.5-2dkms.noarch.rpm

This will download and install kernel_ppp_mppe RPM.

Now you should reboot your computer, and then issue the modprobe command which was initially to check the MPPE Kernel Support.
------------------------------------------------------------------------------------------------

Step 4. (Configure PPTP Related Files)

The files we need to configure are
1. /etc/pptpd.conf
2. /etc/ppp/options.pptpd
3. /etc/ppp/chap-secrets


I have uploaded all sample files at


You can download and take a look at it. Remember to copy these files at their respective locations.
I will not go in detailt o explain each and every option present in these files, it will take a very long time. I would prefer you to please download these files and read them as they are well commented.
------------------------------------------------------------------------------------------------

Step 5 (Starting and testing PPTP Service)

Code: Select all

[root@crystalnet.com]# service pptpd restart
The above command will restart PPTP Server and if any error occurs it will show.

Now we also need to add the service at startup

Code: Select all

[root@crystalnet.com]# chkconfig pptpd on
This command will enable/start the PPTP Server at boot time.

------------------------------------------------------------------------------------------------

Step 6 (Enable IP-Forwarding)

When the clients are connected, they will not be able to use internet as we have not enabled IP-Fowarding.

To enable IP-Forwarding issue the following.

Code: Select all

[root@crystalnet.com]# echo "echo 1 > /proc/sys/net/ipv4/ip_forward" >> /etc/rc.local

------------------------------------------------------------------------------------------------
You can setup a complete firewall to work with this PPTP Setup.

Our PPTP Setup is now complete. I will be waiting for your comments about it, and also if you find any problems in this setup feel free to post here.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Good work

Postby zaib » Fri Aug 28, 2009 8:08 pm

Great work, very simple step by step guide :)

It will be more helpful if you add some more steps on setting pptp for cable.net scenario , like howto bound users so that there net works only if they connect to pptp server. howto restrict.
Regards,

SYED JAHANZAiB

web: http://aacable.wordpress.com
msn: aacable@hotmail.com
zaib
Naik
 
Posts: 97
Joined: Thu Jan 10, 2008 3:11 pm
Website: http://aacable.wordpress.com
WLM: aacable@hotmail.com
Yahoo Messenger: johny_reico@yahoo.com
Location: Karachi

Postby mudasir » Fri Aug 28, 2009 9:20 pm

AOA,

Dear Zaib bhai,

Just by following this a Server is ready for Cable Net. And if you want to setup a firewall for security that is a different thing.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai


Return to “%s” Howto's & Tip n' Tricks

Who is online

Users browsing this forum: No registered users and 0 guests

cron