Using OpenVPN with nmcli on Debian by ~glorifiedgluer
-
Install
openvpn
and theNetworkManager
package$ sudo apt install openvpn network-manager-openvpn
-
Import the configuration file with
nmcli
(note that your connection will have the same name as the file, in this case, it will be calledclient
)$ sudo nmcli connection import type openvpn file client.ovpn
-
Append the following to
/etc/NetworkManager/NetworkManager.conf
[ifupdown] managed=true
-
Restart
NetworkManager
.$ sudo systemctl restart NetworkManager
-
Enable this connection only for resources on its network and bring the connection up.
$ sudo nmcli connection modify client ipv4.never-default true $ sudo nmcli connection up client