I'm trying to set up two different machines with the same VPN client configuration. Both machines run Ubuntu 20.04, one is without X (Machine B).
Here my NetworkManager configuration file that works on machine A:
[connection]
id=myVPN
uuid=blabla-blabla-blabla
type=vpn
autoconnect=false
permissions=user:mark:;
[vpn]
IKE DH Group=dh2
IPSec ID=myID
IPSec gateway=myGateway
IPSec secret-flags=1
Local Port=0
NAT Traversal Mode=natt
Perfect Forward Secrecy=server
Vendor=cisco
Xauth password-flags=1
Xauth username=myUser
ipsec-secret-type=save
xauth-password-type=save
service-type=org.freedesktop.NetworkManager.vpnc
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
[proxy]
I copied this file to machine B and issued:
$ sudo nmcli connection import type vpn file myVPN.nmconnection
Error: failed to find VPN plugin for vpn
I checked for packages on both machines:
Machine A
$ dpkg -l | grep network-manager
ii network-manager 1.22.10-1ubuntu2.2 amd64 network management framework (daemon and userspace tools)
ii network-manager-config-connectivity-ubuntu 1.22.10-1ubuntu2.2 all NetworkManager configuration to enable connectivity checking
ii network-manager-gnome 1.8.24-1ubuntu3 amd64 network management framework (GNOME frontend)
ii network-manager-openvpn 1.8.12-1 amd64 network management framework (OpenVPN plugin core)
ii network-manager-openvpn-gnome 1.8.12-1 amd64 network management framework (OpenVPN plugin GNOME GUI)
ii network-manager-pptp 1.2.8-2 amd64 network management framework (PPTP plugin core)
ii network-manager-pptp-gnome 1.2.8-2 amd64 network management framework (PPTP plugin GNOME GUI)
ii network-manager-vpnc 1.2.6-2 amd64 network management framework (VPNC plugin core)
ii network-manager-vpnc-gnome 1.2.6-2 amd64 network management framework (VPNC plugin GNOME GUI)
Machine B
$ dpkg -l | grep network-manager
ii network-manager 1.22.10-1ubuntu2.2 amd64 network management framework (daemon and userspace tools)
ii network-manager-config-connectivity-ubuntu 1.22.10-1ubuntu2.2 all NetworkManager configuration to enable connectivity checking
ii network-manager-openvpn 1.8.12-1 amd64 network management framework (OpenVPN plugin core)
ii network-manager-pptp 1.2.8-2 amd64 network management framework (PPTP plugin core)
ii network-manager-vpnc 1.2.6-2 amd64 network management framework (VPNC plugin core)
As you can see, they are identical except the GUI packages that I don't need on the headless machine.
Is there any other packages (not from network-manager-*) that I need to install on Machine B?
UPDATE
Things getting worst.
On Machine A, where the connection above lives and runs fine I issued the following commands:
$ nmcli connection export myVPN ~/export-myVPN
$ nmcli connection import type vpn file ~/export-myVPN
Error: failed to find VPN plugin for vpn
Wow! It cannot import the file it has just exported on the same machine!
The help says:
$ nmcli connection import --help
Usage: nmcli connection import { ARGUMENTS | help }
ARGUMENTS := [--temporary] type <type> file <file to import>
Import an external/foreign configuration as a NetworkManager connection profile.
The type of the input file is specified by type option.
Only VPN configurations are supported at the moment. The configuration
is imported by NetworkManager VPN plugins.
So I also tried with type VPN
with no chance.
I don't want to believe I must install Gnome only to configure the VPN using the GUI.
UPDATE 2
I spent several hours but I was not able to import the file even on the same machine that exported it (with full Gnome installed).
So I did the following - ugly - workaround:
- install
gnome-session gdm3 network-manager-gnome
- from the GUI frontend import the very same file I was trying to import using
nmcli
- remove the above packages
- run the new VPN connection using
nmcli