软件版本支持
pppd version 2.4.3
硬件支持
gprs 模块 wavecom Q2403A
拨号脚本
#cat /etc/ppp/peers/gprs
# write by lee
# Usage: root>pppd call gprs
/dev/ttyS3
115200
nocrtscts
modem
#noauth
debug
nodetach
#hide-password
usepeerdns
noipdefault
defaultroute
user "cmnet"
0.0.0.0:0.0.0.0
ipcp-accept-local
ipcp-accept-remote
#lcp-echo-failure 12
#lcp-echo-interval 3
noccp
#novj
#novjccomp
persist
connect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat'
#connect '/bin/chat -v -s -f /etc/ppp/gprs-connect-chat'
#disconnect '/bin/chat -v -f /etc/ppp/gprs-disconnect-chat'
#cat /etc/ppp/gprs-connect-chat
# chat script for China Mobile, used wavecom module by lee.
TIMEOUT 15
ABORT '\nDELAYED\r'
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nNO CARRIER\r'
'' \rAT
OK ATS0=0
OK ATE0V1
OK AT+CGDCONT=1,"IP","CMNET"
OK ATDT*99***1#
CONNECT ''
#cat /etc/ppp/chap-secrets
#client server secret IP address
"cmnet" * "cmnet" *
#cat /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) ############
sss * 123456
拨号出现如下错误
#pppd call gprs
timeout set to 15 seconds
abort on (\nDELAYED\r)
abort on (\nBUSY\r)
abort on (\nERROR\r)
abort on (\nNO DIALTONE\r)
abort on (\nNO CARRIER\r)
send (^MAT^M)
expect (OK)
^M
OK
-- got it
send (ATS0=0^M)
expect (OK)
^M
^M
OK
-- got it
send (ATE0V1^M)
expect (OK)
^M
^M
OK
-- got it
send (AT+CGDCONT=1,"IP","CMNET"^M)
expect (OK)
^M
^M
OK
-- got it
send (ATDT*99***1#^M)
expect (CONNECT)
^M
^M
CONNECT
-- got it
send (^M)
Serial connection established.
using channel 13
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS3
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x1
]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfReq id=0x2 ]
sent [LCP ConfNak id=0x2 ]
rcvd [LCP ConfReq id=0x3 ]
sent [LCP ConfNak id=0x3 ]
rcvd [LCP ConfReq id=0x4 ]
sent [LCP ConfNak id=0x4 ]
rcvd [LCP ConfReq id=0x5 ]
sent [LCP ConfNak id=0x5 ]
rcvd [LCP ConfReq id=0x6 ]
sent [LCP ConfRej id=0x6 ]
rcvd [LCP ConfReq id=0x7 ]
sent [LCP ConfAck id=0x7 ]
sent [IPCP ConfReq id=0x1 <
ms-dns3 0.0.0.0>]
rcvd [LCP TermReq id=0x8]
LCP terminated by peer
sent [LCP TermAck id=0x8]
Connection terminated.
timeout set to 15 seconds
abort on (\nDELAYED\r)
abort on (\nBUSY\r)
abort on (\nERROR\r)
abort on (\nNO DIALTONE\r)
abort on (\nNO CARRIER\r)
send (^MAT^M)
expect (OK)
^M
OK
-- got it
send (ATS0=0^M)
expect (OK)
^M
^M
OK
-- got it
send (ATE0V1^M)
expect (OK)
^M
^M
OK
-- got it
send (AT+CGDCONT=1,"IP","CMNET"^M)
expect (OK)
^M
^M
OK
-- got it
send (ATDT*99***1#^M)
expect (CONNECT)
^M
^M
CONNECT
-- got it
send (^M)
Serial connection established.
using channel 14
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS3
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x3
]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
rcvd [LCP ConfRej id=0x3 ]
sent [LCP ConfReq id=0x4 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfNak id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfRej id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfRej id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfRej id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfRej id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfAck id=0x4 ]
rcvd [LCP ConfReq id=0x2 ]
sent [LCP ConfRej id=0x2 ]
rcvd [LCP ConfReq id=0x3 ]
sent [LCP ConfAck id=0x3 ]
sent [IPCP ConfReq id=0x2 <
ms-dns3 0.0.0.0>]
rcvd [LCP TermReq id=0x4]
LCP terminated by peer
sent [LCP TermAck id=0x4]
Connection terminated.
tcflush failed: Bad file descriptor
tcsetattr: Invalid argument (line 962)
tcsetattr: Invalid argument (line 1001)
检查发现是用户名密码不正确
修改pap-cerects
#cat /etc/ppp/pap-cerects
# 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) ############
cmnet * cmnet
正确拨号过程为
#pppd call gprs
timeout set to 15 seconds
abort on (\nDELAYED\r)
abort on (\nBUSY\r)
abort on (\nERROR\r)
abort on (\nNO DIALTONE\r)
abort on (\nNO CARRIER\r)
send (^MAT^M)
expect (OK)
^MAT^M^M
OK
-- got it
send (ATS0=0^M)
expect (OK)
^M
ATS0=0^M^M
OK
-- got it
send (ATE0V1^M)
expect (OK)
^M
ATE0V1^M^M
OK
-- got it
send (AT+CGDCONT=1,"IP","CMNET"^M)
expect (OK)
^M
^M
OK
-- got it
send (ATDT*99***1#^M)
expect (CONNECT)
^M
^M
CONNECT
-- got it
send (^M)
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS3
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x1
]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [PAP AuthReq id=0x1 user="cmnet" password=]
sent [PAP AuthReq id=0x2 user="cmnet" password=]
sent [PAP AuthReq id=0x3 user="cmnet" password=]
sent [PAP AuthReq id=0x4 user="cmnet" password=]
sent [PAP AuthReq id=0x5 user="cmnet" password=]
sent [PAP AuthReq id=0x6 user="cmnet" password=]
sent [PAP AuthReq id=0x7 user="cmnet" password=]
sent [PAP AuthReq id=0x8 user="cmnet" password=]
sent [PAP AuthReq id=0x9 user="cmnet" password=]
rcvd [PAP AuthAck id=0x1 "Welcome!"]
Remote message: Welcome!
PAP authentication succeeded
sent [IPCP ConfReq id=0x1 <
ms-dns3 0.0.0.0>]
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [IPCP ConfRej id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfRej id=0x2 ]
sent [IPCP ConfReq id=0x3 ]
rcvd [IPCP ConfRej id=0x3 ]
sent [IPCP ConfReq id=0x4 ]
rcvd [IPCP ConfNak id=0x4 ]
sent [IPCP ConfReq id=0x5 ]
rcvd [IPCP ConfAck id=0x5 ]
local IP address 192.168.111.112
remote IP address 192.168.111.111
rcvd [LCP TermReq id=0x2]
LCP terminated by peer
Connect time 0.0 minutes.
Sent 0 bytes, received 0 bytes.
sent [LCP TermAck id=0x2]
Connection terminated.
timeout set to 15 seconds
abort on (\nDELAYED\r)
abort on (\nBUSY\r)
abort on (\nERROR\r)
abort on (\nNO DIALTONE\r)
abort on (\nNO CARRIER\r)
send (^MAT^M)
expect (OK)
^M
OK
-- got it
send (ATS0=0^M)
expect (OK)
^M
^M
OK
-- got it
send (ATE0V1^M)
expect (OK)
^M
^M
OK
-- got it
send (AT+CGDCONT=1,"IP","CMNET"^M)
expect (OK)
^M
^M
OK
-- got it
send (ATDT*99***1#^M)
expect (CONNECT)
^M
^M
CONNECT
-- got it
send (^M)
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS3
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x3
]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
sent [LCP ConfReq id=0x3 ]
rcvd [LCP ConfRej id=0x3 ]
sent [LCP ConfReq id=0x4 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x3 ]
rcvd [LCP ConfAck id=0x4 ]
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [PAP AuthReq id=0xa user="cmnet" password=]
rcvd [PAP AuthAck id=0xa "Welcome!"]
Remote message: Welcome!
PAP authentication succeeded
sent [IPCP ConfReq id=0x6 <
ms-dns3 0.0.0.0>]
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [IPCP ConfRej id=0x6 ]
sent [IPCP ConfReq id=0x7 ]
rcvd [IPCP ConfNak id=0x7 211.136.20.203>]
sent [IPCP ConfReq id=0x8 211.136.20.203>]
rcvd [IPCP ConfAck id=0x8 211.136.20.203>]
local IP address 10.14.218.243
remote IP address 192.168.111.111
primary DNS address 211.136.17.107
secondary DNS address 211.136.20.203
快速的拨上过程为
#pppd call gprs &
[root@(none) /]$timeout set to 15 seconds
abort on (\nDELAYED\r)
abort on (\nBUSY\r)
abort on (\nERROR\r)
abort on (\nNO DIALTONE\r)
abort on (\nNO CARRIER\r)
send (^MAT^M)
expect (OK)
^M
OK
-- got it
send (ATS0=0^M)
expect (OK)
^M
^M
OK
-- got it
send (ATE0V1^M)
expect (OK)
^M
^M
OK
-- got it
send (AT+CGDCONT=1,"IP","CMNET"^M)
expect (OK)
^M
^M
OK
-- got it
send (ATDT*99***1#^M)
expect (CONNECT)
^M
^M
CONNECT
-- got it
send (^M)
Serial connection established.
using channel 3
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS3
rcvd [LCP ConfReq id=0x1
]
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [PAP AuthReq id=0x1 user="cmnet" password=]
rcvd [PAP AuthAck id=0x1 "Welcome!"]
Remote message: Welcome!
PAP authentication succeeded
sent [IPCP ConfReq id=0x1 <
ms-dns3 0.0.0.0>]
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [IPCP ConfRej id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfNak id=0x2 211.136.20.203>]
sent [IPCP ConfReq id=0x3 211.136.20.203>]
rcvd [IPCP ConfAck id=0x3 211.136.20.203>]
local IP address 10.14.221.254
remote IP address 192.168.111.111
primary DNS address 211.136.17.107
secondary DNS address 211.136.20.203
阅读(1000) | 评论(0) | 转发(0) |