Walker News

How To Setup VPN Server Using pptpd On RHEL?

You might need only 3 minutes to install and configure a Linux VPN server using pptpd and a minute later have Windows 7 VPN client connect pptpd successfully.

On RHEL or CentOS 5 Linux:
  1. Download pptpd. The current version used by this guide is pptpd-1.3.4-2.rhel5.i386.rpm. For experts who want to compile pptpd source code for installation, get it from Poptop official page.
     
  2. Confirm the Linux kernel supports MPPE for encrypted tunnel:
    modprobe ppp-compress-18 && echo ok
    

    If you see “ok” printed after execution, meaning that the MPPE is enabled and nothing need to be done. Otherwise, refer to this guide for help.
     
  3. Install pptpd:
    rpm -Uvh pptpd-rpm-file
    
  4. Edit /etc/pptpd.conf file to set the IP of VPN server and clients using private network address space defined by RFC 1918. For example:
    localip 172.20.20.1
    remoteip 172.20.20.2-6
    

    Where VPN server IP is 172.20.20.1 and only 5 VPN clients allowed connecting concurrently (because remoteip is limited to allocate IP 172.20.20.2 to 172.20.20.6 for connected client).
     
  5. Edit /etc/ppp/chap-secrets file to set VPN login ID and password. E.g.
    walker   pptpd   vpn123:)   *
    

    Where 1st column is VPN login ID, 2nd field is fixed to “pptpd”, 3rd field is the VPN login password, and fourth field is an asterisk to indicate any VPN client IP (defined by “remoteip” in previous step).
     
  6. Configure RHEL/CentOS to auto start pptpd at each reboot:
    chkconfig --level 345 pptpd on
    
  7. Start up pptpd immediately (without reboot Linux) and confirm the VPN server is up and listening for client connection:
    service pptpd start
    netstat -tulpan | grep pptpd
    
  8. Temporarily stop Firewall for first VPN connection attempt (to confirm the pptpd setup is good to go):
    service iptables stop
    

On Windows 7 (64-bit Ultimate edition), nothing need to be installed as the bundled VPN client is capable to connect with pptpd server:
  1. Right click the connection icon at Notification Area (bottom-right corner where the Date/Time is displayed) then choose “Open Network and Sharing Center”.
     
  2. Click “Setup a new connection or network”, “Connect to a workplace”, “Use my Internet connection (VPN)”.
     
  3. For “Internet address”, enter the VPN server’s public/WAN IP (not the 172.20.20.1) which can be “seen” and ping-ed by Windows 7. The “Destination name” is friendly name defined by user to identify this particular VPN connection.
     
  4. Next, enter the VPN login ID and password (as what you’ve defined in /etc/ppp/chap-secrets) and click Connect.

Suppose the login credential is correct, Windows 7 should have no problem connecting with pptpd VPN server.

Custom Search

  1. Thiru Yadav 07-04-13@06:53

    awesome article…..simple and superb

2014  •  Privacy Policy