Openvpn files to nmcli connection

2022-11-12 1 min read Linux Networking

Openvpn files to nmcli connection

Many times you get openvpn file and when you want to connect to the VPN server, you have to start the vpn client from the cli. How you wish that this was added to NetworkManager so that you could connect to it with one click. If this is the case, then you can use these commands to do the same ane enjoy :)

1
2
nmcli connection import type openvpn file test.ovpn
nmcli connection modify test vpn.secrets 'password=mypass' vpn.user-name 'username'

You will need to modify few things in above command

Example Change to
test.ovpn Your openvpn config file name or full path if it is not in current folder.
mypass Your Vpn password
username Your Vpn username
comments powered by Disqus