NetworkManager 找不到 VPN 插件

NetworkManager 找不到 VPN 插件

我正在尝试设置两台具有相同 VPN 客户端配置的不同机器。两台机器都运行 Ubuntu 20.04,其中一台没有 X(机器 B)。

下面是我在机器 A 上运行的 NetworkManager 配置文件:

[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]

我将此文件复制到机器B并发出:

$ sudo nmcli connection import type vpn file myVPN.nmconnection
Error: failed to find VPN plugin for vpn

我检查了两台机器上的软件包:

机器 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)

机器 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)

正如您所看到的,除了无头机器上我不需要的 GUI 包之外,它们是相同的。

我需要在机器 B 上安装其他软件包(不是来自 network-manager-* 的)吗?

更新

情况越来越糟。在机器 A 上,上述连接正常且运行良好,我发出了以下命令:

$ nmcli connection export myVPN ~/export-myVPN
$ nmcli connection import type vpn file ~/export-myVPN
Error: failed to find VPN plugin for vpn

哇!它无法在同一台机器上导入刚刚导出的文件!

帮助中说:

$ 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.

所以我也尝试了,type VPN但没有成功。我不想相信我必须仅安装 Gnome 以使用 GUI 配置 VPN。

更新2

我花了几个小时,但即使在导出该文件的同一台机器上(安装了完整的 Gnome),我也无法导入该文件。

所以我做了以下丑陋的解决方法:

  1. 安装gnome-session gdm3 network-manager-gnome
  2. 从 GUI 前端导入我尝试导入的相同文件nmcli
  3. 删除上述软件包
  4. 使用以下方式运行新的 VPN 连接nmcli

相关内容