Network Manager: Import OVPN config per CLI

I recently reinstalled my notebook because I switched from the standard Ubuntu 20.04 to the same version of Ubuntu MATE. I also had to re-establish my OpenVPN connection. So I downloaded the latest version of the OpenVPN config file and tried to use the import function in the GUI without success.

It is much easier to use the Network Manager CLI (nmcli):
Convert the config file to Unix format to be on the safe side:

apt install -y dos2unix
dos2unix [email protected]

Make sure the "openvpn" plugin for the network manager is installed:

apt install -y network-manager-openvpn

Import the configuration file:

nmcli import connection type openvpn file [email protected]

Tada:

 Connection "mow@mycompany" (41c98d04-4458-4576-9fb4-c134348cbc51) successfully added.

See you soon!

Mow