LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2225|回复: 16

有人用pptp连接VPN成功吗?

[复制链接]
发表于 2010-9-8 21:19:38 | 显示全部楼层 |阅读模式
我有一个VPN帐号,支持pptp,但好像不支持openvpn
我安装了pptpclient后,按照网上的教程配置好,但连接总不成功,高人看一下哪里出问题?
提示信息:

[/etc/ppp]$ sudo pon vpn debug dump logfd 2 nodetach
密码:
pppd options in effect:
debug                # (from command line)
nodetach                # (from command line)
logfd 2                # (from command line)
dump                # (from command line)
noauth                # (from /etc/ppp/options.pptp)
refuse-pap                # (from /etc/ppp/options.pptp)
refuse-chap                # (from /etc/ppp/options.pptp)
refuse-mschap                # (from /etc/ppp/options.pptp)
refuse-eap                # (from /etc/ppp/options.pptp)
name test                # (from /etc/ppp/peers/vpn)
remotename vpn                # (from /etc/ppp/peers/vpn)
                # (from /etc/ppp/options.pptp)
pty pptp ca02.veryfastvpn.com --nolaunchpppd                # (from /etc/ppp/peers/vpn)
crtscts                # (from /etc/ppp/options)
                # (from /etc/ppp/options)
asyncmap 0                # (from /etc/ppp/options)
lcp-echo-failure 4                # (from /etc/ppp/options)
lcp-echo-interval 30                # (from /etc/ppp/options)
hide-password                # (from /etc/ppp/options)
ipparam vpn                # (from /etc/ppp/peers/vpn)
proxyarp                # (from /etc/ppp/options)
usepeerdns                # (from /etc/ppp/peers/vpn)
nobsdcomp                # (from /etc/ppp/options.pptp)
nodeflate                # (from /etc/ppp/options.pptp)
require-mppe-40                # (from /etc/ppp/peers/vpn)
                # (from /etc/ppp/peers/vpn)
noipx                # (from /etc/ppp/options)
using channel 12
Using interface ppp0
Connect: ppp0 <--> /dev/pts/3
anon warn[open_inetsock:pptp_callmgr.c:329]: connect: No route to host
anon fatal[callmgr_main:pptp_callmgr.c:127]: Could not open control connection to 74.82.202.123
anon fatal[open_callmgr:pptp.c:479]: Call manager exited with error 256
Script pptp ca02.veryfastvpn.com --nolaunchpppd finished (pid 4048), status = 0x1
Modem hangup
Connection terminated.

配置文件:



cat chap-secrets

# Secrets for authentication using CHAP
# client        server        secret                        IP addresses




# added by pptpsetup for vpn
ca02.veryfastvpn.com\test vpn "test" *





cat 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
# }}}





cat vpn

# written by pptpsetup
pty "pptp ca02.veryfastvpn.com --nolaunchpppd"
lock
noauth
#nobsdcomp
#nodeflate
name test
remotename vpn
#usepeerdns
ipparam vpn
require-mppe-128
#require-mppe-40
#refuse-eap
file /etc/ppp/options.pptp




其中提示信息中的:
Connect: ppp0 <--> /dev/pts/3
这一行有点问题
因为我的
ls /dev/pts

只有4个文件
ls /dev/pts -l
总用量 0
crw--w---- 1 test tty  136, 0  9月  8 19:21 0
crw--w---- 1 test tty  136, 1  9月  8 19:08 1
crw--w---- 1 test tty  136, 2  9月  8 21:15 2
c--------- 1 root root   5, 2  9月  9 2010 ptmx

我的系统完全没有/dev/pts/3这个文件
不知这个文件是pptp创建的,还是pptp需要的?

请高人看一下我的哪里出问题了
谢谢
发表于 2010-9-8 22:12:03 | 显示全部楼层
pptp从来就没成功过
希望成功的人士分享下经验
回复 支持 反对

使用道具 举报

发表于 2010-9-8 23:12:25 | 显示全部楼层
问题在一开始就出现了:

anon warn[open_inetsockptp_callmgr.c:329]: connect: No route to host
anon fatal[callmgr_mainptp_callmgr.c:127]: Could not open control connection to 74.82.202.123

麻烦你先检查一下这个
回复 支持 反对

使用道具 举报

