当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : Ubuntu上用VPN的奇怪问题。询遍论坛,也没找到解决方法。
帖子发表于 : 2007-12-21 22:47 

注册: 2007-07-02 21:46
帖子: 18
送出感谢: 0 次
接收感谢: 0 次
我要用pptp-linux 连接公司的VPN。认证类型是PAP!!!

第一,安装包:sudo apt-get install pptp-linux pptpconfig

第二,配置文件:
文件1-->/etc/network/interfaces

auto lo
iface lo inet loopback
iface eth2 inet static
address 192.168.1.17
netmask 255.255.255.0
auto tunnel
iface tunnel inet ppp
provider vpn_pap

文件2-->/etc/ppp/peer/vpn_pap

# tunnel vpn_pap, written by pptpconfig $Revision: 1.12 $
# name of tunnel, used to select lines in secrets files
remotename vpn_pap
# name of tunnel, used to name /var/run pid file
linkname vpn_pap
# name of tunnel, passed to ip-up scripts
ipparam vpn_pap
# data stream for pppd to use
pty "pptp 202.38.77.77 --nolaunchpppd "
# domain and username, used to select lines in secrets files
name marco
nomppe-40
nomppe-128
mppe-stateful
refuse-eap
debug dump
# do not require the server to authenticate to our client
noauth
# adopt defaults from the pptp-linux package
file /etc/ppp/options.pptp
# end of tunnel file

文件3 --> /etc/ppp/pap-secrets
# +++ pptpconfig added for tunnel vpn_pap
marco vpn_pap 328251 *
# --- pptpconfig added for tunnel vpn_pap

文件4 --> /etc/ppp/options.pptp
lock
noauth
# We won't do EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
refuse-eap
refuse-chap
refuse-mschap
refuse-mschap-v2
#refuse-pap
nobsdcomp
nodeflate
nomppe

上面就是我的配置。我想要连接vpn的时候,只要sudo ifup tunnel就可以连接vpn了。
但是遇到一个问题。sudo ifup tunnel的时候,出现了下面的提示:

chicken37@sohu:/etc/ppp$ sudo ifup tunnel
tunnel: ERROR while getting interface flags: No such device
pppd options in effect:
debug debug # (from /etc/ppp/peers/vpn_pap)
linkname vpn_pap # (from /etc/ppp/peers/vpn_pap)
dump # (from /etc/ppp/peers/vpn_pap)
noauth # (from /etc/ppp/options.pptp)
refuse-chap # (from /etc/ppp/options.pptp)
refuse-mschap # (from /etc/ppp/options.pptp)
refuse-mschap-v2 # (from /etc/ppp/options.pptp)
refuse-eap # (from /etc/ppp/options.pptp)
name marco # (from /etc/ppp/peers/vpn_pap)
remotename vpn_pap # (from /etc/ppp/peers/vpn_pap)
# (from /etc/ppp/options.pptp)
pty pptp 202.38.77.77 --nolaunchpppd # (from /etc/ppp/peers/vpn_pap)
noaccomp # (from /etc/ppp/options)
mtu 1000 # (from /etc/ppp/options)
nopcomp # (from /etc/ppp/options)
novj # (from /etc/ppp/options)
ipparam vpn_pap # (from /etc/ppp/peers/vpn_pap)
defaultroute # (from /etc/ppp/options)
nobsdcomp # (from /etc/ppp/options.pptp)
nodeflate # (from /etc/ppp/options.pptp)
nomppe # (from /etc/ppp/options.pptp)
# (from /etc/ppp/peers/vpn_pap)
nomppe-128 # (from /etc/ppp/peers/vpn_pap)
mppe-stateful # (from /etc/ppp/peers/vpn_pap)

上面有这么一句
tunnel: ERROR while getting interface flags: No such device
我估计是这里有问题。
而且ifconfig 后,显示信息中,没有ppp0,只有目前网口eth0的信息。

各位大侠,我不知道哪里错误了??请帮忙看看。


最后由 MSMALLJI 编辑于 2008-01-03 16:39,总共编辑了 2 次

页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2007-12-21 22:50 

注册: 2007-07-02 21:46
帖子: 18
送出感谢: 0 次
接收感谢: 0 次
我也把pptpconfig的log写上吧,但愿有点帮助。

