April 22, 2008 · Networking · Email This Post

Sponsored Link
This tutorial will explain how to Connect to Windows VPN server (PPTP) with Ubuntu Gutsy.Ubuntu makes it simple to connect to a Microsoft Windows VPN server at your workplace with NetworkManager and the pptp plugin.

Install PPTP Using the following command

sudo aptitude install network-manager-pptp

killall nm-applet

sudo /etc/init.d/dbus restart

nm-applet --sm-disable &

The above command do the following

install network-manager-pptp

restart NetworkManager daemon

restart nm-applet and begin configuring

If you are using kubuntu you need to install the following extra package

sudo aptitude install gnome-network-manager

Configure VPN

After restarting NetworkManager and nm-applet, a single click on the nm-applet should reveal a new option, VPN Connections.

Follow the menu, and select Configure VPN then Add a new connection.

Click Forward to begin the configuration. Go ahead and name your connection, then enter the IP address or DNS hostname of the VPN gateway under the Connection tab.

Next, move to the Authentication tab and activate Refuse CHAP.

At this point, the basic configuration is complete. I like to add one more step, however, to ensure that not all of my traffic is routed over the VPN. This can be detrimental for performance. If you’d rather limit your VPN traffic to a specific subnet, go ahead and execute the following:

Under the Routing tab, disable Peer DNS through tunnel (if desired) and enable the option to only use VPN connection for these addresses and enter your network subnet. If the machines on your network use addresses like 192.168.100.X, use something like the following

That’s it You’re done. To connect to the VPN, click the NetworkManager applet, and follow the menus to your newly configured connection. Enter your username, password, and domain, and you should be connected to your VPN server.

Sponsored Link

Incoming search terms:

Related posts

