【问题标题】:How to connect android Device to PPTP VPN如何将安卓设备连接到 PPTP VPN
【发布时间】:2015-11-03 04:12:02
【问题描述】:

我已经使用ubuntu's guide 创建了一个 PPTP VPN 服务器。

现在我有:



我现在的问题是我的 android 手机无法连接到我创建的 pptp。当我尝试输入用户名和密码然后点击连接时,我收到的唯一消息是 Connecting... 但之后是 Unsuccessful。

所以我搜索并找到了这个link,以获取有关如何连接到我的 PPTP VPN 的一般概述。我也来了here,但我仍然无法将我的手机连接到 VPN。我完全按照ubuntu's guide 所说的话,我现在不知道该怎么做才能实现我的目标。请提供一些链接或指南,以便我的 android 手机能够连接到我的 PPTP VPN。

服务器的系统日志

Aug 26 14:44:50 jameshwart-System-Product-Name pptpd[31320]: CTRL: Client 192.168.1.27 control connection started
Aug 26 14:44:51 jameshwart-System-Product-Name pptpd[31320]: CTRL: Starting call (launching pppd, opening GRE)
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: pppd 2.4.5 started by root, uid 0
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: Using interface ppp0
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: Connect: ppp0 <--> /dev/pts/24
Aug 26 14:44:51 jameshwart-System-Product-Name NetworkManager[969]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Aug 26 14:44:51 jameshwart-System-Product-Name NetworkManager[969]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Aug 26 14:44:51 jameshwart-System-Product-Name NetworkManager[969]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: peer from calling number 192.168.1.27 authorized
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: Connection terminated.
Aug 26 14:44:51 jameshwart-System-Product-Name NetworkManager[969]:    SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: Exit.
Aug 26 14:44:51 jameshwart-System-Product-Name pptpd[31320]: GRE: read(fd=6,buffer=7f2daa2874a0,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs
Aug 26 14:44:51 jameshwart-System-Product-Name pptpd[31320]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7)
Aug 26 14:44:51 jameshwart-System-Product-Name pptpd[31320]: CTRL: Reaping child PPP[31321]
Aug 26 14:44:51 jameshwart-System-Product-Name pptpd[31320]: CTRL: Client 192.168.1.27 control connection finished

客户端的系统日志

Sent control packet type is 1 'Start-Control-Connection-Request'
Aug 26 14:45:17 felman-To-be-filled-by-O-E-M pptp[10347]: nm-pptp-service-10324 log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Aug 26 14:45:17 felman-To-be-filled-by-O-E-M pptp[10347]: nm-pptp-service-10324 log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Aug 26 14:45:18 felman-To-be-filled-by-O-E-M pptp[10347]: nm-pptp-service-10324 log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Aug 26 14:45:18 felman-To-be-filled-by-O-E-M pptp[10347]: nm-pptp-service-10324 log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Aug 26 14:45:18 felman-To-be-filled-by-O-E-M pptp[10347]: nm-pptp-service-10324 log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 21504).
Aug 26 14:45:18 felman-To-be-filled-by-O-E-M pppd[10328]: CHAP authentication succeeded
Aug 26 14:45:19 felman-To-be-filled-by-O-E-M pppd[10328]: MPPE 128-bit stateless compression e

options.pptp 文件

###############################################################################
# $Id: options.pptp,v 1.3 2006/03/26 23:11:05 quozl Exp $
#
# Sample PPTP PPP options file /etc/ppp/options.pptp
# Options used by PPP when a connection is made by a PPTP client.
# This file can be referred to by an /etc/ppp/peers file for the tunnel.
# Changes are effective on the next connection.  See "man pppd".
#
# You are expected to change this file to suit your system.  As
# packaged, it requires PPP 2.4.2 or later from http://ppp.samba.org/
# and the kernel MPPE module available from the CVS repository also on
# http://ppp.samba.org/, which is packaged for DKMS as kernel_ppp_mppe.
###############################################################################

# Lock the port
lock

# Authentication
# We don't need the tunnel server to authenticate itself
noauth

# We won't do PAP, EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
# (you may need to remove these refusals if the server is not using MPPE)
refuse-pap
refuse-eap
refuse-chap
refuse-mschap

# Compression
# Turn off compression protocols we know won't be used
nobsdcomp
nodeflate

# Encryption
# (There have been multiple versions of PPP with encryption support,
# choose with of the following sections you will use.  Note that MPPE
# requires the use of MSCHAP-V2 during authentication)

