Tuesday, August 7, 2007

Linux PPTP VPN client configuration

It is faily easy to install the packages needed and hand configure the pptp client for a linux server. The pptp server is a windows 2003 server running RRAS. How ever from my experience what was more difficult is configuring the firewall to let the pptp traffic go through. Here is what I did to make a connection from Linux PPTP client to the RRAS.

  • Installed pptp-linux

    • Optionally you can install pptpconfig which will make life easier with the client configuration part. For that You have to add the below source to your sources.list "deb http://quozl.linux.org.au/pptp/pptpconfig ./"



  • Collected the server details needed

    • PPTP Server Name - vpn.yourdomain.com

    • VPN User Name - user1

    • VPN Password - passw0rd

    • Connection Name - vpn1



  • Edited the file /etc/ppp/chap-secrets to add the line "user1 PPTP passw0rd *"

  • created a file /etc/ppp/peers/vpn1. Entered the configuration details as below.



pty "pptp vpn.yourdomain.com  - -nolaunchpppd"

name user1

remotename PPTP

require-mppe-128

file /etc/ppp/options.pptp

ipparam vpn1


With this the configuration finished. You can start the tunnel by issueing

  • 'sudo pppd call vpn1' or 'pon vpn1'.

  • for debug info try 'sudo pon veveo debug dump logfd 2 nodetach'


To stop the pptp tunnel, do a "sudo pkill pppd". You will be able to see the connection status/details in "/var/log/messages"

For me this much was easy. This didnt worked for me straight away. Fair enough, then after a long search I could find that pptp to work through my Juniper Netscreen (ns25) firewall, opening tcp port 1723 is not enough, I should allow the "GRE Protocol" (protocol 47) pass through. I added a custom service for GRE and then everything was working fine.

I am planning to implement a linux SSL vpn server later when I get time. But anyway only after learning the advantages and disadvantages of the SSL VPN.

2 comments:

Ashwin said...

Hi,

I read your article on The PPTP Server for Linux. But could this article solve my following query, -

I’ve installed Linux fedora 3 on my machine and I want to develop the VPN server on Linux. I’ve several machines which access the linux box as gateway for net and mail usage. The Webmin cp is installed on it. Now I want, if any external windows based machine want to connect my internal windows server using RDP through linux gateway, the linux server should give the access to my internal machine using VPN connection; is it possible? There is broadband service running on my linux server. How I can give the RDP access of internal network (windows) machine to external windows based machine through linux ..?

Thanks.

Regards,
Ashwin.

kryptoz said...

@Ashwin, my article was to configure the pptp client to connect to a pptp server. For your question, the answer would be..

a) http://download.webmin.com/download/modules/pptp-server.wbm.gz
b) http://download.webmin.com/download/modules/ipsec.wbm.gz
c) http://www.strongswan.org/
d) http://www.openswan.org/
e) http://www.poptop.org/

Maybe, if you just want to let some few users connect to their windows server using RDP, I would try let them login via ssh (with x-session enabled ) and let them rdesktop to the windows server using "rdesktop" in the gateway linux server.
I never tried this and this is just a thought, maybe you can give a try. And off-course if they want the rdesktop window to open up in the client computers, they will need something like xming.