# 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作者: xinuaile2003 时间: 2008-11-14 08:10 标题: 回复 #1 xinuaile2003 的帖子 问题解决了,我放错目录了。作者: MMMIX 时间: 2008-11-14 09:41