# http://ppp.samba.org/ the PPP project version of PPP by Paul Mackarras
# ppp-2.4.2 or later with MPPE only, kernel module ppp_mppe.o
# {{{
# Require MPPE 128-bit encryption
#require-mppe-128
# }}}

# http://polbox.com/h/hs001/ fork from PPP project by Jan Dubiec
# ppp-2.4.2 or later with MPPE and MPPC, kernel module ppp_mppe_mppc.o
# {{{
# Require MPPE 128-bit encryption
mppe required,stateless
# }}}

【问题讨论】:

  • 如果您需要一些帮助,您需要先说明究竟是什么不起作用。您收到什么错误消息?日志中有什么 - 双方?您可以从另一台计算机连接到您的 vpn 吗?
  • 对不起,我刚接触这个,只是按照我发布的教程进行操作。我不知道在哪里可以找到 pptp 服务器的错误日志,尤其是在 android 手机中。我认为我需要在路由器端进行端口转发的任何方式,因为我还没有这样做..
  • 我曾经在 ubuntu 14.04 上将我的 android 连接到一个 pptpd。您可以在 /var/log/syslog 文件中找到 pptpd 的日志信息。请粘贴该信息。
  • @Chris 我已经用日志文件更新了这个问题。请看

标签: android vpn pptp


【解决方案1】:

谢谢大家,但我通过检查我的 pptpd-options 文件并更改
#require-mschap-v2 到 require-mschap-v2
#require-mppe-128 到 require-mppe-128 来解决它

我也改了,像这样去掉#

refuse-pap

refuse-chap

refuse-mschap

newpeople更新:

并确保删除noauth 选项。在他的情况下,因为它在 require-mppe-128 和 require-mschap-v2 之前没有任何效果,但如果你仍然无法做到这一点,请检查 noauth 并将其删除。

【讨论】:

    【解决方案2】:

    我知道这是一个老问题,这可能不适用于这种情况,但我发现的一个简单的解决方案是在 android 上解决 vpn 连接问题,即确保关闭省电模式。我查遍了整个互联网以弄清楚这一点,并偶然发现了它。希望它可以帮助别人。我使用的是 Betternet,它是一个很棒的 VPN 服务,但它无法连接。我关闭了省电模式,它立即连接。

    【讨论】:

      【解决方案3】:

      这么少的信息有点难以猜测。这是基于您的手机正在连接但您无法判断是因为它无法访问互联网或其他网络资源的假设。

      但是,您的手机似乎可能已连接到您的 pptp VPN,但只是没有通过它路由互联网。您可能需要在您的 ubuntu 服务器上设置一个代理并引导您的手机使用它来访问互联网。

      安装微型代理运行:

      sudo apt-get install tinyproxy

      有关如何设置它的教程,请参阅http://www.justinmccandless.com/blog/Set+Up+Tinyproxy+in+Ubuntu

      现在对于手机,有许多应用程序可以帮助您轻松设置手机以使用您刚刚在 vpn 中设置的代理服务器。我使用可以在 Google Play 中找到的 ASProxy。 https://play.google.com/store/apps/details?id=com.Alsu.ASProxy&hl=en

      这个解决方案只是一个猜测。如果没有更多关于你想要达到的目标和你所做的事情的信息,我只是在猜测,可能会离题。

      【讨论】:

      • 感谢您的回答。我用不成功的一些信息更新了我的问题。
      【解决方案4】:

      首先,您需要检查哪一方导致连接失败,客户端还是服务器?您可以使用另一台 PC 代替手机来连接 pptpd 服务器。如果它也失败了,问题可能在服务器端。您可以在/var/log/syslog 中找到日志信息。此外,您可能希望使用 debug 选项重新启动 pptpd 服务器以启用详细日志。

      从你的日志来看,原因如下:

      Aug 26 14:44:51 jameshwart-System-Product-Name pppd[31321]: MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.
      

      它说你的内核不支持 MPPE。你有 ppp_mppe 作为模块启用还是在你的内核中编译?在内核的 .config 文件中,您会看到类似

      的内容
      CONFIG_PPP_MPPE=m 
      

      或

      CONFIG_PPP_MPPE=y
      

      【讨论】:

      • 谢谢先生..我用错误系统日志更新了我的问题
      • 答案已更新!你最好粘贴你的options.pptp。
      • 我还没有走那么远。生病试图找到解决办法。无论如何,我已经用 options.pptp 文件更新了问题
      猜你喜欢
      • 2012-08-20
      • 2016-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多