我的 pptp 连接无法保持连接,不到一分钟就会断开
以下是一些相关的日志条目
May 31 13:32:31 localhost NetworkManager[931]: <info> Starting VPN service 'pptp'...
May 31 13:32:31 localhost NetworkManager[931]: <info> VPN service 'pptp' started (org.freedesktop.NetworkManager.pptp), PID 15216
May 31 13:32:31 localhost NetworkManager[931]: <info> VPN service 'pptp' appeared; activating connections
May 31 13:32:31 localhost NetworkManager[931]: <info> VPN plugin state changed: init (1)
May 31 13:32:31 localhost NetworkManager[931]: <info> VPN plugin state changed: starting (3)
May 31 13:32:31 localhost NetworkManager[931]: <info> VPN connection 'Dynalabs' (Connect) reply received.
May 31 13:32:31 localhost pppd[15221]: Plugin /usr/lib/pppd/2.4.5/nm-pptp-pppd-plugin.so loaded.
May 31 13:32:31 localhost pppd[15221]: pppd 2.4.5 started by root, uid 0
May 31 13:32:31 localhost pptp[15224]: nm-pptp-service-15216 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
May 31 13:32:31 localhost pppd[15221]: Using interface ppp0
May 31 13:32:31 localhost pppd[15221]: Connect: ppp0 <--> /dev/pts/5
May 31 13:32:31 localhost NetworkManager[931]: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
May 31 13:32:31 localhost NetworkManager[931]: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
May 31 13:32:32 localhost pptp[15235]: nm-pptp-service-15216 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
May 31 13:32:32 localhost pptp[15235]: nm-pptp-service-15216 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
May 31 13:32:32 localhost pptp[15235]: nm-pptp-service-15216 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
May 31 13:32:33 localhost pptp[15235]: nm-pptp-service-15216 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
May 31 13:32:34 localhost pptp[15235]: nm-pptp-service-15216 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
May 31 13:32:34 localhost pptp[15235]: nm-pptp-service-15216 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 1536).
May 31 13:32:37 localhost pppd[15221]: CHAP authentication succeeded
May 31 13:32:37 localhost kernel: [54007.078553] PPP MPPE Compression module registered
May 31 13:32:40 localhost pppd[15221]: MPPE 128-bit stateless compression enabled
May 31 13:32:42 localhost pppd[15221]: local IP address 10.100.0.52
May 31 13:32:42 localhost pppd[15221]: remote IP address 10.100.0.1
May 31 13:32:42 localhost pppd[15221]: primary DNS address 4.2.2.1
May 31 13:32:42 localhost pppd[15221]: secondary DNS address 255.255.255.255
May 31 13:32:42 localhost NetworkManager[931]: <info> VPN connection 'Dynalabs' (IP Config Get) reply received.
May 31 13:32:42 localhost NetworkManager[931]: <info> VPN Gateway: 103.28.219.2
May 31 13:32:42 localhost NetworkManager[931]: <info> Tunnel Device: ppp0
May 31 13:32:42 localhost NetworkManager[931]: <info> Internal IP4 Address: 10.100.0.52
May 31 13:32:42 localhost NetworkManager[931]: <info> Internal IP4 Prefix: 32
May 31 13:32:42 localhost NetworkManager[931]: <info> Internal IP4 Point-to-Point Address: 10.100.0.1
May 31 13:32:42 localhost NetworkManager[931]: <info> Maximum Segment Size (MSS): 0
May 31 13:32:42 localhost NetworkManager[931]: <info> Forbid Default Route: no
May 31 13:32:42 localhost NetworkManager[931]: <info> Internal IP4 DNS: 4.2.2.1
May 31 13:32:42 localhost NetworkManager[931]: <info> Internal IP4 DNS: 255.255.255.255
May 31 13:32:42 localhost NetworkManager[931]: <info> DNS Domain: '(none)'
May 31 13:32:43 localhost dnsmasq[2127]: exiting on receipt of SIGTERM
May 31 13:32:43 localhost NetworkManager[931]: <info> DNS: starting dnsmasq...
May 31 13:32:43 localhost NetworkManager[931]: <info> (ppp0): writing resolv.conf to /sbin/resolvconf
May 31 13:32:43 localhost dnsmasq[15290]: error at line 2 of /var/run/nm-dns-dnsmasq.conf
May 31 13:32:43 localhost dnsmasq[15290]: FAILED to start up
May 31 13:32:43 localhost NetworkManager[931]: <info> VPN connection 'Dynalabs' (IP Config Get) complete.
May 31 13:32:43 localhost NetworkManager[931]: <info> Policy set 'Dynalabs' (ppp0) as default for IPv4 routing and DNS.
May 31 13:32:43 localhost NetworkManager[931]: <info> VPN plugin state changed: started (4)
May 31 13:32:43 localhost NetworkManager[931]: <warn> dnsmasq exited with error: Configuration problem (1)
May 31 13:32:43 localhost NetworkManager[931]: <info> (ppp0): writing resolv.conf to /sbin/resolvconf
May 31 13:32:43 localhost dbus[872]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
May 31 13:32:43 localhost dbus[872]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
May 31 13:33:00 localhost ntpdate[15370]: step time server 91.189.94.4 offset -1.110301 sec
May 31 13:33:21 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xd6d6
May 31 13:33:21 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x93aa
May 31 13:33:21 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xcc83
May 31 13:33:21 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x2031
May 31 13:33:21 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x13d4
May 31 13:33:22 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x5b11
May 31 13:33:22 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x414b
May 31 13:33:22 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x2f5f
May 31 13:33:22 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xe9ff
May 31 13:33:23 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x8e20
May 31 13:33:23 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x8f0
May 31 13:33:23 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xf166
May 31 13:33:23 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x36e6
May 31 13:33:23 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xdd19
May 31 13:33:23 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xda26
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xac5
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x53a5
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x507e
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x1dc5
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xf87b
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x2f27
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xd10c
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x66ef
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xa294
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xb15
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x52a2
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xd863
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x8a96
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xde19
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x9763
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xb23
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x83ca
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x964e
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xe8ae
May 31 13:33:24 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xf614
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x9b1
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xf086
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xbff4
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x66c5
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xe42
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xf295
May 31 13:33:25 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x86fe
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x3bc1
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xbaad
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x88b5
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xd7a
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x30d5
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x2d8f
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x3933
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x8d42
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x4b4
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xa205
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x7cc5
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x1b6a
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0xf004
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x21b6
May 31 13:33:26 localhost pppd[15221]: Protocol-Reject for unsupported protocol 0x51eb
答案1
当我尝试从运行 OpenWRT 的路由器连接到运行 RouterOS 的另一个路由器时,我遇到了同样的问题。这两个操作系统都基于 Linux,所以我期望集成过程不会很麻烦。我发现在看似随机的时间间隔内,ppp 隧道会停止工作,但不会断开连接。您提到的相同错误也出现在我的调试日志中。
经过一些调试后,我发现随机间隔并不是随机的,而是与隧道上传输的高流量相吻合——当我通过 PPTP 隧道运行备份时。我解决问题的方法是通过将以下行添加到我的/etc/ppp/options.pptp
(文件的位置和名称可能与您运行的发行版不同) 中来禁用 CCP 压缩:
noccp
答案2
您尝试连接的 PPTP 服务器可能不支持某些压缩功能。
您可以尝试禁用(全部):
- BSD 压缩;
- 放气压缩;
- TCP 报头压缩。
对于某些 Windows PPTP 服务器,禁用 PPP Echo 数据包发送也可能有帮助。
您会在 VPN 连接的配置窗口 (VPN 选项卡 -> 高级) 中找到这些选项。
如果禁用压缩功能不能解决您的问题,那么它也可能与我们在您的日志摘录中看到的 DNS 错误有关。
尝试手动设置 DNS,如下所示:转到 VPN 连接的配置窗口,在 IPv4 参数选项卡中,将方法更改为“仅自动地址(VPN)”。然后输入 DNS 服务器的地址以及搜索域。如果您不知道这些,请咨询您的网络管理员。
我希望这将帮助您解决连接问题。
答案3
我在 13.04 上遇到了同样的问题
我认为这与这个错误有关: https://bugs.launchpad.net/ubuntu/+source/network-manager-pptp/+bug/290178
检查你的/var/log/syslog
线条协议-拒绝不支持的协议
几个月前我已经解决了这个问题,安装了一些来自 debian stable 的软件包
另请检查:
https://forum.linode.com/viewtopic.php?p=36204/
mtu 1400
,并检查 gre 协议和 1723 端口是否开放。
答案4
当我尝试从 Ubuntu 14.04 连接到 Windows VPN 服务器时,我也会看到 PPTP 断开连接,并在我的 中发现此错误/var/log/syslog
,
“nm-pptp-service-9270 warn[ctrlp_disp:pptp_ctrl.c:956]: 不支持非零异步控制字符映射!”
我找到了答案本论坛。建议是:Windows VPN 仅适用于 mppe 身份验证。要使用此功能,请在/etc/ppp/options.pptp
refuse-pap
refuse-eap
refuse-chap
refuse-mschap
require-mppe
或者转到图形网络管理器中 VPN 的高级设置,确保仅选中 MSCHAPv2。取消选中其他(pap、chap、mschap、eap)并启用 mppe。