Results 1 to 10 of 35

Thread: PPTP VPN in Jaunty and Intrepid

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Beans
    275
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking PPTP VPN in Jaunty and Intrepid

    This worked for me. Use at your own risk. YMMV. Edit: See post #4 below for an important update to this post ...

    I've bleated previously here and on Launchpad about how PPTP VPN worked perfectly under Hardy and was broken under Intrepid and Jaunty. For me, this was a "deal-breaker" because I need PPTP VPN access. I have not upgraded my desktop Hardy machine for this reason. I did upgrade my laptop to Intrepid and now to Jaunty and got around the problem by using PPTP VPN in a Xubuntu Hardy VirtualBox.

    I've spent the evening looking at this again and I've managed to get PPTP VPN working on my Jaunty laptop. I'm not a PPTP or VPN expert by any means.

    I used this post as starting point, so thanks to kryptoz. The problem as I can see it is that Network Manager 0.7 (Intrepid and Jaunty) and the associated PPTP plugin are broken. Under Hardy (Network Manager 0.6.6) everything works. There are many posts detailing the myriad problems with Network Manager 0.7. However, using the Network Manager applet is simply a front-end to calling PPTP and PPPD which actually make the connection (I think).

    My solution does not involve the Network Manager applet at all. The connection is established by calling PPPD. The pptp-linux and ppp (for pppd) package must be installed and the pptpd package as well (I think).

    1. Add the following to /etc/ppp/chap-secrets:

    Code:
    Username   PPTP   Password   *
    2. Create /etc/ppp/peers/vpn1. The 'peers' folder may be owned by group 'dip' so get around that by adding yourself to the group (I have no idea if this is a good solution, but it worked). Add the following to the vpn1 file:

    Code:
    pty "pptp remote.gateway.address.here  --nolaunchpppd"
    name Username
    remotename PPTP
    require-mppe-128
    file /etc/ppp/options.pptp
    ipparam vpn1
    3. Edit the options.pptp file as required. I commented out the 'refuse-chap' and 'refuse-mschap-v2' lines.

    4. Establish the VPN connection with:

    Code:
    sudo pppd call vpn1
    or

    Code:
    sudo pon vpn1
    5. Drop the connection when you're done with:

    Code:
    sudo poff vpn1
    That establishes a VPN connection but I could not get any traffic through it. Therefore, create '/etc/ppp/ip-up.d/route-traffic' as follows. I don't know why the file needs to have that name or be located in that folder, because it does not appear to be executed automatically. Thanks to this site for this information:

    Code:
    #!/bin/bash
    NET="10.0.0.0/8"
    IFACE="ppp0"
    route add -net ${NET} dev ${IFACE}
    Make the file executable.

    Replace the "10.0...." address with the range of addresses you need to access on your remote machine. For me, this was the same range as that which I originally included when setting the VPN up in Hardy. It may look like "10.2.0.0/16" for example. The values don't have to be in the "10" range (mine were not).

    So, to get the VPN up in Jaunty, I did the following (in /etc/ppp/ip-up.d):

    Code:
    sudo pon vpn1
    sudo ./route-traffic
    Edit: See post #4 below for an important update to this post ...
    Last edited by SabreWolfy; April 26th, 2009 at 03:50 PM.

  2. #2
    Join Date
    Jun 2007
    Beans
    29

    Re: PPTP VPN in Jaunty and Intrepid

    this is really lame

    i to cannot get the pptp vpn network manager plugin to work

    it gives no feedback as to what is happening.. sometimes coming up with failed messages

    ive been coming accross a few things that just arn't working in jaunty and have been regressions.. what is up with this? i suppose it is the nature of foss software but man it eems like things go 1 step forward 3 steps back

  3. #3
    Join Date
    Apr 2008
    Beans
    275
    Distro
    Ubuntu 10.04 Lucid Lynx

    Arrow Re: PPTP VPN in Jaunty and Intrepid

    PPTP VPN worked for me in Hardy but not since. The scripts presented in my first post above are working well for me now. Hardly an ideal solution though -- it's such a pity that a great OS like Ubuntu which is meant to be a serious competitor to the established ones, is brought down by silly issues like this -- having to drop to a command line and hack away at scripts to establish a VPN connection! There IS a PPTP PVN plugin, there IS a network manager, bugs HAVE been reported since Hardy, etc. It irritates me because it is bad for Ubuntu and will turn people away. The vast majority of users are not going to have the time or inclination to wade through my first post and hack away at config files in order to establish a VPN connection. They'll just ditch Ubuntu as a half-baked effort and return to other OS's which "just work". It's only the "techies" who have time and inclination and interest to play and hack to get stuff to work. The average user needs it to work. I've been following the problems with PPTP VPN since Intrepid. Nothing has changed it seems for Jaunty. At least a fairly simple work-around does exist, as I have explained above. I'm no expert on PPTP or VPN at all. I know there are different kinds like Cisco and OpenVPN, etc. and I don't really know the differences. All I know is that to get my PPTP VPN to work in Jaunty, I have to run those little scripts. In Hardy, I clicked on the Network Manager plugin, followed the wizard there and it worked. No problems. The file that is exported by that plugin is not readable by later versions in Intrepid and Jaunty. Bugs for this have been filed ages ago. Maybe in Karmic ...
    Last edited by SabreWolfy; April 26th, 2009 at 02:11 PM.

  4. #4
    Join Date
    Apr 2008
    Beans
    275
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking Re: PPTP VPN in Jaunty and Intrepid

    Update: I've spent the last few hours using my PPTP VPN connection in Jaunty, as described in the original post (#1 above). However, I was experiencing a very strange problem. When I attempted to paste a URL into the remote ssh terminal, only the first few characters would appear and then the connection would hang. The connection would also hang when I attempted to generate "large" amounts of traffic, such as when taking a long 'ls' or 'cat'ting a large file. Some searching led me here, which reminded me that I needed to set the mru and mtu values (which were present in the exported settings file from Hardy). I don't know what values these should really have, but the following worked for me. Edit the vpn1 file mentioned earlier and add:

    Code:
    mru 1412
    mtu 1412
    Worked for me!
    Last edited by SabreWolfy; April 26th, 2009 at 03:51 PM.

  5. #5
    Join Date
    Apr 2009
    Beans
    1

    Lightbulb Re: PPTP VPN in Jaunty and Intrepid

    Hi everyone,

    I found a way to make it work in Jaunty (at least for me ...).
    - When you configure the VPN connexion, go to the "advanced" settings"
    - Uncheck "EAP" at the top
    - check the "mppe" parameter
    - Try to connect to your microsoft VPN server, i should work now

    I hope this trick will help you out there ...

  6. #6
    Join Date
    Jun 2007
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PPTP VPN in Jaunty and Intrepid

    Quote Originally Posted by virkang View Post
    Hi everyone,

    I found a way to make it work in Jaunty (at least for me ...).
    - When you configure the VPN connexion, go to the "advanced" settings"
    - Uncheck "EAP" at the top
    - check the "mppe" parameter
    - Try to connect to your microsoft VPN server, i should work now

    I hope this trick will help you out there ...
    Doesn't work for me. I get the "secrets" error message.

    Any fresh ideas to make the network-manager work properly ?

  7. #7
    Join Date
    Nov 2006
    Location
    Kalmar
    Beans
    17
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: PPTP VPN in Jaunty and Intrepid

    Quote Originally Posted by virkang View Post
    Hi everyone,

    I found a way to make it work in Jaunty (at least for me ...).
    - When you configure the VPN connexion, go to the "advanced" settings"
    - Uncheck "EAP" at the top
    - check the "mppe" parameter
    - Try to connect to your microsoft VPN server, i should work now

    I hope this trick will help you out there ...
    Thank you so much for this tip! I had almost lost hope of getting my vpn connection to work again

  8. #8
    Join Date
    Feb 2007
    Beans
    164
    Distro
    Ubuntu 6.10 Edgy

    Re: PPTP VPN in Jaunty and Intrepid

    Quote Originally Posted by virkang View Post
    Hi everyone,

    I found a way to make it work in Jaunty (at least for me ...).
    - When you configure the VPN connexion, go to the "advanced" settings"
    - Uncheck "EAP" at the top
    - check the "mppe" parameter
    - Try to connect to your microsoft VPN server, i should work now

    I hope this trick will help you out there ...
    Thanks so much this did the trick. Also for me if anyone else is like I was: You need to make sure under the VPN tab that 'Available to all users' is NOT checked. This made weird errors for me that removed all authentication information and wouldnt connect.

    I also have to agree with the above poster that stated this was just sad. A simple pptp VPN connection should NOT be hard to configure. I know pptp is an MS thing but it's still pretty common.
    I pronounce You-Buntu however I want.

  9. #9
    Join Date
    May 2007
    Beans
    59

    Re: PPTP VPN in Jaunty and Intrepid

    Quote Originally Posted by SabreWolfy View Post
    This worked for me. Use at your own risk. YMMV. Edit: See post #4 below for an important update to this post ...

    I've bleated previously here and on Launchpad about how PPTP VPN worked perfectly under Hardy and was broken under Intrepid and Jaunty. For me, this was a "deal-breaker" because I need PPTP VPN access. I have not upgraded my desktop Hardy machine for this reason. I did upgrade my laptop to Intrepid and now to Jaunty and got around the problem by using PPTP VPN in a Xubuntu Hardy VirtualBox.

    I've spent the evening looking at this again and I've managed to get PPTP VPN working on my Jaunty laptop. I'm not a PPTP or VPN expert by any means.

    I used this post as starting point, so thanks to kryptoz. The problem as I can see it is that Network Manager 0.7 (Intrepid and Jaunty) and the associated PPTP plugin are broken. Under Hardy (Network Manager 0.6.6) everything works. There are many posts detailing the myriad problems with Network Manager 0.7. However, using the Network Manager applet is simply a front-end to calling PPTP and PPPD which actually make the connection (I think).

    My solution does not involve the Network Manager applet at all. The connection is established by calling PPPD. The pptp-linux and ppp (for pppd) package must be installed and the pptpd package as well (I think).

    1. Add the following to /etc/ppp/chap-secrets:

    Code:
    Username   PPTP   Password   *
    2. Create /etc/ppp/peers/vpn1. The 'peers' folder may be owned by group 'dip' so get around that by adding yourself to the group (I have no idea if this is a good solution, but it worked). Add the following to the vpn1 file:

    Code:
    pty "pptp remote.gateway.address.here  --nolaunchpppd"
    name Username
    remotename PPTP
    require-mppe-128
    file /etc/ppp/options.pptp
    ipparam vpn1
    3. Edit the options.pptp file as required. I commented out the 'refuse-chap' and 'refuse-mschap-v2' lines.

    4. Establish the VPN connection with:

    Code:
    sudo pppd call vpn1
    or

    Code:
    sudo pon vpn1
    5. Drop the connection when you're done with:

    Code:
    sudo poff vpn1
    That establishes a VPN connection but I could not get any traffic through it. Therefore, create '/etc/ppp/ip-up.d/route-traffic' as follows. I don't know why the file needs to have that name or be located in that folder, because it does not appear to be executed automatically. Thanks to this site for this information:

    Code:
    #!/bin/bash
    NET="10.0.0.0/8"
    IFACE="ppp0"
    route add -net ${NET} dev ${IFACE}
    Make the file executable.

    Replace the "10.0...." address with the range of addresses you need to access on your remote machine. For me, this was the same range as that which I originally included when setting the VPN up in Hardy. It may look like "10.2.0.0/16" for example. The values don't have to be in the "10" range (mine were not).

    So, to get the VPN up in Jaunty, I did the following (in /etc/ppp/ip-up.d):

    Code:
    sudo pon vpn1
    sudo ./route-traffic
    Edit: See post #4 below for an important update to this post ...
    Thanks a lot to sabrewolfy for this nice solution, I've got it working fine ONLY after I used this method, all the other methods I've found around didn't get me connected to my MS VPN until I tried this one!

    I allowed myself to improve it a little bit adding some more custom stuff for it to be easier to work, always following the example given on the original howto.

    For a person like me, that has a lot of routings to be set to the VPN connection it can be a little tedious to do NET1, NET2, NET3 .... NET20!
    and then a command for each one, so I used an array where all I need is to put every net I want to route, and to change it is as simple as adding or removing a line from the array, always keeping the same format.
    So here's the routing script
    This is the routing script I've wrote
    Create '/etc/ppp/ip-up.d/route-traffic'
    Code:
    gksu gedit /etc/ppp/ip-up.d/route-traffic
    Paste this code and save the file
    Code:
    #!/bin/bash
    IFACE="ppp0"
    NETWORKS=(
    "10.1.0.0/24"
    "10.2.0.0/24"
    "10.3.0.0/24"
    "192.168.123.0/24"
    )
    
    for NET in "${NETWORKS[@]}"
    do
      route add -net $NET dev $IFACE
    done
    
    exit 0
    Make it executable
    Code:
    sudo chmod +x /etc/ppp/ip-up.d/route-traffic
    I've also created a "on/off toggle" script that will connect to the VPN if is disconnected and disconnect if connected.
    Create the file '/usr/local/bin/vpn1'
    Code:
    gksu gedit /usr/local/bin/vpn1
    Paste the following code and save the file
    Code:
    #!/bin/bash
    
    VPN=vpn1
    
    if [ ! "$(pidof pppd)" ]
    then
      sudo pon $VPN
      zenity --info --text="Connected to $VPN" --no-wrap
    else
      sudo poff $VPN
      zenity --info --text="Disconnected from $VPN" --no-wrap
    fi
    Make it executable
    Code:
    sudo chmod +x /usr/local/bin/vpn1
    Now you can create a launcher on desktop if you like, right click on desktop then "Create Launcher"
    Fill the fields as shown here:

    Chose any icon you want and save it.
    Now you'll be able to double click on the desktop icon to connect/disconnect from the VPN
    Hope this helps
    Ziv
    Attached Images Attached Images
    Last edited by zivley; September 26th, 2009 at 10:23 AM.

  10. #10
    Join Date
    Apr 2008
    Beans
    275
    Distro
    Ubuntu 10.04 Lucid Lynx

    Wink Re: PPTP VPN in Jaunty and Intrepid

    Quote Originally Posted by zivley View Post
    <snip>
    @zivley: I'm glad it worked you and thanks for the improvements, especially the last section!
    Last edited by SabreWolfy; August 12th, 2009 at 10:28 PM.

Bookmarks

Posting Permissions

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