V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zs
V2EX  ›  问与答

环境 ubuntu12.04 连接 linode 的 VPN 问题

  •  
  •   zs · 2014-06-20 09:46:59 +08:00 · 4479 次点击
    这是一个创建于 3604 天前的主题,其中的信息可能已经有所发展或是发生改变。
    连接vpn,可以连上,但是打开网站(包括百度网站)时,vpn提示'连接失败'; vpn连上时 Ping 敏感网站可以Ping 的通. vpn服务可以确认可用的,windows里可用!想问下 有人遇到过这种情况么?
    6 条回复    2014-06-21 18:58:10 +08:00
    billlee
        1
    billlee  
       2014-06-20 12:36:36 +08:00
    请出配置和 log
    zs
        2
    zs  
    OP
       2014-06-20 23:51:58 +08:00
    @billlee 服务器是PPTP的, 配置如图




    ubuntu系统的log我是通过

    `tail -f /var/log/syslog | grep pptp` 得到的log 不知道行不行


    ```
    ----------------- 启动VPN
    Jun 20 23:26:39 NetworkManager[973]: <info> Starting VPN service 'pptp'...
    Jun 20 23:26:39 NetworkManager[973]: <info> VPN service 'pptp' started (org.freedesktop.NetworkManager.pptp), PID 4856
    Jun 20 23:26:39 NetworkManager[973]: <info> VPN service 'pptp' appeared; activating connections
    Jun 20 23:26:39 pppd[4860]: Plugin /usr/lib/pppd/2.4.5/nm-pptp-pppd-plugin.so loaded.
    Jun 20 23:26:39 pptp[4862]: nm-pptp-service-4856 log[main:pptp.c:314]: The synchronous pptp option is NOT activated
    Jun 20 23:26:40 pptp[4875]: nm-pptp-service-4856 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
    Jun 20 23:26:40 pptp[4875]: nm-pptp-service-4856 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
    Jun 20 23:26:40 pptp[4875]: nm-pptp-service-4856 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
    Jun 20 23:26:41 pptp[4875]: nm-pptp-service-4856 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
    Jun 20 23:26:41 pptp[4875]: nm-pptp-service-4856 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
    Jun 20 23:26:41 pptp[4875]: nm-pptp-service-4856 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 4736).

    --------用浏览器打开网页 1


    Jun 20 23:27:41 pptp[4875]: nm-pptp-service-4856 log[logecho:pptp_ctrl.c:677]: Echo Request received.
    Jun 20 23:27:41 pptp[4875]: nm-pptp-service-4856 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 6 'Echo-Reply'
    Jun 20 23:27:42 pptp[4875]: nm-pptp-service-4856 log[logecho:pptp_ctrl.c:677]: Echo Reply received.
    Jun 20 23:28:21 pptp[4862]: nm-pptp-service-4856 warn[decaps_gre:pptp_gre.c:331]: short read (-1): Message too long
    Jun 20 23:28:21 pptp[4875]: nm-pptp-service-4856 log[callmgr_main:pptp_callmgr.c:234]: Closing connection (unhandled)
    Jun 20 23:28:21 pptp[4875]: nm-pptp-service-4856 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
    Jun 20 23:28:21 pptp[4875]: nm-pptp-service-4856 log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
    Jun 20 23:28:27 NetworkManager[973]: <info> VPN service 'pptp' disappeared
    ```
    billlee
        3
    billlee  
       2014-06-21 00:14:57 +08:00
    应该是 MTU 设置得太大了
    zs
        4
    zs  
    OP
       2014-06-21 09:54:17 +08:00
    @billlee 我试着将wlan0 的MTU改到900/1200, 打开国内的网站可以,但是用wireshark看了下很多`[TCP previous segment lost] Continuation or non-http traffic `此类错误,导致打开网页很慢,或者根本打不开。 打开敏感网站, 浏览器直接显示无法连接, 在 wireshark 里根本看不到请求..., 当然此时还是可以Ping得通敏感网站, 比如某book.com (平均500ms)
    billlee
        5
    billlee  
       2014-06-21 12:35:13 +08:00   ❤️ 1
    @zs 这个 NetworkManager 具体要怎么改我不是太清楚,但是正确的改 MTU 的方法应该是改 VPN 的 MTU, 一般说来配置正确服务器应该会在 PPP 协商过程中主动要求减小 MTU 的。服务器配置有问题,或者客户端有特别的网络环境减小了 MTU, 才会需要在客户端设置。

    如果敏感网站直接打不开,先检查 DNS 有没有问题。配置正确的服务器会用 PPP 推送 DNS 服务器,如果没有推送就要手工指定为 Google DNS 或者 OpenDNS 什么的。
    zs
        6
    zs  
    OP
       2014-06-21 18:58:10 +08:00
    @billlee 最后看到这个[帖子](http://blog.chinaunix.net/uid-761145-id-127470.html)客户端的mtu改为1500 就好了.... `sudo ifconfig wlan0 1500`
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2269 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 03:08 · PVG 11:08 · LAX 20:08 · JFK 23:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.