免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4685 | 回复: 4
打印 上一主题 下一主题

【求助】关于pppd拨号上GPRS的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-13 10:58 |只看该作者 |倒序浏览
大家好,我在使用redhat 9 的pppd拨号时,总是无法拨上去,提示信息如下:
[root@localhost /]# pppd file /etc/ppp/peers/gprs
pppd options in effect:
debug           # (from /etc/ppp/peers/gprs)
kdebug 7                # (from /etc/ppp/peers/gprs)
nodetach                # (from /etc/ppp/peers/gprs)
dump            # (from /etc/ppp/peers/gprs)
-pap            # (from /etc/ppp/peers/gprs)
papcrypt                # (from /etc/ppp/peers/gprs)
/dev/ttyS0              # (from /etc/ppp/peers/gprs)
115200          # (from /etc/ppp/peers/gprs)
lock            # (from /etc/ppp/options)
connect /etc/ppp/peers/gprs-connect-chat                # (from /etc/ppp/peers/gprs)
disconnect /etc/ppp/peers/gprs-disconnect-chat          # (from /etc/ppp/peers/gprs)
-crtscts                # (from /etc/ppp/peers/gprs)
local           # (from /etc/ppp/peers/gprs)
asyncmap 0              # (from /etc/ppp/peers/gprs)
nomagic         # (from /etc/ppp/peers/gprs)
receive-all             # (from /etc/ppp/peers/gprs)
novj            # (from /etc/ppp/peers/gprs)
novjccomp               # (from /etc/ppp/peers/gprs)
ipcp-accept-local               # (from /etc/ppp/peers/gprs)
ipcp-accept-remote              # (from /etc/ppp/peers/gprs)
defaultroute            # (from /etc/ppp/peers/gprs)
usepeerdns              # (from /etc/ppp/peers/gprs)
:               # (from /etc/ppp/peers/gprs)
nodeflate               # (from /etc/ppp/peers/gprs)
Press CTRL-C to close the connection at any stage!
defining PDP context...
AT
OK
ATS0
OK
AT+CGDCONT=1,"IP","UNIWAP"
OK
AT+CGCLASS="B"
OK
waiting up to 2 mintues for connect...

ATDT*99***1#
CONNECT
Connected. now logging in...

If the following ppp negotiations fail,
try restarting the phone.