pptpconfig: debug information dump begins
WARNING: security sensitive information follows
pptpconfig 1.12 2006/08/21 06:19:12
# pptp --version
pptp: unrecognized option `--version'
pptp version 1.7.0
Usage:
pptp <hostname> [<pptp options>] [[--] <pppd options>]

Or using pppd's pty option:
pppd pty "pptp <hostname> --nolaunchpppd <pptp options>"

Available pptp options:
--phone <number> Pass <number> to remote host as phone number
--nolaunchpppd Do not launch pppd, for use as a pppd pty
--quirks <quirk> Work around a buggy PPTP implementation
Currently recognised values are BEZEQ_ISRAEL only
--debug Run in foreground (for debugging with gdb)
--sync Enable Synchronous HDLC (pppd must use it too)
--timeout <secs> Time to wait for reordered packets (0.01 to 10 secs)
--nobuffer Disable packet buffering and reordering completely
--idle-wait Time to wait before sending echo request
--max-echo-wait Time to wait before giving up on lack of reply
--logstring <name> Use <name> instead of 'anon' in syslog messages
--localbind <addr> Bind to specified IP address instead of wildcard
--loglevel <level> Sets the debugging level (0=low, 1=default, 2=high)
# pppd --version
pppd version 2.4.4
# uname -a
Linux yahoo 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007 i686 GNU/Linux
# modinfo ppp_mppe || modinfo ppp_mppe_mppc
filename: /lib/modules/2.6.22-14-generic/kernel/drivers/net/ppp_mppe.ko
version: 1.0.2
alias: ppp-compress-18
license: Dual BSD/GPL
description: Point-to-Point Protocol Microsoft Point-to-Point Encryption support
author: Frank Cusack <fcusack@fcusack.com>
srcversion: 39166EF06A40CF00F255FC5
depends: ppp_generic
vermagic: 2.6.22-14-generic SMP mod_unload 586
# grep mppe /proc/modules
Array
(
[name] => vpn_pap
[server] => 61.135.152.203
[domain] =>
[username] => xiaoyue1
[password] => (hidden by pptpconfig)
[pppd-options] =>
[pptp-options] =>
[resolv] =>
[dns-options] =>
[routing] => routing_all_to_tunnel
[usepeerdns] =>
[require-mppe] =>
[nomppe-40] => 1
[nomppe-128] => 1
[refuse-eap] => 1
[mppe-stateful] => 1
[autostart] => 1
[iconify] =>
[persist] =>
[debug] => 1
[client-to-lan] => a:1:{s:10:"10.0.0.0/8";s:3:"vpn";}
)
# route -n (before pppd)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth2
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth2
pptpconfig: debug information dump ends, starting pppd
pppd options in effect:
debug debug # (from /etc/ppp/peers/vpn_pap)
updetach # (from command line)
logfd 1 # (from command line)
linkname vpn_pap # (from /etc/ppp/peers/vpn_pap)
dump # (from /etc/ppp/peers/vpn_pap)
noauth # (from /etc/ppp/options.pptp)
refuse-chap # (from /etc/ppp/options.pptp)
refuse-mschap # (from /etc/ppp/options.pptp)
refuse-mschap-v2 # (from /etc/ppp/options.pptp)
refuse-eap # (from /etc/ppp/options.pptp)
name xiaoyue1 # (from /etc/ppp/peers/vpn_pap)
remotename vpn_pap # (from /etc/ppp/peers/vpn_pap)
# (from /etc/ppp/options.pptp)
pty pptp 61.135.152.203 --nolaunchpppd # (from /etc/ppp/peers/vpn_pap)
noaccomp # (from /etc/ppp/options)
mtu 1000 # (from /etc/ppp/options)
nopcomp # (from /etc/ppp/options)
novj # (from /etc/ppp/options)
ipparam vpn_pap # (from /etc/ppp/peers/vpn_pap)
defaultroute # (from /etc/ppp/options)
nobsdcomp # (from /etc/ppp/options.pptp)
nodeflate # (from /etc/ppp/options.pptp)
nomppe # (from /etc/ppp/options.pptp)
# (from /etc/ppp/peers/vpn_pap)
nomppe-128 # (from /etc/ppp/peers/vpn_pap)
mppe-stateful # (from /etc/ppp/peers/vpn_pap)
using channel 7
Using interface ppp0
pptpconfig: monitoring interface ppp0
Connect: ppp0 <--> /dev/pts/1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4d934942>]
LCP: timeout sending Config-Requests
Connection terminated.
Modem hangup
Waiting for 1 child processes...
script pptp 61.135.152.203 --nolaunchpppd , pid 6801
Script pptp 61.135.152.203 --nolaunchpppd finished (pid 6801), status = 0x0
# route -n (after pppd exit)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth2
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth2
pptpconfig: pppd process terminated by signal 16 (failed)
pptpconfig: SIGUSR1
# route -n (after completion)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth2
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth2


最后由 MSMALLJI 编辑于 2008-01-03 16:42,总共编辑了 1 次

页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2007-12-24 21:32 

注册: 2007-07-02 21:46
帖子: 18
送出感谢: 0 次
接收感谢: 0 次
顶下。


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2008-01-01 22:35 

注册: 2007-07-02 21:46
帖子: 18
送出感谢: 0 次
接收感谢: 0 次
再顶


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译