![Openvpn linux 连接重置,重新启动](https://linux22.com/image/674084/Openvpn%20linux%20%E8%BF%9E%E6%8E%A5%E9%87%8D%E7%BD%AE%EF%BC%8C%E9%87%8D%E6%96%B0%E5%90%AF%E5%8A%A8%20.png)
这在 Windows 下运行得很好,但在我的 ubuntu 笔记本电脑上失败了
有人知道这是为什么吗?
openvpn 输出
Thu Dec 31 13:49:42 2015 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Apr 13 2015
Thu Dec 31 13:49:42 2015 WARNING: file 'tom.key' is group or others accessible
Thu Dec 31 13:49:42 2015 Socket Buffers: R=[87380->131072] S=[16384->131072]
Thu Dec 31 13:49:42 2015 Attempting to establish TCP connection with [AF_INET]120.136.49.81:47 [nonblock]
.........
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: timers and/or timeouts modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: --ifconfig/up options modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: route options modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: route-related options modified
Thu Dec 31 13:49:46 2015 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Thu Dec 31 13:49:46 2015 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=wlan0 HWADDR=88:53:2e:a5:8b:1f
Thu Dec 31 13:49:46 2015 TUN/TAP device tap0 opened
Thu Dec 31 13:49:46 2015 TUN/TAP TX queue length set to 100
Thu Dec 31 13:49:46 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Thu Dec 31 13:49:46 2015 /sbin/ip link set dev tap0 up mtu 1500
Thu Dec 31 13:49:46 2015 /sbin/ip addr add dev tap0 10.8.0.61/8 broadcast 10.255.255.255
Thu Dec 31 13:49:46 2015 /sbin/ip route add 120.136.49.81/32 via 192.168.1.1
RTNETLINK answers: File exists
Thu Dec 31 13:49:46 2015 ERROR: Linux route add command failed: external program exited with error status: 2
Thu Dec 31 13:49:46 2015 /sbin/ip route add 0.0.0.0/1 via 10.1.4.10
Thu Dec 31 13:49:46 2015 /sbin/ip route add 128.0.0.0/1 via 10.1.4.10
Thu Dec 31 13:49:46 2015 /sbin/ip route add 10.0.0.0/8 via 10.1.4.10
RTNETLINK answers: File exists
Thu Dec 31 13:49:46 2015 ERROR: Linux route add command failed: external program exited with error status: 2
Thu Dec 31 13:49:46 2015 Initialization Sequence Completed
Thu Dec 31 13:50:01 2015 Connection reset, restarting [0]
Thu Dec 31 13:50:01 2015 SIGUSR1[soft,connection-reset] received, process restarting
Thu Dec 31 13:50:01 2015 Restart pause, 5 second(s)
此时,它会进入重新连接和断开连接的无限循环,其中连接处于活动状态约 3 秒,然后断开连接
tom.ovpn 内容:
client
dev tap
proto tcp
remote xxxxxxxxxxxxxxx 47
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert tom.crt
key tom.key
ns-cert-type server
comp-lzo
verb 3
我可以在网上找到很多有关此问题的信息,这些信息是由各种不同的问题引起的,但似乎没有一个适用于此处。
最常见的原因似乎是 ovpn 文件存在问题,但正如我上面所说,这在 Windows 下可以完美运行。
答案1
我发现了这个问题。这是我犯的一个愚蠢的错误。我需要打开端口 47 上的防火墙
答案2
对我来说,vpn 连接实际上工作正常,但我在日志中收到此错误消息。经过(几年的)调查,我终于弄清楚了连接重置的错误消息是由我们的 Zabbix 网络监控导致的,该监控打开了 TCP 连接,然后立即关闭。