Skip to content

{ Monthly Archives } September 2007

Network Manager – OpenVPN, DNS Domain support

My new job uses OpenVPN to provide secure access to their private network. They also make heavy use of the dns domain search so that you only have to type “wiki” to get to their wiki. It turns out that the Open VPN plugin for network manager ignores the “dns-domain” setting, this means I have to manually change /etc/resolv.conf (to add the needed “search” section) after every connection.

This annoyed me enough that I have developed a small patch for the plugin which fixes support. I’ve submitted the patch to Ubuntu, hopefully it will get included soon. In the meantime I have attached the patch and the deb for Ubuntu Gusty.

Edit: This patch has been included in Ubuntu Gusty!

Network Manager – Autostart VPN

UPDATE: Dorian Scholz writes in the comments; There is now a command line tool nmcli which can interact with the nm-applet and Network Manger directly. Connecting to a VPN is as easy as: nmcli con up id NAME_OF_THE_VPN

Recently I started a new job, to get my laptop on the network I first connect to their wireless LAN and then VPN into the network. Network Manager makes this fairly easily, it will automatically try and associated with the wireless network, I then have to start the VPN connection manually.

This wouldn’t be a problem if I only had to do it once or twice a day. However, wireless being wireless, drops out 4-5 times a day. While, Network Manager will automatically reassociated, I have to manually reconnect to the VPN which is a pain.

To fix this I have developed two small scripts, the first is a small shell script which will automatically call a command when connecting to certain wireless networks (/etc/NetworkManager/dispatcher.d/02runcmd). The second is a little Python script which will tell Network Manager to connect to a VPN from the command line (/usr/local/bin/nm-startvpn). When you combind these two, you get auto VPN connection goodness, yay!!

If people find this useful I might put together a config utility and properly package them.