Serial connection established.
using channel 48
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <mru 1500> <asyncmap 0x0> <pcomp> <accomp> <auth pap>]
sent [LCP ConfRej id=0x1 <auth pap>]
rcvd [LCP ConfReq id=0x2 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>]
sent [LCP ConfAck id=0x2 <mru 1500> <asyncmap 0x0> <pcomp> <accomp>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [LCP TermReq id=0x3]
LCP terminated by peer
sent [LCP TermAck id=0x3]
Connection terminated.
Serial link disconnected.
[root@localhost /]#


其中:
rcvd [LCP ConfReq id=0x1 <mru 1500> <asyncmap 0x0> <pcomp> <accomp> <auth pap>]
sent [LCP ConfRej id=0x1 <auth pap>]
两句信息提示配置pap验证总是发出拒绝,不知错在哪里?请大家帮忙,谢谢。
还有,我下面的脚本该如何修改?才能正确配置pppd的选项,脚本如下:

gprs文件:

# File:
# /etc/ppp/gprs
#
# Description:
# This file holds the serial cable and IrDA pppd options for GPRS phones
# Tell the ppp-daemon to accept mangled data

receive-all
# Give some debug info
debug
kdebug 7
# Print out all the option values which have been set.
dump
# Serial device to which terminal is connected;
# with serial port (COM1 in Windows) use /dev/ttyS0
# and with IrDA use /dev/ircomm0.
#/dev/ircomm0 # IrDA

/dev/ttyS0 # serial cable (NOTE: 这个为真正用的串口,比如/dev/ttyS0)

# Serial port line speed
115200
# Turn off waiting of carrier detect or flow control signal
# With IrDA it should be disabled with nocrtscts option.

-crtscts # serial cable
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem

local
# To keep pppd on the terminal
nodetach
# Accept the peer's idea of our local IP address
ipcp-accept-local
# Accept the peer's idea of its (remote) IP address
ipcp-accept-remote
# IP addresses:
# - accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects it,
# change the address to something else

0.0.0.0:0.0.0.0
#-chap
-pap
# pppd must not propose any IP address to the peer!
#noipdefault
# No ppp compression

novj
novjccomp
papcrypt
nodeflate
#No ppp magic number
nomagic
# no asyn cmap
asyncmap 0
# Add default route
defaultroute
#Auto get IP address
usepeerdns
# Connect script
connect /etc/ppp/peers/gprs-connect-chat
# Disconnect script
disconnect /etc/ppp/peers/gprs-disconnect-chat

gprs-connect-chat文件:

#!/bin/sh
#
# File:
# /etc/ppp/gprs-connect-chat
#
# Description:
# chat script to open Sonera GPRS service with GPRS phones. If ppp
# negotiation stalls, try restarting the phone. To try with other GPRS
# operator setting, change the PDP contex setting. The settings work with
# all Ericsson models, but Nokia 8310 does not suppor QoS parameters with
# AT commands, so just delete those lines and it'll work.
#
# Set PDP context CID=1, protocol=IP, APN=internet:
# AT+CGDCONT=1,"IP","internet","",0,0
#
# Set CID=1 QoS requirements from the network, not supported by 8310:
# AT+CGQREQ=1,0,0,0,0,0
#
# Set CID=1 minimum acceptable QoS parameters, not supported by 8310:
# AT+CGQMIN=1,0,0,0,0,0
#
# 'Call' CID=1 (activate PDP context one, perform GPRS attach):
# ATD*99***1#
#
# ogin:-BREAK-ogin:
# TIMEOUT 5
# assword:
# SAY "\nLogged in OK...\n"
# The actual chat script:

exec chat \
TIMEOUT 5 \
ECHO ON \
ABORT 'BUSY' \
ABORT 'ERROR' \
ABORT 'NO ANSWER' \
ABORT 'NO CARRIER' \
ABORT 'NO DIALTONE' \
ABORT 'RINGING' \
'' AT \
TIMEOUT 12 \
SAY "Press CTRL-C to close the connection at any stage!" \
SAY "\ndefining PDP context...\n" \
OK ATE0 \
OK ATS0 \
OK 'AT+CGDCONT=1,"IP","UNIWAP"' \
OK 'AT+CGCLASS="B"' \
OK ATDT*99***1# \
TIMEOUT 120 \
SAY "\nwaiting up to 2 mintues for connect...\n" \
CONNECT "" \
SAY "\nConnected. now logging in...\n" \
SAY "\nIf the following ppp negotiations fail,\n" \
SAY "try restarting the phone.\n" \
# NOTE: PDP context可能会因你的猫不同而有所区别,查它的手册来写吧

gprs-disconnect-chat文件:

#!/bin/sh
#
# File:
# /etc/ppp/gprs-disconnect-chat
#
# send break

exec /usr/sbin/chat -V -s -S
ABORT "BUSY"
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"" "\K"
"" "+++ATH"
SAY "\nPDP context detached\n"

pap-secrets文件:

# File:
#/etc/ppp/pap-secrets
# Secrets for authentication using PAP
# client server secret IP addresses
####### redhat-config-network will overwrite this part!!! (begin) ##########
####### redhat-config-network will overwrite this part!!! (end) ############

foo * "" *

options文件:

# File:
# /etc/ppp/options
#
receive-all
nopcomp
noaccomp
nomagic
debug
# Mobile is connected to the first serial port
/dev/ttyS0 # (NOTE: 这个地方你要改为真正的你用的串口,比如/dev/ttyS0)
115200
connect '/usr/sbin/chat -e -f /etc/ppp/gprs-connect-chat -v'
disconnect '/usr/sbin/chat -e -f /etc/ppp/chat-disconnect -v'
modem
noauth
noccp
novj
novjccomp
defaultroute
noipdefault
user foo #(NOTE:这个很重要,windows下拨号可以不用用户名,但Linux不行,所以我们骗linux一下,设一个假的好了,另外,还要参见/etc/pap-secrets,呵呵)
lock

论坛徽章:
0
2 [报告]
发表于 2008-11-14 08:10 |只看该作者

回复 #1 xinuaile2003 的帖子

问题解决了,我放错目录了。

论坛徽章:
95
程序设计版块每日发帖之星
日期:2015-09-05 06:20:00程序设计版块每日发帖之星
日期:2015-09-17 06:20:00程序设计版块每日发帖之星
日期:2015-09-18 06:20:002015亚冠之阿尔艾因
日期:2015-09-18 10:35:08月度论坛发贴之星
日期:2015-09-30 22:25:002015亚冠之阿尔沙巴布
日期:2015-10-03 08:57:39程序设计版块每日发帖之星
日期:2015-10-05 06:20:00每日论坛发贴之星
日期:2015-10-05 06:20:002015年亚冠纪念徽章
日期:2015-10-06 10:06:482015亚冠之塔什干棉农
日期:2015-10-19 19:43:35程序设计版块每日发帖之星
日期:2015-10-21 06:20:00每日论坛发贴之星
日期:2015-09-14 06:20:00
3 [报告]
发表于 2008-11-14 09:41 |只看该作者
原帖由 xinuaile2003 于 2008-11-14 08:10 发表
问题解决了,我放错目录了。

详细说说。

类似的问题以前也有人问过,最后好像是不了了之。。。

论坛徽章:
0
4 [报告]
发表于 2008-11-14 15:09 |只看该作者
原帖由 MMMIX 于 2008-11-14 09:41 发表

详细说说。

类似的问题以前也有人问过,最后好像是不了了之。。。




一般网上看到的都是把那些脚本文件都放到/etc/ppp/peers当中,而pppd默认的路径是/etc/ppp,而在/etc/ppp当中的options文件是没有参数的,造成拨号失败,我最后把所有用到的脚本文件都放到/etc/ppp目录中,拨号就成功了。

论坛徽章:
0
5 [报告]
发表于 2008-11-14 15:14 |只看该作者
使用上面脚本时,要把gprs文件中的
#-chap
-pap
改成
-chap
#-pap
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP