我的 VPN 断开连接有问题。每次连接大约 5 分钟后就会断开连接,我不知道原因,也在网上找不到相关信息。
以下是终端输出:
sudo openvpn --config vpnbook-euro1-tcp443.ovpn
Wed Apr 25 19:03: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 25 19:03:19 2018 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Enter Auth Username: *******
Enter Auth Password: ********
Wed Apr 25 19:03:28 2018 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Wed Apr 25 19:03:28 2018 NOTE: --fast-io is disabled since we are not using UDP
Wed Apr 25 19:03:28 2018 Socket Buffers: R=[87380->87380] S=[16384->16384]
Wed Apr 25 19:03:28 2018 Attempting to establish TCP connection with [AF_INET]176.126.237.217:443 [nonblock]
Wed Apr 25 19:03:29 2018 TCP connection established with [AF_INET]176.126.237.217:443
Wed Apr 25 19:03:29 2018 TCPv4_CLIENT link local: [undef]
Wed Apr 25 19:03:29 2018 TCPv4_CLIENT link remote: [AF_INET]176.126.237.217:443
Wed Apr 25 19:03:30 2018 TLS: Initial packet from [AF_INET]176.126.237.217:443, sid=dd467348 e8297078
Wed Apr 25 19:03:30 2018 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Wed Apr 25 19:03:30 2018 VERIFY OK: depth=1, C=CH, ST=Zurich, L=Zurich, O=vpnbook.com, OU=IT, CN=vpnbook.com, name=vpnbook.com, [email protected]
Wed Apr 25 19:03:30 2018 VERIFY OK: depth=0, C=CH, ST=Zurich, L=Zurich, O=vpnbook.com, OU=IT, CN=vpnbook.com, name=vpnbook.com, [email protected]
Wed Apr 25 19:03:32 2018 Data Channel Encrypt: Cipher 'AES-128-CBC' initialized with 128 bit key
Wed Apr 25 19:03:32 2018 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Apr 25 19:03:32 2018 Data Channel Decrypt: Cipher 'AES-128-CBC' initialized with 128 bit key
Wed Apr 25 19:03:32 2018 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Apr 25 19:03:32 2018 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 1024 bit RSA
Wed Apr 25 19:03:32 2018 [vpnbook.com] Peer Connection Initiated with [AF_INET]176.126.237.217:443
Wed Apr 25 19:03:34 2018 SENT CONTROL [vpnbook.com]: 'PUSH_REQUEST' (status=1)
Wed Apr 25 19:03:34 2018 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 8.8.4.4,dhcp-option DNS 91.239.100.100,route 10.9.0.1,topology net30,ping 5,ping-restart 30,ifconfig 10.9.0.22 10.9.0.21,peer-id 0'
Wed Apr 25 19:03:34 2018 OPTIONS IMPORT: timers and/or timeouts modified
Wed Apr 25 19:03:34 2018 OPTIONS IMPORT: --ifconfig/up options modified
Wed Apr 25 19:03:34 2018 OPTIONS IMPORT: route options modified>
Wed Apr 25 19:03:34 2018 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Apr 25 19:03:34 2018 OPTIONS IMPORT: peer-id set
Wed Apr 25 19:03:34 2018 OPTIONS IMPORT: adjusting link_mtu to 1563
Wed Apr 25 19:03:34 2018 ROUTE_GATEWAY 192.168.178.1/255.255.255.0 IFACE=wlx0018e756fdf2 HWADDR=00:18:e7:56:fd:f2
Wed Apr 25 19:03:34 2018 TUN/TAP device tun1 opened
Wed Apr 25 19:03:34 2018 TUN/TAP TX queue length set to 100
Wed Apr 25 19:03:34 2018 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Wed Apr 25 19:03:34 2018 /sbin/ip link set dev tun1 up mtu 1500
Wed Apr 25 19:03:34 2018 /sbin/ip addr add dev tun1 local 10.9.0.22 peer 10.9.0.21
Wed Apr 25 19:03:36 2018 /sbin/ip route add 176.126.237.217/32 via 192.168.178.1
Wed Apr 25 19:03:36 2018 /sbin/ip route add 0.0.0.0/1 via 10.9.0.21
Wed Apr 25 19:03:36 2018 /sbin/ip route add 128.0.0.0/1 via 10.9.0.21
Wed Apr 25 19:03:36 2018 /sbin/ip route add 10.9.0.1/32 via 10.9.0.21
Wed Apr 25 19:03:36 2018 Initialization Sequence Completed
Wed Apr 25 19:14:11 2018 [vpnbook.com] Inactivity timeout (--ping-restart), restarting
Wed Apr 25 19:14:11 2018 SIGUSR1[soft,ping-restart] received, process restarting
Wed Apr 25 19:14:11 2018 Restart pause, 5 second(s)
Wed Apr 25 19:14:16 2018 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Wed Apr 25 19:14:16 2018 NOTE: --fast-io is disabled since we are not using UDP
Wed Apr 25 19:14:16 2018 Socket Buffers: R=[87380->87380] S=[16384->16384]
Wed Apr 25 19:14:16 2018 Attempting to establish TCP connection with [AF_INET]176.126.237.217:443 [nonblock]
Wed Apr 25 19:14:17 2018 TCP connection established with [AF_INET]176.126.237.217:443
Wed Apr 25 19:14:17 2018 TCPv4_CLIENT link local: [undef]
Wed Apr 25 19:14:17 2018 TCPv4_CLIENT link remote: [AF_INET]176.126.237.217:443
Wed Apr 25 19:14:19 2018 Connection reset, restarting [-1]
Wed Apr 25 19:14:19 2018 SIGUSR1[soft,connection-reset] received, process restarting
我无法判断问题是否出在我这边,也就是说不幸的是我的电脑无法访问路由器,或者是 ISP/VPN 的问题。
答案1
日志文件显示由于不活动,10 分钟后连接断开:
Wed Apr 25 19:03:36 2018 Initialization Sequence Completed
Wed Apr 25 19:14:11 2018 [vpnbook.com] Inactivity timeout (--ping-restart), restarting
如果您确实在积极使用 VPN,则需要向服务器端点的运营商提出此问题。
您还可以从客户端 OpenVPN 配置中向我们提供超时设置(XXXXXX 远程主机名、证书详细信息和任何用户名/密码),以查看其中是否提到超时设置(它将被列为 600 秒的值)。
您可以通过在另一个窗口中启动来解决该问题ping
,但实际上解决根本问题会更好。
ping -i 30 8.8.8.8 # Send a packet every 30 seconds