我已经使用openvpn-install 实用程序在远程 VPS 上安装了自己的 openvpn 服务器,并采用了所有默认参数。
将输出 .ovpn 文件下载到我的客户端计算机后,我从 CLI 测试了 openvpn 服务器,它工作得很好:
sudo openvpn vpnperso.ovpn
但是当我尝试在网络管理器中导入此文件时,与 vpn 的连接超时。
客户端日志:
$cat /var/log/syslog | grep vpn
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info> [1561885089.8474] audit: op="connection-activate" uuid="1c4eaa3c-a511-4e0d-b115-ced19c047574" name="vpnperso" pid=1281 uid=1000 result="success"
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info> [1561885089.8538] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: Started the VPN service, PID 31822
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info> [1561885089.8634] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: Saw the service appear; activating connection
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info> [1561885089.8698] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: state changed: starting (3)
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: WARNING: file '/home/luc/.local/share/networkmanagement/certificates/vpnperso/private.key' is group or others accessible
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: TCP/UDP: Preserving recently used remote address: [AF_INET]ip.ip.ip.ip:1194
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: UDP link local: (not bound)
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: UDP link remote: [AF_INET]ip.ip.ip.ip:1194
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: NOTE: chroot will be delayed because of --client, --pull, or --up-delay
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <warn> [1561885149.6776] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN connection: connect timeout exceeded.
juin 30 10:59:09 sainte-victoire nm-openvpn-serv[31822]: Connect timer expired, disconnecting.
juin 30 10:59:09 sainte-victoire nm-openvpn[31825]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
juin 30 10:59:09 sainte-victoire nm-openvpn[31825]: TLS Error: TLS handshake failed
juin 30 10:59:09 sainte-victoire nm-openvpn[31825]: SIGTERM[hard,tls-error] received, process exiting
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <warn> [1561885149.6875] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: failed: connect-failed (1)
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <info> [1561885149.6884] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: state changed: stopping (5)
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <info> [1561885149.6892] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: state changed: stopped (6)
服务器端日志
$cat /var/log/syslog | grep vpn
Jun 30 10:59:09 vps704584 ovpn-server[12227]: TLS Error: tls-crypt unwrapping failed from [AF_INET]ip:ip:ip:ip:53903
Jun 30 10:59:09 vps704584 ovpn-server[12227]: tls-crypt unwrap error: packet too short
如何让 NetworkManager 工作?