Free DNS provides easy shared DNS hosting & URL forwarding

Tuesday, July 6, 2010

Working out OpenVPN with Network Manager in Lucid Lynx

For two years now, I've used OpenVPN to connect to a server where I upload some of the stuff I work on. Until now I always started OpenVPN from the terminal, because I didn't manage to get it working from the Network Manager in the last 4 Ubuntu versions.
Last weekend, I had some spare time and I installed Lucid Lynx on my laptop. I tried (again) to get OpenVPN working with Network Manager. As usually it failed, although I was pretty sure everything I did was correct.
So I decided to import my existing openvpn configuration file and export it back to see if there's something different. After doing this, I've noticed a few difference, but most of them were just due to syntax. However, two lines looked more interesting:

user openvpn
group openvpn
I've checked and saw that with these lines in the configuration file, the openvpn connection failed to start even from the terminal. Therefore, I did the following:
  1. create the openvpn group as a system group using

    groupadd -r openvpn
  2. assign the openvpn group to the directory (and files) that holds my openvpn key and certificates (mine and server's):

    chgrp -R openvpn openvpn_folder
  3. assign group read permissions to the openvpn settings directory and remove permissions for others:

    chmod g+r,o-rwx openvpn_folder
After these steps, the OpenVPN connection started from the Network Manager without problems (note that it's recommended route only traffic for that network through that connection).