Friday, 11 May 2012

Connecting to a VPN from the command line in Linux Mint / Ubuntu

Set up the VPN using the Network Manager applet, then open a Terminal. The command to connect to a VPN is:
 nmcli con up uuid <your-uuid-here> 

To find out the UUID of the VPN connection, use:
 nmcli -p con list

The command to disconnect from a VPN is:
 nmcli con down uuid <your-uuid-here>

1 comment:

  1. #!/bin/bash
    #Use this script for automatic VPN Connection on startup for example:
    UUID=`nmcli -p con list |& grep -Po 'Private Internet Access SSL \K.*?(?= )'`

    nmcli con up uuid "$UUID"

    ReplyDelete

Please leave a comment if you find this blog helpful or interesting! I'd love to hear from you!