Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
Created September 7, 2021 11:39
Show Gist options
  • Save mvidaldp/32c60b2c75c1d836523888649bc32258 to your computer and use it in GitHub Desktop.
Save mvidaldp/32c60b2c75c1d836523888649bc32258 to your computer and use it in GitHub Desktop.
How to import, rename and delete an openvpn connection using a config file from terminal.
# import the new connection using the vpn config file you have
sudo nmcli connection import type openvpn file config-file.ovpn
# rename an old/current connection:
sudo nmcli connection modify connectionId connection.id differentConnectionId
# rename the new imported connection
sudo nmcli connection modify config-file connection.id newConnectionId
sudo nmcli connection modify newConnectionId connection.interface-name newConnectionName
# delete a connection
sudo nmcli connection delete id connectionId
# see current connections
sudo nmcli connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment