OpenVPN(Tunnelblick 和 Viscosity)连接几乎在 10 分钟后断开

OpenVPN(Tunnelblick 和 Viscosity)连接几乎在 10 分钟后断开

原始问题在这里: https://apple.stackexchange.com/questions/77245/viscosity-openvpn-tunnelblick-connect-but-all-rdp-connections-go-dead-after-abou

我的 VPN 连接似乎刚好正常 10 分钟。

以下是日志:

 Jan 08 09:37:05: Viscosity Mac 1.4.2 (1092)
Jan 08 09:37:05: Viscosity OpenVPN Engine Started
Jan 08 09:37:05: Running on Mac OS X 10.8.2
Jan 08 09:37:05: ---------
Jan 08 09:37:05: Checking reachability status of connection...
Jan 08 09:37:05: Connection is reachable. Starting connection attempt.
Jan 08 09:37:08: OpenVPN 2.2.1 x86_64-apple-darwin10.8.0 [SSL] [LZO2] [PKCS11] [eurephia] built on Aug  1 2011
Jan 08 09:37:07: IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA.  OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Jan 08 09:37:07: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Jan 08 09:37:07: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Jan 08 09:37:09: WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Jan 08 09:37:09: LZO compression initialized
Jan 08 09:37:09: UDPv4 link local (bound): [undef]:1194
Jan 08 09:37:09: UDPv4 link remote: 216.23.154.30:1194
Jan 08 09:37:10: [vpp-vpn001.verrus.com] Peer Connection Initiated with 216.23.154.30:1194
Jan 08 09:37:12: TUN/TAP device /dev/tun0 opened
Jan 08 09:37:12: /sbin/ifconfig tun0 delete
Jan 08 09:37:12: NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Jan 08 09:37:12: /sbin/ifconfig tun0 10.103.11.145 10.103.11.146 mtu 1500 netmask 255.255.255.255 up
Jan 08 09:37:12: Initialization Sequence Completed
Jan 08 09:57:15: [vpp-vpn001.verrus.com] Inactivity timeout (--ping-restart), restarting
Jan 08 09:57:15: SIGUSR1[soft,ping-restart] received, process restarting
Jan 08 09:57:16: IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA.  OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Jan 08 09:57:16: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Jan 08 09:57:16: NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Jan 08 09:57:16: LZO compression initialized
Jan 08 09:57:16: UDPv4 link local (bound): [undef]:1194
Jan 08 09:57:16: UDPv4 link remote: 216.23.154.30:1194
Jan 08 09:57:17: [vpp-vpn001.verrus.com] Peer Connection Initiated with 216.23.154.30:1194
Jan 08 09:57:19: TUN/TAP device /dev/tun0 opened
Jan 08 09:57:19: /sbin/ifconfig tun0 delete
Jan 08 09:57:19: NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Jan 08 09:57:19: /sbin/ifconfig tun0 10.103.11.145 10.103.11.146 mtu 1500 netmask 255.255.255.255 up
Jan 08 09:57:19: Initialization Sequence Completed

Viscosity 似乎需要大约 10 分钟才能注意到连接失败并尝试重新协商。我的路由表似乎没有变化。我尝试过并能够在 Tunnelblick 和 Viscosity 中复制此行为。

我实际上可以看到吞吐量在 10 分钟的 10 秒内下降到 0。

我的理论是它围绕 DHCP 租用时间,但我还没能弄清楚如何使用 OpenVPN tun 接口在 OSX 上检查它。

答案1

Jan 08 09:57:15: [vpp-vpn001.verrus.com] Inactivity timeout (--ping-restart), restarting

从这一行可以清楚地看出,服务器端设置了空闲超时。因此,当有人 20 分钟内没有执行任何操作时(不是 10 分钟,这是我从日志中看到的),服务器就会重置连接。

您能否检查一下服务器端。可能是类似这样的keepalive 10 120。但不确定。您需要查看 server.conf 文件。

相关内容