openvpn-config-splitter is a very simple CLI-tool I wrote in node.js. It does most of the hard work for you, but you’ll still have to import the configuration and possibly change a few settings. Here’s a step-by-step guide on how to get OpenVPN installed, integrated with the network manager in Ubuntu (or Debian, Linux Mint etc.) and how to get your configuration imported:
- Install OpenVPN along with the OpenVPN extensions:
sudo apt-get install network-manager-openvpn network-manager-openvpn-gnome
- Make sure you’ve got node.js installed (
apt-get install nodejs
), and runnpm install -g openvpn-config-splitter
(you might have to usesudo
to install globally). - Get your OpenVPN configuration file (ask your sysadmin if you’re not sure where/how) and put it somewhere you’ll find it, say
~/openvpn
- Run
ovpnsplit ~/openvpn/client.ovpn
(path to your configuration file) – after running this, you should be able to find a bunch of other files in the same folder (ca.crt
,client.key
and a few others). - Open the network manager (it varies a bit from distro to distro) – somewhere in there you’ll find an option to add a VPN connection. When it prompts you to choose a VPN connection type, select “Import a saved VPN configuration” from the dropdown (or find a different import option, somewhere) and browse to the folder you stored your configuration file in.
- Make sure you select the altered configuration file (it should be postfixed with
.split.ovpn
). - You’ll probably have to enter your username and password. Click save and try to connect!
If you run into a problem where you can only access resources on your organizations network, open up the VPN settings, go to “IPv4 Settings” and select “Automatic (VPN) addresses only“, then click on the “Routes” button. Check the “Use this connection only for resources on its network“-option and save the configuration. Disconnect, then reconnect. Hopefully you should be up and running!
If you have any issues reaching resources on your organizations network, you might have to set up one or more DNS-servers under the “IPv4 Settings”-tab, along with one or more search domains. Your sysadmin should be able to give you those settings, if needed.
Happy VPN’ing!