Commandline L2TP connection?

7,160

Alternatively you could use the NetworkManager CLI with the nmcli command.

  • list all NM connections: nmcli con
  • bring up VPN connection : nmcli con up id VPN-Connection-Name
  • bring down VPN connection: nmcli con down id VPN-Connection-Name

Where VPN-Connection-Name is the actual name of the VPN connection as listed in the nmcli con output.

If you're on the same computer you're already successfully connecting on via the GUI, that should be all you need. If you're on a different machine:

You'll need to copy the corresponding NetworkManager VPN connection profile file which is stored under /etc/NetworkManager/system-connections/ from the desktop Ubuntu to the computer you want to use the command-line.

To pickup the new VPN connection profile file (or even changes to that file if you edit it), issue the following:

  • nmcli con reload

Be sure to to install network-manager-l2tp, you won't need the GNOME GUI network-manager-l2tp-gnome package.

sudo apt install network-manager-l2tp resolvconf
Share:
7,160

Related videos on Youtube

KdgDev
Author by

KdgDev

Updated on September 18, 2022

Comments