Kubuntu 16.04.3 和 OpenVPN(openvpn 包):无法正常工作

Kubuntu 16.04.3 和 OpenVPN(openvpn 包):无法正常工作

我有一台 Ubuntu 服务器,OpenVPN 在那里运行良好。我可以成功跟踪路由/ping 许多服务器。此外,在这台机器上(无论是否运行 OpenVPN),/etc/resolv.conf 正在获取我的调制解调器/路由器建议的 DNS 服务器,这些服务器只是 OpenDNS 服务器。

我最近设置了 Kubuntu 并设置了 OpenVPN,但无论我做什么,都无法获得外部连接。Traceroute/ping 失败。无论有没有 OpenVPN,我的 /etc/resolv.conf 总是指向 127.0.1.1。使用 NetworkManager,我更改了 Wi-Fi 设备和 tun0 的 IPv4 DNS DNS 条目以指向 OpenDNS。我仍然没有外部连接。

我在网上搜索了一下,发现需要安装 network-manager-openvpn 包。我安装了它,然后导入了我的工作(来自 ubuntu 服务器)OpenVPN 配置文件。但仍然没有连接。(底部的日志消息)。我的 VPN 提供商只提供 CA 证书。

关于如何修复它有什么想法吗?

谢谢

来自提供商的 OpenVPN 配置

client
remote my-server-here.com 1194 udp
remote my-server-here.com 443 tcp-client

pull
auth-user-pass 
comp-lzo adaptive
ca ca.crt
dev tun
tls-client
script-security 2
cipher AES-256-CBC
mute 10

route-delay 5
redirect-gateway def1
resolv-retry infinite
#dhcp-renew
#dhcp-release
persist-key
persist-tun
remote-cert-tls server
mssfix

/var/log/syslog

Sep 17 11:10:54 tree NetworkManager[3705]: <info>  [1505612454.3007] audit: op="connection-activate" uuid="15e1c79d-d6e8-49e4-83bc-6ea882f99322" name="default" pid=4994 uid=1000 result="success"
Sep 17 11:10:54 tree NetworkManager[3705]: <info>  [1505612454.3074] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: Started the VPN service, PID 6701
Sep 17 11:10:54 tree NetworkManager[3705]: <info>  [1505612454.3220] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: Saw the service appear; activating connection
Sep 17 11:10:54 tree NetworkManager[3705]: nm-openvpn-Message: openvpn[6704] started
Sep 17 11:10:54 tree NetworkManager[3705]: <info>  [1505612454.3543] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: VPN plugin: state changed: starting (3)
Sep 17 11:10:54 tree nm-openvpn[6704]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
Sep 17 11:10:54 tree nm-openvpn[6704]: library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Sep 17 11:10:54 tree nm-openvpn[6704]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Sep 17 11:10:54 tree nm-openvpn[6704]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Sep 17 11:10:54 tree nm-openvpn[6704]: NOTE: chroot will be delayed because of --client, --pull, or --up-delay
Sep 17 11:10:54 tree nm-openvpn[6704]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sep 17 11:10:54 tree nm-openvpn[6704]: UDPv4 link local: [undef]
Sep 17 11:10:54 tree nm-openvpn[6704]: UDPv4 link remote: [AF_INET]164.220.22.23:443
Sep 17 11:11:54 tree nm-openvpn[6704]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sep 17 11:11:54 tree nm-openvpn[6704]: TLS Error: TLS handshake failed
Sep 17 11:11:54 tree nm-openvpn[6704]: SIGUSR1[soft,tls-error] received, process restarting
Sep 17 11:11:55 tree NetworkManager[3705]: <warn>  [1505612515.0985] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: VPN connection: connect timeout exceeded.
Sep 17 11:11:55 tree NetworkManager[3705]: libnm-Message: Connect timer expired, disconnecting.
Sep 17 11:11:55 tree NetworkManager[3705]: nm-openvpn-Message: openvpn[6704]: send SIGTERM
Sep 17 11:11:55 tree nm-openvpn[6704]: SIGTERM[hard,init_instance] received, process exiting
Sep 17 11:11:55 tree NetworkManager[3705]: <warn>  [1505612515.1014] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: VPN plugin: failed: connect-failed (1)
Sep 17 11:11:55 tree NetworkManager[3705]: <info>  [1505612515.1016] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: VPN plugin: state changed: stopping (5)
Sep 17 11:11:55 tree NetworkManager[3705]: nm-openvpn-Message: openvpn[6704] exited with success
Sep 17 11:11:55 tree NetworkManager[3705]: <info>  [1505612515.1018] vpn-connection[0x22ff580,15e1c79d-d6e8-49e4-83bc-6ea882f99322,"default",0]: VPN plugin: state changed: stopped (6)
Sep 17 11:11:55 tree org.kde.kdeconnect[4181]: "No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/NetworkManager/ActiveConnection/6"

答案1

这一行:

Sep 17 11:10:54 tree nm-openvpn[6704]: UDPv4 link remote:[AF_INET]164.220.22.23:443

表示openvpn正在尝试使用 UDP 连接到您要设置的 TCP 端口。

相应的配置行应该是:

remote my-server-here.com 443 tcp

并且不是tcp-clienttcp-client是配置的一个选项--proto

我认为您正在使用两个不同版本的openvpn,其中一个对参数更为严格。

相关内容