Getting the VPN to work on NetworkManager/Dapper Drake

1 minute read

UPDATE - September 15 - thanks to ‘Ed’, I have it all working. Please see the comments for the answer…

UPDATE - August 14 - the VPN package linked below doesn’t seem to update resolv.conf, so I stopped using it and went back to vpnc from the command line. Please do leave a comment if you’re able to get all this working properly!

As I’ve previously mentioned, I’m running Ubuntu Dapper Drake on my laptop. Everything has been working just dandy since I recovered from my hard disk crash, except for one minor annoyance: the version of NetworkManager in Dapper Drake doesn’t do VPN.

I’ve been using the command line vpnc to connect, which works ok, except that, when the DHCP lease expires, NetworkManager overwrites the VPN’s version of /etc/resolv.conf, so I have to either keep a backup /etc/resolv.conf to copy back, or just restart the vpn.

I finally got round to googling for an answer tonight and (on this page) found a VPN package for NetworkManager on Dapper. It seems to work fine. The one niggle was that, after configuring the VPN connection in nm-applet, I had to restart NetworkManager, but that’s a one-time thing.

Roll on Edgy Eft!




I too am dying to figure out the answer to this. Been searching all over for people with the same problem. I made a quick hack to /etc/dhcp3/dhclient-script to add a ‘return’ statement at the top of the make_resolv_conf after I start up my vpn. This seems to stop dhcp from updating the resolv.conf. Of course whenever I get offline and need to acquire an IP address from a DHCP server, I need to comment out the ‘return’ statement. Not optimal at all!


I think I solved our problem. Install resolvconf. apt-get install resolv.conf I noticed that the /etc/ppp/ip-up.d0dns-up script had a comment that said use resolvconf if it is available. A quick search on resolvconf shows that it helps manage the resolv.conf entries. Now, the resolv.conf doesn’t get rewritten. :D Big smile


I tried Ed's suggestion, but, unfortunately, name resolution seemed to be very slow. The reason is that vpnc on Ubuntu names its interface vpnlink, rather than the traditional tun0. /etc/resolvconf/interface-order contains entries for the usual interfaces (ath*, eth*, tun* etc), but does not mention vpnlink.

Adding vpnlink to /etc/resolvconf/interface-order just after the tun* entry seems to fix everything. Hurrah - at last - it all works!

Leave a Comment

Your email address will not be published. Required fields are marked *