当命令行工作时,使用网络管理器连接到 VPN 时出现问题

当命令行工作时,使用网络管理器连接到 VPN 时出现问题

如果我尝试使用网络管理器连接到我的 VPN,则会失败,并/var/log/syslog显示:

Dec  4 17:43:25 zepto nm-openvpn[1696]: OpenVPN 2.3.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Nov 12 2015
Dec  4 17:43:25 zepto nm-openvpn[1696]: library versions: OpenSSL 1.0.1t  3 May 2016, LZO 2.08
Dec  4 17:43:25 zepto nm-openvpn[1696]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Dec  4 17:43:25 zepto nm-openvpn[1696]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Dec  4 17:43:25 zepto nm-openvpn[1696]: UDPv4 link local: [undef]
Dec  4 17:43:25 zepto nm-openvpn[1696]: UDPv4 link remote: [AF_INET]80.67.169.45:1194
Dec  4 17:44:06 zepto NetworkManager[484]: <warn> VPN connection 'VPN FDN' connect timeout exceeded.
Dec  4 17:44:06 zepto nm-openvpn[1696]: SIGTERM[hard,] received, process exiting
Dec  4 17:44:06 zepto NetworkManager[484]: nm-openvpn-Message: Terminated openvpn daemon with PID 1696.
Dec  4 17:44:11 zepto kernel: [  387.184894] perf interrupt took too long (2508 > 2500), lowering kernel.perf_event_max_sample_rate to 50000

但如果我尝试通过命令行连接,一切都很好:

openvpn /foo/vpn.ovpn
Sun Dec  4 17:45:30 2016 Option 'nobind' in /foo/vpn.ovpn:56 is ignored by previous <connection> blocks 
Sun Dec  4 17:45:30 2016 OpenVPN 2.3.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Nov 12 2015
Sun Dec  4 17:45:30 2016 library versions: OpenSSL 1.0.1t  3 May 2016, LZO 2.08
Enter Auth Username: ***************************
Enter Auth Password: ***************************
Sun Dec  4 17:45:40 2016 Socket Buffers: R=[87380->131072] S=[16384->131072]
Sun Dec  4 17:45:42 2016 Attempting to establish TCP connection with [AF_INET]80.67.169.57:1194 [nonblock]
Sun Dec  4 17:45:43 2016 TCP connection established with [AF_INET]80.67.169.57:1194
Sun Dec  4 17:45:43 2016 TCPv4_CLIENT link local: [undef]
Sun Dec  4 17:45:43 2016 TCPv4_CLIENT link remote: [AF_INET]80.67.169.57:1194
Sun Dec  4 17:45:43 2016 TLS: Initial packet from [AF_INET]80.67.169.57:1194, sid=e4a11fe9 9defe9fa
Sun Dec  4 17:45:43 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sun Dec  4 17:45:46 2016 VERIFY OK: depth=2, O=Root CA, OU=http://www.cacert.org, CN=CA Cert Signing Authority, [email protected]
Sun Dec  4 17:45:46 2016 VERIFY OK: depth=1, O=CAcert Inc., OU=http://www.CAcert.org, CN=CAcert Class 3 Root
Sun Dec  4 17:45:46 2016 VERIFY X509NAME OK: CN=*.fdn.fr
Sun Dec  4 17:45:46 2016 VERIFY OK: depth=0, CN=*.fdn.fr
Sun Dec  4 17:45:47 2016 WARNING: 'tun-ipv6' is present in remote config but missing in local config, remote='tun-ipv6'
Sun Dec  4 17:45:47 2016 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sun Dec  4 17:45:47 2016 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Dec  4 17:45:47 2016 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sun Dec  4 17:45:47 2016 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication                                             
Sun Dec  4 17:45:47 2016 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA                                                 
Sun Dec  4 17:45:47 2016 [*.fdn.fr] Peer Connection Initiated with [AF_INET]80.67.169.57:1194                                                        
Sun Dec  4 17:45:49 2016 SENT CONTROL [*.fdn.fr]: 'PUSH_REQUEST' (status=1)
Sun Dec  4 17:45:50 2016 PUSH: Received control message: 'PUSH_REPLY,ifconfig-ipv6 2001:910:1370:ffff::1 2001:910:1301::1,tun-ipv6,dhcp-option DNS 80.67.169.12,dhcp-option DNS 2001:910:800::40,dhcp-option DNS 80.67.169.40,dhcp-option DNS 2001:910:800::12,ping 5,ping-restart 60,route-gateway 80.67.179.1,topology subnet,ifconfig 80.67.179.112 255.255.252.0'
Sun Dec  4 17:45:50 2016 OPTIONS IMPORT: timers and/or timeouts modified
Sun Dec  4 17:45:50 2016 OPTIONS IMPORT: --ifconfig/up options modified
Sun Dec  4 17:45:50 2016 OPTIONS IMPORT: route-related options modified
Sun Dec  4 17:45:50 2016 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sun Dec  4 17:45:50 2016 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=wlan0 HWADDR=00:15:af:5f:33:56
Sun Dec  4 17:45:50 2016 TUN/TAP device tun0 opened
Sun Dec  4 17:45:50 2016 TUN/TAP TX queue length set to 100
Sun Dec  4 17:45:50 2016 do_ifconfig, tt->ipv6=1, tt->did_ifconfig_ipv6_setup=1
Sun Dec  4 17:45:50 2016 /sbin/ip link set dev tun0 up mtu 1500
Sun Dec  4 17:45:50 2016 /sbin/ip addr add dev tun0 80.67.179.112/22 broadcast 80.67.179.255
Sun Dec  4 17:45:50 2016 /sbin/ip -6 addr add 2001:910:1370:ffff::1/64 dev tun0
Sun Dec  4 17:45:52 2016 /sbin/ip route add 80.67.169.57/32 via 192.168.1.1
Sun Dec  4 17:45:52 2016 /sbin/ip route add 0.0.0.0/1 via 80.67.179.1
Sun Dec  4 17:45:52 2016 /sbin/ip route add 128.0.0.0/1 via 80.67.179.1
Sun Dec  4 17:45:52 2016 Initialization Sequence Completed
  • 我在两种情况下使用完全相同的文件 ( /foo/vpn.ovpn),
  • 我使用相同的用户名/密码,
  • 这种配置多年来一直完美运行,
  • Whatmyip.com 确认我的连接通过命令行工作正常,
  • 我将所有内容移入/etc/NetworkManager/system-connections/并重新创建了所有配置。

答案1

奇怪的是,移动 的内容/etc/NetworkManager/system-connections,使用网络管理器重新创建连接并重新启动两次工作了。我的旧配置文件和新配置文件之间的差异显示出三个差异:

  • 乌迪的一个
  • ca 中的一个,从 更改ca=/foo/vpn-ca.crtca = /foo/vpn.ovpn
  • 它删除了 [ipv6] method=auto

相关内容