Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1116929
  • 博文数量: 436
  • 博客积分: 7854
  • 博客等级: 少将
  • 技术积分: 3225
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-18 16:30
文章分类

全部博文(436)

文章存档

2013年(2)

2012年(56)

2011年(70)

2010年(308)

分类:

2010-10-09 16:22:01

Fedora14使用pptp客户端

虽然Fedora 自带的network manager已经带有了vpn的设置功能。但是使用起来非常不方便,经常出现无法连接的情况,初次设置的时候也很容易出错。

最近在网上看到一个比较好用的pptp vpn的客户端设置软件,很顺利的连接上实验室的vpn服务器,特此向大家推荐。

软件的名称叫pptpconfig。安装方法:

  1. 用root身份进入命令行,su
  2. 安装最新版本的pptp,rpm -Uvh http://pptpclient.sourceforge.net/yum/stable/fc6/pptp-release-current.noarch.rpm
  3. 安装pptpconfig,yum –enablerepo=pptp-stable install pptpconfig
  4. 在命令行上运行pptpconfig,设置的时候注意一下,在routing的那一项目里面选择All to tunnel,这样就可以把所有的流量都通过vpn。默认的选项是没有使用vpn的。
  5. 只是要注意的是要把miscellaneous标签下的选项给都选择上,否则会出现输出错误。
       
  6. 其中server标签中的Server为vpn服务器的地址或域名,
  7. Username,Password为登录vpn服务器的用户名和密码。
  8. 点击Routing标签, 选择All to Tunnel
  9.  点击DNS标签,去掉Automatic, 并空置下面两栏不填 
  10. 点击 Encryption标签,去掉所有项

修改配置文件:
在终端执行sudo gedit /etc/ppp/options.pptp
用#号注释掉下面两句
refuse-chap
refuse-mschap
并将Encrption以下的行全部注释掉

这样的话就能很方便的使用pptp了。

网上有人表示会出现乱码的情况,这个时候只需要安装字体就可以解决
yum install xorg-x11-fonts-ISO8859*

--------------------------------------------------------------




http://pptpclient.sourceforge.net/documentation.phtml


1.安装pptp客户端
apt-get install pptp-linux

2.修改pptp客户端密码文件
pap认证pap-secrets
chap认证chap-secrets
中添加
"coffee777" "*" "123456" "*"

3.pptp客户端连接
/etc/ppp/peers下添加文件vpn
name coffee777
pty "pptp 192.168.20.86 --nolaunchpppd"

4.如果连接的VPN服务器上安装有PPTP服务端,去掉/etc/ppp/options中关键字auth

详细配置参数
#########################################
# example configuration for a dialup connection authenticated with PAP or CHAP
#
# This is the default configuration used by pon(1) and poff(1).
# See the manual page pppd(8) for information on all the options.

# MUST CHANGE: replace myusername@realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername@realm"

# MUST CHANGE: replace ******** with the phone number of your provider.
# The /etc/chatscripts/pap chat script may be modified to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"

# Serial device to which the modem is connected.
/dev/modem

# Speed of the serial line.
115200

# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute

# Makes pppd "dial again" when the connection is lost.
persist

# Do not ask the remote to authenticate.
noauth
#########################################

其中
name 为用户名
192.168.20.86为服务器ip

5.pptp客户端命令
连接
pon vpn
断开
poff vpn

前台运行
pon vpn debug dump logfd 2 nodetach

后台运行并生成日志
nohup pon vpn debug dump logfd 2 nodetach &


连接成功,ifconfig显示ppp获取的ip

==================================================
1.
Linux下可以设置:

pptp客户端密码文件中添加:
"coffee777" "pptpd" "123456" "*"

pptp客户端连接文件vpn中添加:
remotename pptpd
pptp为服务器端pptp配置文件pptpd-options中name对应的pptp名称

==================================================
错误提示:
1.
peer refused to authenticate: terminating link
peer refused to authenticate
认证方式不对使用pap-secrets或chap-secrets文件认证

2.Warning - secret file /etc/ppp/pap-secrets has world and/or group access
设置/etc/ppp/pap-secrets权限:chmod 600 /etc/ppp/pap-secrets

3.先提示PAP authentication succeeded,后提示peer refused to authenticate
去掉/etc/ppp/options中关键字auth
日志如下:
pppd options in effect:
debug           # (from command line)
nodetach                # (from command line)
logfd 2         # (from command line)
dump            # (from command line)
auth            # (from /etc/ppp/options)
name coffee777          # (from /etc/ppp/peers/pptp)
                # (from /etc/ppp/options)
