Created
October 26, 2023 08:40
-
-
Save goromlagche/b67c2d796e901de1e8c71334b66401bc to your computer and use it in GitHub Desktop.
setup vpn using nmcli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nmcli connection import type openvpn file your-connection.ovpn | |
nmcli connection modify your-connection +vpn.data username=your-user-name | |
nmcli connection modify your-connection ipv4.never-default true | |
nmcli connection up your-connection passwd-file passwd-file | |
# To list all VPN connections | |
nmcli connection show --active | grep vpn | |
# To connect to the VPN | |
nmcli connection up your-connection passwd-file passwd-file | |
# content of passwd-file | |
# ---------------------- | |
# vpn.data.username=your-user-name | |
# vpn.secrets.password=your-password | |
# ---------------------- | |
# To disconnect from the VPN | |
nmcli connection down your-connection | |
# To delete the VPN connection | |
nmcli connection delete your-connection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment