Managing OpenVPN with Network Manger
Last modified on July 24, 2026 • 3 min read • 514 wordsI just switched back from MacOSX to Ubuntu for work.

sudo apt-get install network-manager-openvpn network-manager-openvon-gnome. Then you go to the Network Manager via the icon in the menu bar on the top right of your Desktop. Below all the available wireless networks, there is an entry “VPN Connections”. Follow “VPN Connections” -> “Configure VPN” -> “Add” -> “Import a saved VPN configuration” -> “Create”. Then select the “openvpn.conf” from the downloaded and extracted files. After that, fill in the rest of the dialog box: User name, Password. For the CA Certificate, select the “HY-vpn-CA.pem” file from the downloaded files (you should have put it first somewhere safe, e.g. to “/etc/openvpn”).One problem that people are complaining about is the fact that the import does not honor the “redirect-gateway def1” directive and as a consequence you won’t be able to connect anywhere (I guess this is due to the Network Manager using dnsmasq and dnsmasq is apparently not smart enough to realize that it should send the queries somewhere else now). That’s why people are complaining that Network Manager doesn’t work to route all traffic via the VPN network. The box that you need to uncheck for this to work is well hidden: It’s in the connection editor dialog under the IPv4 Settings tab -> Routes (at the bottom right) -> “Use this connection only for resources on its network”. Why on earth do they have to call it in a way that nobody understands its meaning? Why not to call it “Do not route all traffic through this VPN connection”? I also had to check the box that said “Ignore automatically obtained routes”, although I don’t know why…As usual, setting up the OpenVPN sucks and the important tunneling back of VPN traffic needed to be added manually on the OpenVPN server:iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADEI did it by making an additional file called openvpn2 in the /etc/network/if-up.d/ directory with the following content:#!/bin/shiptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADEOf course you can still start and stop the VPN via the command line. However, since systemd, the password entry is not straightforward. When you execute sudo systemctl start openvpn.service you need to execute (e.g. in another terminal) sudo systemd-tty-ask-password-agent and enter your password there. That’s clearly a kludge until they get a decent password agent…