当我在“网络连接”>“导入已保存的 VPN 配置”中导入 .ovpn 文件时出现此错误:
无法读取文件“config.ovpn”或该文件不包含可识别的 VPN 连接信息
错误:该插件不支持导入功能。
当我通过 shell 启动 OpenVPN 时,它将启动并显示以下输出:
sudo openvpn --config aaa.ovpn
Wed Apr 4 14:28:19 2018 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
Wed Apr 4 14:28:19 2018 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Wed Apr 4 14:28:19 2018 WARNING: file 'aaa.p12' is group or others accessible
Wed Apr 4 14:28:19 2018 WARNING: file 'aaa-tls.key' is group or others accessible
Wed Apr 4 14:28:19 2018 Control Channel Authentication: using 'aaa-tls.key' as a OpenVPN static key file
Wed Apr 4 14:28:19 2018 Attempting to establish TCP connection with [AF_INET]xx.xx.xx.xx:1194 [nonblock]
Wed Apr 4 14:28:20 2018 TCP connection established with [AF_INET]xx.xx.xx.xx:1194
Wed Apr 4 14:28:20 2018 TCPv4_CLIENT link local: [undef]
Wed Apr 4 14:28:20 2018 TCPv4_CLIENT link remote: [AF_INET]xx.xx.xx.xx:1194
Wed Apr 4 14:28:21 2018 [Server OpenVPN] Peer Connection Initiated with [AF_INET]xx.xx.xx.xx:1194
Wed Apr 4 14:28:24 2018 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:6: block-outside-dns (2.3.10)
Wed Apr 4 14:28:24 2018 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:7: register-dns (2.3.10)
Wed Apr 4 14:28:24 2018 TUN/TAP device tun0 opened
Wed Apr 4 14:28:24 2018 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Wed Apr 4 14:28:24 2018 /sbin/ip link set dev tun0 up mtu 1500
Wed Apr 4 14:28:24 2018 /sbin/ip addr add dev tun0 10.10.10.12/24 broadcast 10.10.10.255
Wed Apr 4 14:28:24 2018 Initialization Sequence Completed
如果我没记错的话,连接已经在 tun0 接口下建立。但它仍然不起作用。我的流量仍然通过我的正常 IP 地址,并且此 VPN 背后的资源无法访问。
我的 .ovpn 文件:
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA1
tls-client
client
resolv-retry infinite
remote xx.xx.xx.xx 1194 tcp-client
verify-x509-name "Server OpenVPN" name
pkcs12 aaa.p12
tls-auth aaa.key 1
remote-cert-tls server
comp-lzo adaptive
路线输出
$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default RT-AC68U-55A0 0.0.0.0 UG 600 0 0 wlp2s0
10.10.10.0 * 255.255.255.0 U 0 0 0 tun0
10.10.99.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
link-local * 255.255.0.0 U 1000 0 0 docker0
172.17.0.0 * 255.255.0.0 U 0 0 0 docker0
172.18.0.0 * 255.255.0.0 U 0 0 0 docker_gwbridge
172.30.3.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
172.31.7.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
172.31.8.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
172.31.12.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
172.31.14.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
172.31.19.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
172.31.63.0 10.10.10.1 255.255.255.0 UG 0 0 0 tun0
192.168.1.0 * 255.255.255.0 U 600 0 0 wlp2s0