Connect to Windows VPN server (PPTP) with Ubuntu Gutsy
November 28, 2007
UPDATE – for VPN on Hardy Heron, see my new post here
Ubuntu makes it simple to connect to a Microsoft Windows VPN server at your workplace with NetworkManager and the pptp plugin. Luckily for us Ubuntu users, the right tools are just a couple of clicks or commands away. The first step is to install the network-manager-pptp package. I’ve broken this down into two sections: GUI and CLI installation methods, and Configuration.
Install PPTP with GUI (requires reboot)
Go to the Applications menu, then select Add/Remove… and enter pptp in the search bar.
There it is! Add a checkmark, and hit apply changes. Once the install has completed, reboot your machine and move on to the configuration portion of this guide.
Install PPTP CLI (no reboot required)>
Execute the following commands to:
- install network-manager-pptp
- restart NetworkManager daemon
- restart nm-applet and begin configuring
sudo apt-get install network-manager-pptp
killall nm-applet
sudo /etc/init.d/dbus restart
nm-applet --sm-disable &
Configure Your VPN
After rebooting or 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:
192.168.100.0/24
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 in business.
Leave comments below if the procedure was any different for you. I’ve tested this on Ubuntu Gutsy 7.10 32 bit and 64 bit.
Posted in
content rss
December 2nd, 2007 at 7:33 am
Thank you for good manual for beginners! It really works=)
December 4th, 2007 at 2:44 pm
In the very last step, you indicate ” Enter your username, password, and domain, and you should be in business.”
I do not see any where (in config or login) to enter Domain information.
Can you help?
Cheers,
T,
December 5th, 2007 at 11:43 pm
I think you want to try
DOMAIN/username
December 18th, 2007 at 1:51 pm
I only see “Manual Configuration” when I click on my network manager applet. I have definitely installed the vpn and pptp components, and have rebooted my machine. Can you think of a reason why I don’t see any VPN configuration options when I click network manager applet? Thanks!
December 18th, 2007 at 4:24 pm
Seth, if you’re on Kubuntu, you’ll need to install the gnome-network-manager package as well, otherwise I think you get symptoms like you describe. Are you Kubuntu or Ubuntu?
December 19th, 2007 at 11:06 am
Seth, I have read around that there is a bug filed out about network-manager-pptp… It’s only show out if you have at least one interface in dhcp… I can’t check out because i can’t set my interface to dhcp… So i use “pon” from command line
December 30th, 2007 at 7:40 am
Running Gutsy right here… VPN connection is a piece of cake with network-manager..
ubuntu makes Toppie very happy
December 31st, 2007 at 4:09 pm
To add to Cecco
Just make sure to enable roaming mode.
I had mine set to DHCP manually and it didnt show until I changed it to roaming mode
January 13th, 2008 at 6:13 pm
Wow, that was so easy! Thanks for writing some instructions for beginners like me!
January 14th, 2008 at 10:32 am
Great tutorial! I got connected!
Just one question. I also want to use vpn just for 1 ip adress. So i disabled dns through peer and enabled only use VPN connection for these addresses. But how do i know the number behind the /
i got 10.128.4.1/????
Thanks
January 14th, 2008 at 12:41 pm
Martin,
If you’re specifying a single IP address, you can leave off the /24 (or /xx) as it only denotes a subnet.
A single IP does not require a specified subnet, since you’re not specifying a range of IPs, just one machine. Cool?
– Mike
January 15th, 2008 at 3:10 am
sorry not cool
when i leave out the /xx my apply button gets disabled
January 15th, 2008 at 8:26 pm
Ah, no good! Looks like you can only specify a subnet. Better hope it’s a different private subnet than your own
In your case, Martin, I’d use 10.128.4.0/24 as well.
January 18th, 2008 at 6:06 pm
Martin, try 10.128.4.1/32
January 29th, 2008 at 3:50 am
Hi,
Thanks for the great tutorial some one like me who has used Ubuntu for few days.
I followed this exact steps in “Create VPN Connection” and finally how do you save the settings??, because I only got “Cancel” and “Back” buttons enabled.
I have Gusty.
Thanks,
Sujith
January 29th, 2008 at 6:24 am
Hi,
Thought more information on this is helpful for me to get a reply.
When I enable the option to only use VPN connection for these addresses, is when the Apply button disables itself. When I uncheck that, the Apply button enables.
I am confused, but hope someone will help me to get over this.
Thanks,
Sujith
February 2nd, 2008 at 7:30 am
Hi Sujith,
This is because you haven’t give up a ip-range, thus like this 192.12.10.0/24 or this 10.32.29.3/32 for one ip.
BTW I do have a new question for the group. Is it possible to make a second VPN connection at the same time in NM-Applet? Is there any workaround for this?
Cheers,
Chi
February 7th, 2008 at 6:12 am
Ta for the heads up – this is making the switch to Ubuntu MUCH easier as I am still needing to connect to Windows networks in order to support them.
February 8th, 2008 at 7:51 am
[...] short set of instructions over at tipotheday were [...]
February 9th, 2008 at 3:18 am
although PPTP vpn works great, I have problems with the openVPN… (wich connects but dont seem to have a DNS connection)
does this sound familiar to some?
February 13th, 2008 at 4:59 am
Hi,
I am using Kubunt 7.10, I followed the instruction given. But I encounter this error message:
“could not start the VPN connection due to a connection error.”
However, I can connect using my windows OS.
I am not sure where to log the error. Please advise. Thanks
February 15th, 2008 at 3:54 pm
is there a way to check the status of the vpn-connection?
I choose my vpn connection in the nm-applet, then I enter username and password but then nothing happens.
I’m sure my settings aren’t right but anyway, can’t I check status of my connection somehow?
February 16th, 2008 at 12:33 pm
I need to be sudo to get my openvpn connection to work. nm-applet does not ask me for my sudo password. Thoughts?
February 16th, 2008 at 7:10 pm
Yes, how DO we check on the status of the vpn connection? I have configured two different connections, both are PTPVPN but I don’t think they work. How do I know if I am connected, and if the connection is rejected, is there any reason provided?
February 17th, 2008 at 7:42 am
I use wireless, and when I am connected, I see an small lock combined with the signal strenght (NM-applet)
When rejected, I get an error message
February 17th, 2008 at 3:26 pm
Will this direct all internet traffic through the VPN? My ISP throttles bittorrent traffic, so I need to be able to allow BItTorrent to work through this VPN. IS there any special configuration that I would need, or should this do it all for me?
Thanks. I know this isn’t a forum, but if anyone has any ideas, I will really appreciate it.
-Ethan
February 17th, 2008 at 11:28 pm
You can disregard my previous post.
I set up the VPN, and as a result my bittorrent speeds went from a maximum of 22 Kb/s (though averaging around 4 Kb/s, and often going down to 0) to a maximum around 200 Kb/s, averaging 80-100.
So I think I answered my own question.
February 18th, 2008 at 10:13 pm
Thanks! This really works!
I want to set up a script which will connect to VPN automatically, sync some files and disconnect after that. Do you know the command to connect to VPN using commandline. I tried using the following command but it doesnt seem to work.
nm-ppp-auth-dialog -s org.freedesktop.NetworkManager.ppp_starter -n
I think I’m missing a variable needed to disable CHAP.
-Ashish
February 24th, 2008 at 4:42 pm
Thanks so much… I’ve tried several configurations and tutorials to get this to work… I’ve always fallen down somewhere around the connection… This connected first time… with no restarts.
Perfect.
- Jorj
March 5th, 2008 at 1:38 pm
Nice guide. Super simple, too, once you know what you are doing with the ubuntu tools. It Just Works (for me).
April 3rd, 2008 at 8:38 pm
I’ve been trying to get Ubuntu to work on the University of Exeter VPN for months now, and they don’t provide support for Linux. Racked my brains, read tutorials tried a whole lot of stuff. It was all solved in an instant with once sentence you wrote:
Next, move to the Authentication tab and activate Refuse CHAP
Ticked the box and I’m surfing as University of Exeter.
Thank you very much.
And this is all on the Hardy 8.04 beta.
April 3rd, 2008 at 8:41 pm
Tweedicus — glad to have helped
April 11th, 2008 at 12:05 pm
I am trying to get VPN working on Ubuntu 7.10. I installed network-manager-pptp package, and rebooted, but don’t get a VPN option when I open network setting. I only get the wired and modem connection options. Ideas??/
Steve
April 16th, 2008 at 1:40 am
thanks so much. i was at the point where i had everthing setup and could connect by routing was messed up so couldn’t browse the net via local gateway while connected to the VPN… i messed around with everything and finally followed this to enter “only use VPN Connection for these addresses” i had tried this and thought it was bugged… i was missing the /xx!
after even trying to manually configer and connect/disconnect and spending hours using PPTP ….i’m very happy to finally have it working. thanks
April 17th, 2008 at 6:38 am
Thanks. Worked liked a charm for me, but for all people facing this problem:
“could not start the VPN connection due to a connection error.”
I unchecked all the options under “Authentication” tab, and only then I was able to connect.
April 29th, 2008 at 11:35 pm
[...] Ubuntu Hardy Heron came out last week, and I thought I’d take a moment to do a new post about connecting to a workplace VPN that uses Windows Server’s built in PPTP ability. Not a lot has changed, so you can also refer to the older article here. [...]
May 2nd, 2008 at 11:19 am
I have same problem as Steve and Seth Ladd. No VPN connection option appears, only
“Manual configuration”…
May 17th, 2008 at 5:59 am
Installed ok, rebooted, created work VPN, selected, entered domain/username and password, click OK .. nothing, have tried checking/unchecking authentication options all do the same .. nothing. where can i check for error logs on this ?
June 16th, 2008 at 4:29 am
I have same problem as Steve: I installed network-manager-pptp package, and restarted dbus, but don’t get a VPN option when I open network setting. I only get the wired and modem connection options.
Single click on nm-applet doesn’t reveal VPN…
Ubuntu 8.04, Xubuntu 8.04.
June 16th, 2008 at 3:06 pm
I have same problem as others: don’t get a VPN option when I open network setting.
I am using a static IP on my wired (so not using roaming mode).
… ?
(Thanks for writing this tutorial, btw.)
June 16th, 2008 at 3:19 pm
roaming mode / static IP bug here:
https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/145107
June 17th, 2008 at 3:07 am
This all went well, however if I am using a 3g card with the vodafone drivers – the new VPN config that is created is greyed out and not available fot select – If I am on a wired/wireless network, it can be selected – is this because the 3g card is seen as a modem and how do I change it?
June 18th, 2008 at 2:30 pm
I have installed and configured. I am able to connect to PPTP, but it is very very slow. If I connect to the same PPTP server from Microsoft Windows, then it works well and I am able to work on the connection. While connected from ubuntu, it is really slow.
Any idea what is wrong? I am using 8.04 ubuntu
September 9th, 2008 at 8:36 am
I’ve been having no end of difficulty trying to get this to work on a variety of distros. Currently am using 8.04.1 LiveCD – and while i am able to configure through the network-manager, I don’t believe that it is truly connecting. If I go ->Network Manager Applet->VPN Connections configureVPN is enabled but Disconnect is greyed out. No option appears available to start (or attempt to start) the connect.
eh, help?
September 26th, 2008 at 12:52 pm
Hey,
I got my vpn-connection running. But when I connect it only asks me to type in my username and pwd.
Where can I actually get acces to the drive I want to go to?
I am very confused about this.
*hoping for help
November 4th, 2008 at 3:22 am
[...] http://tipotheday.com/2007/11/28/connect-to-windows-vpn-server-pptp-with-ubuntu-gutsy/ [...]
February 6th, 2009 at 10:01 am
I need to connect to my company’s vpn.
I have a pfx file for authentication. How do i connect to vpn using this pfx file?
any pointers would be appreciated..
TIA….
March 10th, 2009 at 1:56 pm
Hey All
I ‘m Beginner Ubuntu User , And I Want Run My VPN Connection ! I Make It But When I Start It ! OS Throws This Error : VPN Connect Failure,Could not start the VPN connection ‘Ubuntu VPN’ due to a connection error.
I Have A DSL Modem And In Windows OS My IP Is 192.168.1.100 And My Default Gateway Is 192.168.1.254 And DNS Is 85.15.1.10 And 85.15.1.12. So How Can I Fix My Problem In Ubuntu VPN Connection ! What Insert Into Under Connection Tab / Gateway And What Insert Into Under Routing Tab / Only Use VPN …
Please Help Me ! My VPN IP Is : 88.XXX.XXX.XXX
Please Help Me ! Please …
With Best Regards, 3rB3r
March 19th, 2009 at 1:50 pm
[...] to get a pptp to a VPN server running Microsoft Windows 2003 R2 i finaly found a solution. This article made me aware of a Network Manager pptp plugin, but it seems to have been changed a grate deal [...]
March 21st, 2009 at 6:27 am
I have the same problem that Tmanisaur said.
The option Network-applet->VPN Connections->MyVPNName is disabled, and I can not see any option to inform my login DOMAIN\username and password of VPN.
I already restarted my network with
sudo /etc/init.d/networking restart
Can anyone try to help me ?
April 22nd, 2009 at 8:02 am
emm… strange..