我正在尝试从 CentOS 7 连接到 VPN。我安装了 network-manager-l2tp (1.2.10)。我得到的输出:
Mar 18 23:46:43 localhost NetworkManager[4790]: <info> [1552949203.6892] vpn-connection[0x561eebea6120,3e1960f9-b5d6-4d39-aa78-0adbe74360b5,"vpn.test.net",0]: Started the VPN service, PID 13659
Mar 18 23:46:43 localhost NetworkManager[4790]: <info> [1552949203.7015] vpn-connection[0x561eebea6120,3e1960f9-b5d6-4d39-aa78-0adbe74360b5,"vpn.test.net",0]: Saw the service appear; activating connection
Mar 18 23:46:43 localhost NetworkManager[4790]: <info> [1552949203.7094] vpn-connection[0x561eebea6120,3e1960f9-b5d6-4d39-aa78-0adbe74360b5,"vpn.test.net",0]: VPN connection: (ConnectInteractive) reply received
Mar 18 23:46:43 localhost NetworkManager[4790]: <warn> [1552949203.7420] vpn-connection[0x561eebea6120,3e1960f9-b5d6-4d39-aa78-0adbe74360b5,"vpn.test.net",0]: VPN connection: failed to connect: 'couldn't look up L2TP VPN gateway IP address '
Mar 18 23:46:43 localhost NetworkManager[4790]: <info> [1552949203.7436] vpn-connection[0x561eebea6120,3e1960f9-b5d6-4d39-aa78-0adbe74360b5,"vpn.test.net",0]: VPN plugin: state changed: stopped (6)
Mar 18 23:46:43 localhost NetworkManager[4790]: <info> [1552949203.7449] vpn-connection[0x561eebea6120,3e1960f9-b5d6-4d39-aa78-0adbe74360b5,"vpn.test.net",0]: VPN service disappeared
我从 networkmenager-l2tp 和 strongswan 输出
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror-pl.kielcetechnologypark.net
* epel: ftp.arnes.si
* extras: ftp.man.poznan.pl
* updates: mirror-pl.kielcetechnologypark.net
Installed Packages
Name : NetworkManager-l2tp
Arch : x86_64
Version : 1.2.10
Release : 1.el7
Size : 423 k
Repo : installed
From repo : epel
Summary : NetworkManager VPN plugin for L2TP and L2TP/IPsec
URL : https://github.com/nm-l2tp/network-manager-l2tp
License : GPLv2+
Description : This package contains software for integrating L2TP and L2TP over
: IPsec VPN support with the NetworkManager.
strongswan:
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror-pl.kielcetechnologypark.net
* epel: ftp.arnes.si
* extras: ftp.man.poznan.pl
* updates: mirror-pl.kielcetechnologypark.net
Installed Packages
Name : strongswan
Arch : x86_64
Version : 5.7.2
Release : 1.el7
Size : 4.0 M
Repo : installed
From repo : epel
Summary : An OpenSource IPsec-based VPN and TNC solution
URL : http://www.strongswan.org/
License : GPLv2+
Description : The strongSwan IPsec implementation supports both the IKEv1 and IKEv2
: key exchange protocols in conjunction with the native NETKEY IPsec
: stack of the Linux kernel.
以及来自 /etc/NetworkManager/system-connections 的配置文件
id=vpn.test.net
uuid=3e1960f9-b5d6-4d39-aa78-0adbe74360b5
type=vpn
autoconnect=false
permissions=user:hvk:;
[vpn]
gateway=vpn.test.net:1194
ipsec-enabled=yes
ipsec-esp=3des-sha1!
ipsec-gateway-id=vpn.test.net:1194
ipsec-ike=3des-sha1-modp1024!
ipsec-psk=*****
mru=1400
mtu=1400
password-flags=0
user=my_login
service-type=org.freedesktop.NetworkManager.l2tp
[vpn-secrets]
password=*****
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
并且 uname -a:Linux localhost.localdomain 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
编辑:解决方案。检查 selinux 并禁用它 :) 非常简单的解决方案。感谢 Andy 的帮助。
答案1
gateway=vpn.test.net:1194
您收到 DNS 查找错误。我会仔细检查以确保此行上的任何域名都已通过 DNS 正确解析。