发表于 2010-9-8 23:27:23 | 显示全部楼层
我也是没成功过。。。关注。
回复 支持 反对

使用道具 举报

发表于 2010-9-9 01:20:42 | 显示全部楼层
哈哈哈哈,我一直是成功的
根据这个设置的,非常简单
http://pptpclient.sourceforge.net/howto-debian.phtml
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-9-9 09:19:12 | 显示全部楼层
楼上的发行版是archlinux吗?

我根据这个设置
http://pptpclient.sourceforge.net/howto-debian.phtml
出现的是同样的故障

并且上面的文档没有关于archlinux的
回复 支持 反对

使用道具 举报

发表于 2010-9-9 10:08:35 | 显示全部楼层
我是使用这个http://aur.archlinux.org/packages.php?ID=13939
用的是vpn98
但从没成功过
anon warn [open_inetsock: pptp_callmgr.c:329]: connect: connect timed out
anon fatal [callmgr_main: pptp_callmgr.c:127]: could not open control connection to 59.24.3.173



  1. Sep  9 11:57:20 localhost pptp[9846]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
  2. Sep  9 11:57:20 localhost pptp[9850]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
  3. Sep  9 11:57:20 localhost pptp[9850]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
  4. Sep  9 11:57:20 localhost pptp[9850]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
  5. Sep  9 11:57:21 localhost pptp[9850]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
  6. Sep  9 11:57:21 localhost pptp[9850]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
  7. Sep  9 11:57:21 localhost pptp[9850]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 53120).
  8. Sep  9 11:57:24 localhost pptp[9846]: anon log[decaps_gre:pptp_gre.c:414]: buffering packet 7 (expecting 6, lost or reordered)
  9. Sep  9 11:57:25 localhost pptp[9850]: anon log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed
  10. Sep  9 11:57:25 localhost pptp[9850]: anon log[callmgr_main:pptp_callmgr.c:258]: Closing connection (shutdown)
  11. Sep  9 11:57:25 localhost pptp[9850]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
  12. Sep  9 11:57:25 localhost pptp[9850]: anon log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed
  13. Sep  9 11:57:25 localhost pptp[9850]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
  14. ^_^ ~ $
复制代码
回复 支持 反对

使用道具 举报

发表于 2010-9-9 10:22:37 | 显示全部楼层
用networkmanager成功连接过
装上networkmanager-pptp就行。
回复 支持 反对

使用道具 举报

发表于 2010-9-9 15:37:44 | 显示全部楼层
安装pptpclient
用pptpsetup建立一个VPN TUNNEL(也可以自己在/etc/ppp/peers下手工创建配置文件),详细命令行参数用pptpsetup --help可以看到,应该很容易理解。

创建完TUNNEL以后,因为我用的是netcfg,所以直接修改/etc/netword.d里的连接配置文件,加上
POST_UP="pon 你的TUNNEL名"
用networkmanager的同学请自行摸索。
现在如果你顺利连网了以后,ppp就会自动建立了,用ifconfig会看到多了一个ppp0的连接。

光连通vpn其实还不够的,接下来应该还要做些网络配置,至少你得配一下网关,否则那个连接就是个摆设。例如我希望访问google dns的连接都通过ppp0出去,可以这样:
route add -net 8.8.0.0 netmask 255.255.0.0 dev ppp0
为了每次联通vpn都能自动配置网络,可以在/etc/ppp/ip-up.d里加上一个01-routes.sh,内容如:
#!/bin/sh
PATH=$PATH:sbin
route add -net 8.8.0.0 netmask 255.255.0.0 dev ppp0
当然你可以按自己需要来配置,甚至将网关配置为所有连接都走vpn都没问题。

官方wiki也有相关内容:
http://wiki.archlinux.org/index. ... tup_with_pptpclient
回复 支持 反对

使用道具 举报

发表于 2010-9-9 19:03:52 | 显示全部楼层
@ zlowly


怪异的是pon vpn不行,一定要pon 2 nodetach才行
这是何故?


PS:汗,原来是连接需要时间,我在没连上的时候ifconfig看了....
成功了.....

总结下
配置
sudo pptpsetup --create vpnname --server vpnserver --username name --password 123456 --encrypt
OK了,然后
pon vpnname
route add default dev ppp0(ppp0可能为其他....例如ppp1,ifconfig看下)
成功!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表