Command line wins again

At work, we do VPN with PPTP.

The “easy” way

Since I have never before set up PPTP from Linux, I figured I would do it the “easy” way and install the NetworkManager plugin. However, that drug in some GNOME dependencies. (I normally use XFCE.) Worse, the NetworkManager plugin wasn’t showing up on the XFCE panel, so I installed the entire GNOME desktop in hopes of making it show up. Wow… 400 MB of fat.

After logging in to GNOME, configuring my VPN in NetworkManager, and clicking on it in the drop-down, … precisely nothing appeared to happen. After trying many things, I rebooted in frustration, and then the NetworkManager plugin was available to my XFCE panel also, so I tried that too. Still no feedback at all, and no VPN was configured.

After some searching, I learned about the NetworkManager command line tool, nmcli. With it, I could try to start the VPN, and hopefully see any error messages. Here’s what I got:

$ nmcli con up id myvpn
Error: No suitable device found: no active connection or device.

As it turns out, NetworkManager cannot start a VPN on a connection it does not “own”. This is a known limitation. And yes, my wired and wireless configurations are hard-coded in /etc. That works well for me, and I’d rather not change it.

The “hard” way

Rather than reconfiguring all my networking via NetworkManager (and possibly keeping all the GNOME packages), I decided to learn what’s really going on. Ends up, this is all I needed to configure my VPN:

$ pptpsetup --create MyVpn --server vpn.mycompany.com  --username My.Name --password SuperSecret --encrypt --start
$ ip route add dev ppp0

I’ve wrapped this up in some nice start/stop shell scripts. Lovely.

Final note: I’m not sure why, but if I specified my NT domain with --domain MYDOMAIN, the PPTP setup failed.

July 31, 2013
310 words


linux networking



ccoffing on GitHub

ccoffing on LinkedIn