4

I have a VPN that is working when I connect through my windows using L2TP, however when I set up my ubuntu with CLI its not working. I get the following error when I run

$ nmcli c up myvpn

Error output

Error: Connection activation failed: Could not find source connection.

What I've tried

  • disabled the firewall sudo ufw disable

  • created the vpn configuration with

nmcli connection add connection.id myvpn con-name myvpn type VPN vpn-type l2tp ifname -- connection.autoconnect no ipv4.method auto vpn.data "gateway = x.x.x.x, ipsec-enabled = yes, ipsec-psk = 0s"$(base64 <<<'psk***psk' | rev | cut -c2- | rev)"=, mru = 1400, mtu = 1400, password-flags = 0, refuse-chap = yes, refuse-mschap = yes, refuse-pap = yes, require-mppe = yes, user = username" vpn.secrets password=mypassword
  • NetworkManager is managing the following interfaces
user@ubunut:~# nmcli device status
DEVICE   TYPE      STATE      CONNECTION
eth0     ethernet  connected  eth0
docker0  bridge    connected  docker0
lo       loopback  unmanaged  --
  • list all NM connections: nmcli con
NAME             UUID                     TYPE      DEVICE
docker0          ef3eb3a8-c46e-434c-bfcb  bridge    docker0
eth0             fc920355-d18e-495a-b3ca  ethernet  eth0
myvpn            2b24ce55-98d3-4bc0-8b52  vpn       --
Ifupdown (eth0)  681b428f-beaf-8932-dce4  ethernet  --

Still I'm not able to connect and I'm stuck now. I don't know what else to do to make it work. Does anyone have any idea what the problem might be?

vato
  • 141
  • 1
  • 3

1 Answers1

0

nmcli usage :

  • list all NM connections: nmcli con
  • bring up VPN connection : nmcli con up id myvpn
  • bring down VPN connection: nmcli con down id myvpn

Where myvpn is the actual name of the VPN connection as listed in the nmcli con output.

Use nmcli con reload whenever a new VPN connection profile file (usually located under /etc/NetworkManager/system-connections/) has been created or has been edited, so Networkmanager will notice the change. Although it might not be needed with nmcli con add

You were using nmcli con up myvpn instead of nmcli con up id myvpn, the former requires the VPN connection's UUID.

For a bit of simplicity, you can use a clear text PSK instead of a base64 one starting with 0s.

  • 1
    Thank you for your comment. I'm still getting the same error when I use `nmcli con up id myvpn`. The list looks like this NAME UUID TYPE DEVICE docker0 ef3eb3a8-c46e-434c-bfcb bridge docker0 eth0 fc920355-d18e-495a-b3ca ethernet eth0 myvpn 2b24ce55-98d3-4bc0-8b52 vpn -- Ifupdown (eth0) 681b428f-beaf-8932-dce4 ethernet -- – vato Feb 08 '21 at 12:34