20 Comments to “Howto Connect to Windows VPN server (PPTP) with Ubuntu 7.10 (Gutsy Gibbon)”

  1. Alex Akass says:

    I am connected to a windows server, I can ping the servers but not explore there contents, can any one help!!

    [Reply]

  2. Webmin says:

    I have tried this for Cisco VPN and it only works with gvpnc viewer. Cant get it to work with nm-applet. Any ideas?

    [Reply]

  3. @Alex: have you tried to explore it by hostname or by IP address?

    @webmin: this is from network manager home page:
    NetworkManager has pluggable support for VPN. There is support for vpnc at the moment. Support for other vpn clients is welcomed.

    NetworkManager makes deployment of VPN easy. It supports Cisco .pcf files, so administrators may simply distribute .pcf files to users. The user is able to double click the .pcf file and NetworkManager will import the correct settings for the VPN.

    Additionally, NetworkManager can export VPN connections to a .pcf file. Simply create a network in the VPN Connections menu, and then click on the Export button.

    [Reply]

  4. Webmin says:

    Working well here now :)

    I just hope it is possible to make the vpn client auto-connect withouth prompting for password when nm-applet is connected to any given network. And auto reconnect when connectivity is lost and regained. That would solve a lot of user related problems at my company :)

    [Reply]

  5. Cameron says:

    I am trying this on my Asus Eee, with eeeXubuntu installed on it. My school has a VPN I would like to connect to. However, I am getting the same issue as I have always gotten, and that is when I put in the first command, to install network-manager-pptp, terminal prompts me to insert the Xubuntu CD. Thats a little difficult when you dont have a cd drive in your laptop. Should it be asking for this in the first place? Thanks for any help. -Cameron

    [Reply]

  6. MiC says:

    @ Cameron
    you should comment out the line that search for cdrom inside /etc/apt/sources.list (gksudo gedit /etc/apt/sources.list) and then update packages list with the command “sudo apt-get update”

    [Reply]

  7. Cameron says:

    Worked! Thanks a lot for your help.

    [Reply]

  8. Phil says:

    Hi!
    As I find the network-manager rather inconvienient for roaming and using different wifi networks, I switched to WICD [wicd.sourceforge.net]. It is better in many ways, but it cannot (yet) handly VPNs. Is there another way to connect to PPTP VPNs without network-manager?
    Help is greatly appreciated!
    Thank you!

    [Reply]

  9. Stas says:

    The extra package for Kubuntu is misspelled: it is network-manager-gnome.

    [Reply]

  10. Stas says:

    @Phil

    I do not know of an alternative GUI tool, but here is an example how to connect to VPN using command line :

    – Install package pptp-linux

    – Create file /etc/ppp/peers/YOUR_COMPANY with the this content:
    pty “pptp YOUR_VPN_GATEWAY –nolaunchpppd”
    debug
    nodetach
    logfd 2
    noproxyarp
    ipparam YOUR_COMPANY
    remotename YOUR_COMPANY
    name YOUR_DOMAIN_OR_SERVER_NAME\\YOUR_VPN_LOGIN
    require-mppe-128
    nobsdcomp
    nodeflate
    lock
    noauth
    refuse-eap
    refuse-chap
    refuse-mschap

    – add to /etc/ppp/chap-secrets:
    YOUR_DOMAIN_OR_SERVER_NAME\\YOUR_VPN_LOGIN * YOUR_VPN_PASSWORD *

    – Create file /etc/ppp/ip-up.d/add-subnet with content similar to:
    #!/bin/bash
    [ "$PPP_IPPARAM" = "YOUR_COMPANY" ] || exit 0
    route add -net 192.168.100.0/24 gw $PPP_LOCAL

    In the above line, adjust subnet values (192.168.100.0/24) if needed

    – Make /etc/ppp/ip-up.d/add-subnet executable

    – Connect to VPN:
    sudo pon YOUR_COMPANY
    To disconnect, press Ctrl+C or close the terminal.

    – If you do not want to see VPN connection debug output, in file /etc/ppp/peers/YOUR_COMPANY delete 3 lines:
    debug
    nodetach
    logfd 2

    In this case, “pon YOUR_COMPANY” will run as a background process. Use “poff YOUR_COMPANY” to disconnect.

    Hope this helps.

    [Reply]

  11. Stas says:

    @Alex

    I have the same problem with Windows shares, I cannot explore them. However, if you know your the name of a shared folder, you can mount it using command line:
    mount -o username=DOMAIN_LOGIN,password=DOMAIN_PASSWORD //SERVER/FOLDER /root/shared_folder

    [Reply]

  12. ???? says:

    Make it after connection:

    sudo route add default dev ppp0

    Sorry for my poor english=)

    [Reply]

  13. @Phil

    Kvpnc is what you want. It sets configurations up several VPN types including Cisco and PPTP in a very dial-up networking style of interface. You still have to install the underlying software for the VPN protocol.

    [Reply]

  14. Ravi says:

    Just a quick question might seem annoying but after i did all the steps listed in this page..i found that when i close my terminal window my network manager disappears too..Is there anything I can do to get around this?
    R

    [Reply]

  15. Pablo says:

    Well, i used nm to connect to several pptp servers, say windows and linux ones.
    What i just can’t do, is route only traffic for the destination lans through the
    the tunnel, all traffic goes through the vpn.
    So i can’t browse internet, read mail, etc….

    I see there are two options to avoid using the dns on the “other side”
    1. PPP Options (leave unchecked)
    2. the one mentioned here, in Routing. Here i just set the network 10.0.200.0/24
    and check Only use VPN connection for these addreses.

    Any hints ?

    Pablo .

    [Reply]

  16. c_workaholic says:

    Make sure you are in “Roaming Mode”.

    I was on “Static IP” mode and it did not work.

    I don’t know how it is related.

    [Reply]

  17. I hope this doesn’t come as too n00bish but the VPN connection works and everything is great except the connection seems ungawdly slow. Whether I am using HTTP, FTP or Subversion, any communication seems slower than dialup when connected to the VPN through NM.

    I know that I did not change the “Routing” stuff you mentioned because quite honestly I have no idea what my subnet is when connected to the VPN or any of that. That said, could the fact that I did not make the changes in “Routing” be the cause of the unusually slow transfer?

    [Reply]

  18. Daniel Pedersen says:

    I have the exact same issue as Robert dreadfully slow connection, so i really hope someone can help us. Using Windows i don’t have that problem, so it is my Ubuntu configuration which causes it.

    Thx.
    Daniel

    [Reply]

  19. For the record, changing the routing information had no effect on the speed of the connection. In Windows, the connection is fine. On Ubuntu, not so much.

    [Reply]

  20. Stamatis says:

    Hello,

    It seems I can’t make this work. I am new with this so please help me out.
    After setting up the VPN connection, when I try to start it asks for
    login/passwd and I get these warnings:

    ** (nm-ppp-auth-dialog:19091): WARNING **: couldn’t connect to daemon at $GNOME_KEYRING_SOCKET: /tmp/keyring-hdzrCK/socket: Connection refused
    ** (nm-ppp-auth-dialog:19091): WARNING **: couldn’t communicate with gnome keyring daemon via dbus: The name org.gnome.keyring was not provided by any .service files

    Then after entering domain/login/passwd I get a connection refused and these msgs:

    ** (nm-ppp-auth-dialog:18333): WARNING **: Couldn’t store authentication information in keyring, code 2
    ** Message: Activating VPN connection ‘ICS-FORTH’.

    Any help will be appreciated.

    Thanks,
    Stamatis

    [Reply]

Leave a Reply