Install and Configure PPTP VPN Client on (RHEL/CentOS/Ubuntu)

  1. Install PPTP Client
    • Ubuntu/Debian
    • sudo apt-get install pptp-linux
       
    • RHEL/CentOS/Fedora
    • sudo yum install pptp
       
  2. Modify chap-secrets /etc/ppp/chap-secrets and add the below line (replacing variables)
    $USERNAME   PPTP    $PASSWORD   *
     
  3. Create a config file named vpn.domain.com in the directory /etc/ppp/peers, and add (replacing variables)
    pty "pptp $VPN_SERVER --nolaunchpppd"
    name $USERNAME
    remotename PPTP
    require-mppe-128
    file /etc/ppp/options.pptp
    ipparam vpn.domain.com
  4. Register the ppp_mppe kernel module
    sudo modprobe ppp_mppe
     
    *Note that on a VPS, you will need to enable PPP through the VPS console.
     
  5. Validate that the following options in /etc/ppp/options.pptp are not commented
    lock
    noauth
    refuse-pap
    refuse-eap
    refuse-chap
    nobsdcomp
    nodeflate
    require-mppe-128
     
  6. Edit /etc/pppp/ip-up.d/route-traffic and add the following route
    #!/bin/bash
    NET="192.168.0.0/16" #< Modify according to your environment
    IFACE="ppp0"         #< Modify according to your environment
    #IFACE=$1
    route add -net ${NET} dev ${IFACE}
     
  7. Connect to the VPN server
    • RedHat/CentOS
      sudo pppd call vpn.domain.com
       
    • Ubuntu/Debian
      sudo pon vpn.domain.com
       
  8. Verify that the interface is up
    [root@localhost ppp]# ip a | grep ppp
    19: ppp0:  mtu 1488 qdisc pfifo_fast state UNKNOWN qlen 3
        link/ppp
        inet 198.23.230.10 peer 10.255.254.0/32 scope global ppp0
     
    • If the server will not start, look in /var/log/messages for errors from pppd

No comments:

Powered by Blogger.