pty pptp 219.87.146.170 --nolaunchpppd          # (from /etc/ppp/peers/pptp)
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)
proxyarp                # (from /etc/ppp/options)
noipx           # (from /etc/ppp/options)
using channel 10052
Using interface ppp33
Connect: ppp33 <--> /dev/pts/34
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x0 < 17 04 33 80>]
sent [LCP ConfRej id=0x0 < 17 04 33 80>]
rcvd [LCP ConfAck id=0x1 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfReq id=0x2 ]
sent [LCP ConfAck id=0x2 ]
sent [LCP EchoReq id=0x0 magic=0xfd1e5d8b]
sent [PAP AuthReq id=0x1 user="coffee777" password=]
rcvd [LCP EchoRep id=0x0 magic=0x71b13c88]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
rcvd [LCP ConfReq id=0x4 < 17 04 33 80>]
sent [LCP ConfReq id=0x2 ]
sent [LCP ConfRej id=0x4 < 17 04 33 80>]
rcvd [LCP ConfReq id=0x5 ]
sent [LCP ConfNak id=0x5 ]
rcvd [LCP ConfReq id=0x6 ]
sent [LCP ConfAck id=0x6 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfRej id=0x2 ]
sent [LCP ConfReq id=0x3 ]
rcvd [LCP ConfAck id=0x3 ]
sent [LCP EchoReq id=0x0 magic=0x1c12d257]
peer refused to authenticate: terminating link
sent [LCP TermReq id=0x4 "peer refused to authenticate"]
rcvd [LCP EchoRep id=0x0 magic=0x767a3d44]
rcvd [LCP TermAck id=0x4 "peer refused to authenticate"]
Connection terminated.
Waiting for 1 child processes...
  script pptp 219.87.146.170 --nolaunchpppd, pid 13347
Script pptp 219.87.146.170 --nolaunchpppd finished (pid 13347), status = 0x0

==================================================

--------------------------------------------------------
linux pptp客户端登陆windows pptp服务器:
---------------------------------------------------------
pppd options in effect:
debug           # (from command line)
nodetach                # (from command line)
logfd 2         # (from command line)
dump            # (from command line)
name coffee777          # (from /etc/ppp/peers/vpn)
                # (from /etc/ppp/options)
pty pptp 192.168.20.86 --nolaunchpppd           # (from /etc/ppp/peers/vpn)
using channel 27
Using interface ppp0
Connect: ppp0 <--> /dev/pts/1
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfAck id=0x1 ]
sent [PAP AuthReq id=0x1 user="coffee777" password=]
sent [PAP AuthReq id=0x2 user="coffee777" password=]
sent [PAP AuthReq id=0x3 user="coffee777" password=]
sent [PAP AuthReq id=0x4 user="coffee777" password=]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [PAP AuthAck id=0x2 ""]
rcvd [PAP AuthAck id=0x3 ""]
rcvd [PAP AuthAck id=0x4 ""]
rcvd [CCP ConfReq id=0x1 ]
sent [CCP ConfAck id=0x1 ]
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [CCP ConfRej id=0x1 ]
sent [CCP ConfReq id=0x2 ]
rcvd [IPCP ConfNak id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [CCP ConfAck id=0x2 ]
Deflate (15) compression enabled
rcvd [IPCP ConfAck id=0x2 ]
local  IP address 172.16.0.2
remote IP address 172.16.0.1
Script /etc/ppp/ip-up started (pid 6774)
Script /etc/ppp/ip-up finished (pid 6774), status = 0x1
--------------------------------------------------------
linux pptp客户端登陆windows pptp服务器:
---------------------------------------------------------
pppd options in effect:
debug           # (from command line)
nodetach                # (from command line)
logfd 2         # (from command line)
dump            # (from command line)
name coffee777          # (from /etc/ppp/peers/vpn)
                # (from /etc/ppp/options)
pty pptp 219.87.146.170 --nolaunchpppd          # (from /etc/ppp/peers/vpn)
using channel 18
Using interface ppp0
Connect: ppp0 <--> /dev/pts/1
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfAck id=0x1 ]
rcvd [LCP ConfReq id=0x1 < 17 04 32 d2>]
sent [LCP ConfRej id=0x1 < 17 04 32 d2>]
rcvd [LCP ConfReq id=0x2 ]
sent [LCP ConfNak id=0x2 ]
rcvd [LCP ConfReq id=0x3 ]
sent [LCP ConfAck id=0x3 ]
sent [PAP AuthReq id=0x1 user="coffee777" password=]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [CCP ConfReq id=0x5 ]
sent [CCP ConfRej id=0x5 ]
rcvd [IPCP ConfReq id=0x6 ]
sent [IPCP ConfAck id=0x6 ]
rcvd [CCP ConfRej id=0x1 ]
sent [CCP ConfReq id=0x2]
rcvd [IPCP ConfRej id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [CCP TermReq id=0x7"`\37777777604\001W\000<\37777777715t\000\000\002\37777777734"]
sent [CCP TermAck id=0x7]
rcvd [IPCP ConfNak id=0x2 ]
sent [IPCP ConfReq id=0x3 ]
rcvd [IPCP ConfAck id=0x3 ]
local  IP address 172.0.0.49
remote IP address 172.0.0.9
Script /etc/ppp/ip-up started (pid 6594)
Script /etc/ppp/ip-up finished (pid 6594), status = 0x1
sent [CCP ConfReq id=0x2]
rcvd [CCP TermAck id=0x2]
sent [CCP TermReq id=0x3"No compression negotiated"]
rcvd [CCP TermAck id=0x3"No compression negotiated"]
阅读(5025) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~