Results 1 to 6 of 6

Thread: HOWTO: PPTP Client in an easy way

Threaded View

  1. #1
    Join Date
    Nov 2005

    HOWTO: PPTP Client in an easy way


    It has been many times that I searched for a command line pptp client howto (as sometimes the GUI apps doesn`t work very well) to send to some "new to ubuntu" friends but always found some sites explaining the whole procedure making it more complicated with the extra scripts need to be created for routing the correct ip addresses through the tunnels.
    That`s why today I took the decision to write a simple bash script to make it as easy as possible to create your tunnel using only one command and then run it using pon and poff.
    I`m pasting my job here hoping to be helpful for others too.

    Of course I`m taking no responsibility if this script blows up your computer or anything similar
    I don`t think that it will do though as I have tested it on my PC and some more friends without problems.

    Let`s begin....

    Run the following to install pptp and pptpsetup:
    sudo apt-get install pptp-linux
    sudo sed -i 's/= "\$DOMAIN\\\\"/\= "$DOMAIN\\\\\\\\"/g' /usr/sbin/pptpsetup
    The sed command replaces a buggy string in the pptpsetup with the correct one.

    Then download the attached script ( and put it under your /bin/ directory. After that, make it executable using:
    chmod +x /bin/
    Then run the script as follows for each of your tunnel:
    <TUNNEL> is just and identification name of your tunnel.
    <SERVER> is the host name or IP address of the pptp server.
    <DOMAIN> is the domain name of the company you are connected. (This is optional but you are strongly encouraged to use it, as if you do have similar usernames in different domains, you will not be able to connect to them without this option being set for each of them.)
    <USERNAME> the username of the pptp user to connect (put it in quotes)
    <PASSWORD> the password of the pptp user (put it in quotes again)
    <IPs_TO_ROUTE_THROUGH_THE_TUNNEL> the iprange of the remote network that it will be routed through the tunnel

    An example of the above command follows:
    sudo --add testtunnel 'myuser' 'myP@ssw0rd'
    Run the tunnel using
    sudo pon <TUNNEL>
    And disconnect the tunnel using
    sudo poff <TUNNEL>
    You can use
    to check the status of the connection after running the pon command.

    Use the script with --delete option, if you want to totally delete the tunnel.
    Code: --delete <TUNNEL>
    Attached Files Attached Files

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts