VPN - 短读 (-1):“消息太长”

VPN - 短读 (-1):“消息太长”

因此,我尝试在度假期间的酒店 wifi 上使用 VPN,但不知为何,我遇到了这个烦人的问题。当我在几秒钟内连接到 VPN 时,它断线了,系统日志显示:

Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <info> Starting VPN service 'pptp'...
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN service 'pptp' started (org.freedesktop.NetworkManager.pptp), PID 9778
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN service 'pptp' appeared; activating connections
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN plugin state changed: init (1)
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN plugin state changed: starting (3)
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN connection 'UCL CS VPN' (Connect) reply received.
Jun 14 20:51:14 botev-ThinkPad-T440 pppd[9783]: Plugin /usr/lib/pppd/2.4.5/nm-pptp-pppd-plugin.so loaded.
Jun 14 20:51:14 botev-ThinkPad-T440 pppd[9783]: pppd 2.4.5 started by root, uid 0
Jun 14 20:51:14 botev-ThinkPad-T440 pppd[9783]: Using interface ppp0
Jun 14 20:51:14 botev-ThinkPad-T440 pppd[9783]: Connect: ppp0 <--> /dev/pts/9
Jun 14 20:51:14 botev-ThinkPad-T440 pptp[9787]: nm-pptp-service-9778 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Jun 14 20:51:14 botev-ThinkPad-T440 NetworkManager[845]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Jun 14 20:51:14 botev-ThinkPad-T440 kernel: [ 5763.841477] init: network-interface (ppp0) pre-start process (9794) terminated with status 1
Jun 14 20:51:14 botev-ThinkPad-T440 kernel: [ 5763.846659] init: network-interface (ppp0) post-stop process (9802) terminated with status 1
Jun 14 20:51:14 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Jun 14 20:51:14 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Jun 14 20:51:14 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Jun 14 20:51:15 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Jun 14 20:51:15 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Jun 14 20:51:15 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 1661).
Jun 14 20:51:15 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_disp:pptp_ctrl.c:950]: PPTP_SET_LINK_INFO received from peer_callid 56205
Jun 14 20:51:15 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_disp:pptp_ctrl.c:953]:   send_accm is 00000000, recv_accm is FFFFFFFF
Jun 14 20:51:15 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 warn[ctrlp_disp:pptp_ctrl.c:956]: Non-zero Async Control Character Maps are not supported!
Jun 14 20:51:15 botev-ThinkPad-T440 pppd[9783]: CHAP authentication succeeded
Jun 14 20:51:15 botev-ThinkPad-T440 pppd[9783]: MPPE 128-bit stateless compression enabled
Jun 14 20:51:17 botev-ThinkPad-T440 pppd[9783]: local  IP address 128.16.114.3
Jun 14 20:51:17 botev-ThinkPad-T440 pppd[9783]: remote IP address 128.16.114.1
Jun 14 20:51:17 botev-ThinkPad-T440 pppd[9783]: primary   DNS address 128.16.6.8
Jun 14 20:51:17 botev-ThinkPad-T440 pppd[9783]: secondary DNS address 128.16.5.31
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN connection 'UCL CS VPN' (IP4 Config Get) reply received from old-style plugin.
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN Gateway: 128.16.11.245
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info> Tunnel Device: ppp0
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info> IPv4 configuration:
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Internal Address: 128.16.114.3
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Internal Prefix: 32
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Internal Point-to-Point Address: 128.16.114.1
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Maximum Segment Size (MSS): 0
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Forbid Default Route: no
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Internal DNS: 128.16.6.8
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   Internal DNS: 128.16.5.31
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info>   DNS Domain: '(none)'
Jun 14 20:51:17 botev-ThinkPad-T440 NetworkManager[845]: <info> No IPv6 configuration
Jun 14 20:51:18 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN connection 'UCL CS VPN' (IP Config Get) complete.
Jun 14 20:51:18 botev-ThinkPad-T440 NetworkManager[845]: <info> Policy set 'UCL CS VPN' (ppp0) as default for IPv4 routing and DNS.
Jun 14 20:51:18 botev-ThinkPad-T440 NetworkManager[845]: <info> Writing DNS information to /sbin/resolvconf
Jun 14 20:51:18 botev-ThinkPad-T440 dnsmasq[3602]: setting upstream servers from DBus
Jun 14 20:51:18 botev-ThinkPad-T440 dnsmasq[3602]: using nameserver 128.16.5.31#53
Jun 14 20:51:18 botev-ThinkPad-T440 dnsmasq[3602]: using nameserver 128.16.6.8#53
Jun 14 20:51:18 botev-ThinkPad-T440 dbus[525]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
Jun 14 20:51:18 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN plugin state changed: started (4)
Jun 14 20:51:18 botev-ThinkPad-T440 dbus[525]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jun 14 20:51:20 botev-ThinkPad-T440 pptp[9787]: nm-pptp-service-9778 warn[decaps_gre:pptp_gre.c:331]: short read (-1): Message too long
Jun 14 20:51:20 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
Jun 14 20:51:20 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Jun 14 20:51:20 botev-ThinkPad-T440 pptp[9807]: nm-pptp-service-9778 log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Jun 14 20:51:20 botev-ThinkPad-T440 pppd[9783]: Modem hangup
Jun 14 20:51:20 botev-ThinkPad-T440 pppd[9783]: Connect time 0.1 minutes.
Jun 14 20:51:20 botev-ThinkPad-T440 pppd[9783]: Sent 7680 bytes, received 13570 bytes.
Jun 14 20:51:20 botev-ThinkPad-T440 pppd[9783]: MPPE disabled
Jun 14 20:51:20 botev-ThinkPad-T440 pppd[9783]: Connection terminated.
Jun 14 20:51:20 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN plugin state changed: stopping (5)
Jun 14 20:51:20 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN plugin state changed: stopped (6)
Jun 14 20:51:20 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN plugin state change reason: 0
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: Withdrawing workstation service for ppp0.
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: Withdrawing address record for 172.17.31.180 on wlan0.
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 172.17.31.180.
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: Interface wlan0.IPv4 no longer relevant for mDNS.
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: Joining mDNS multicast group on interface wlan0.IPv4 with address 172.17.31.180.
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: New relevant interface wlan0.IPv4 for mDNS.
Jun 14 20:51:20 botev-ThinkPad-T440 avahi-daemon[581]: Registering new address record for 172.17.31.180 on wlan0.IPv4.
Jun 14 20:51:19 botev-ThinkPad-T440 whoopsie[1103]: message repeated 6 times: [ online]
Jun 14 20:51:20 botev-ThinkPad-T440 whoopsie[1103]: offline
Jun 14 20:51:21 botev-ThinkPad-T440 pppd[9783]: Exit.
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]: <info> Policy set 'Hotel Broadband' (wlan0) as default for IPv4 routing and DNS.
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]: <info> Writing DNS information to /sbin/resolvconf
Jun 14 20:51:21 botev-ThinkPad-T440 dnsmasq[3602]: setting upstream servers from DBus
Jun 14 20:51:21 botev-ThinkPad-T440 dnsmasq[3602]: using nameserver 172.17.31.1#53
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]: <warn> error disconnecting VPN: Could not process the request because no VPN connection was active.
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]: <warn> (14) failed to find interface name for index
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]: nm_system_iface_flush_routes: assertion 'iface != NULL' failed
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]: <warn> (14) failed to find interface name for index
Jun 14 20:51:21 botev-ThinkPad-T440 NetworkManager[845]:    SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Jun 14 20:51:20 botev-ThinkPad-T440 whoopsie[1103]: offline
Jun 14 20:51:22 botev-ThinkPad-T440 whoopsie[1103]: online
Jun 14 20:51:24 botev-ThinkPad-T440 ntpdate[9867]: adjust time server 91.189.89.199 offset -0.003853 sec
Jun 14 20:51:27 botev-ThinkPad-T440 NetworkManager[845]: <info> VPN service 'pptp' disappeared

现在遇到非常类似的问题这里这里我也尝试过更改 wlan0 和 ppp0 的 MTU。出于某种原因,wlan0 的上限为 2304,如果我尝试设置 sudo ifconfig wlan0 mtu X更高的值,就会收到错误消息SIOCSIFMTU: Invalid argument。但是对于 ppp0,我设法设置了几乎任何值(尝试了 30000 并且有效)。然而,这并没有帮助解决问题。所以我想知道对我来说是否有任何改变?

我正在使用内核为 3.17 的 Ubuntu 14.04。

答案1

好吧,经过进一步的挖掘和大量实验,我发现我必须降低 wlan0 的 MTU,而不是提高它。据我所知,如果我错了,请纠正,原因可能是其中一个路由器或途中的交换机也具有较低的 MTU,因此尽管它正确发送了数据包,但我的猜测是 VPN 服务器只看到 VPN 数据包中的 MTU,并使用该 MTU 回复。当它们到达此路由器时,它会放弃,因为传入的数据包太大。再次重申,这是我对这个问题的假设。要降低多少,我不能确切地说。我先是 1412,然后是 1400 和 1200,最后在 1000 时最稳定,所以我坚持这个值。如果您遇到这种情况,只需对其进行一些实验即可。

答案2

几分钟前我遇到了这个问题,这就是我的解决方法:

sudo ifconfig ppp0 mtu 1300

此命令仅在此会话中更改了 ppp0 连接的 MTU 大小。

如果您想要永久使用此设置进行连接,请在 /etc/network/if-up.d/ 目录中创建一个新文件,示例:

 sudo vi /etc/network/if-up.d/ppp0-mtu

内容如下:

#!/bin/sh

if [ "$IFACE" = "ppp0" ]; then
    sudo ifconfig ppp0 mtu 1300
fi

使此文件可执行并立即检查您的 VPN 连接

sudo chmod a+x /etc/network/if-up.d/ppp0-mtu

答案3

您可以使用 traceroute 来发现到主机的路径中的较低 mtu。命令是: traceroute <host> --mtu

在我的情况下,较低的 MTU 是 1280,因此我在路由器配置中使用 1200 来创建 vpn。

相关内容