文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>华为无线模块的GPRS在PC-linux下的ppp拨号成功

华为无线模块的GPRS在PC-linux下的ppp拨号成功

时间:2010-12-27  来源:gunnerlzx

用的是联通的卡,拨号之前先添加以下三个脚本
1.
/etc/ppp/peers/option

noauth
connect "/usr/sbin/chat -v -f /etc/ppp/connect"
#disconnect "/usr/sbin/chat -v -f /etc/ppp/disconnect"

debug
#logfile /var/log/ppplog

/dev/ttyUSB0
115200
defaultroute
user "uninet"
0.0.0.0:0.0.0.0
nodetach
usepeerdns


2.
/etc/ppp/chap-secrets

# Secrets for authentication using CHAP

# client    server    secret            IP addresses

"uninet" * "uninet" *


3.

/etc/ppp/connect

具体设置参考前一篇博文

TIMEOUT 15
ABORT 'BUSY'
ABORT 'ERROR'
ABORT 'NO CARRIER'
ABORT 'NO ANSWER'
ABORT 'NO DIALTONE'
ABORT 'RINGING'

SAY 'start connect script\n'
SAY 'send AT...\n'
"" 'AT'
SAY 'seng AT+CFUN=1...\n'
OK 'AT+CFUN=1'

TIMEOUT 60
SAY 'Setting APN...\n'
OK 'AT+CGDCONT=1,"IP","UNINET"'

SAY 'Dialing...\n'
OK 'ATD*99***1#'

CONNECT ""


脚本的具体含义请移步:
http://blog.chinaunix.net/u3/111961/showart_2190490.html
也可以参考上一篇博文。

拨号直接先把以太网禁止,以防冲突
ifconfig eth0 down

拨号:
pppd call option

输出如下:
start connect script
send AT...
seng AT+CFUN=1...
Setting APN...
Dialing...
Script /usr/sbin/chat -v -f /etc/ppp/connect finished (pid 3500), status = 0x0
Serial connection established.
using channel 3
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x523be8ce> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x6 <asyncmap 0x0> <auth chap MD5> <magic 0x1063389> <pcomp> <accomp>]
sent [LCP ConfAck id=0x6 <asyncmap 0x0> <auth chap MD5> <magic 0x1063389> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x523be8ce> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0x523be8ce]
rcvd [LCP DiscReq id=0x7 magic=0x1063389]
rcvd [CHAP Challenge id=0x1 <be058ed0ea671b1c1042434b0a4fa62c>, name = "UMTS_CHAP_SRVR"]
sent [CHAP Response id=0x1 <14f4ca5a88b30e7c98d54d2d76388299>, name = "uninet"]
rcvd [LCP EchoRep id=0x0 magic=0x1063389 52 3b e8 ce]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP ProtRej id=0x8 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfNak id=0x1 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
rcvd [IPCP ConfNak id=0x2 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x3 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
rcvd [IPCP ConfReq id=0x4]
sent [IPCP ConfNak id=0x4 <addr 0.0.0.0>]
rcvd [IPCP ConfRej id=0x3 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x4 <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
rcvd [IPCP ConfReq id=0x5]
sent [IPCP ConfAck id=0x5]
rcvd [IPCP ConfNak id=0x4 <addr 172.16.159.69> <ms-dns1 202.106.195.68> <ms-dns2 202.106.46.151>]
sent [IPCP ConfReq id=0x5 <addr 172.16.159.69> <ms-dns1 202.106.195.68> <ms-dns2 202.106.46.151>]
rcvd [IPCP ConfAck id=0x5 <addr 172.16.159.69> <ms-dns1 202.106.195.68> <ms-dns2 202.106.46.151>]
Could not determine remote IP address: defaulting to 10.64.64.64
Cannot determine ethernet address for proxy ARP
local  IP address 172.16.159.69
remote IP address 10.64.64.64
primary   DNS address 202.106.195.68
secondary DNS address 202.106.46.151
Script /etc/ppp/ip-up started (pid 3502)
Script /etc/ppp/ip-up finished (pid 3502), status = 0x0

此时ping 202.119.230.80能通,也可以直接打开网页。为了省流量,不敢打开图片多的网页,只是打开baidu,google之类的

——————————————————————————————————————————————————
进一步测试
把/etc/ppp/chap-secrets增加的内容去掉也能拨号成功
继续把UNINET改成UNIWAP也能拨号成功,能ping通,但是不能打开网页
过程如下
start connect script
send AT...
seng AT+CFUN=1...
Setting APN...
Dialing...
Script /usr/sbin/chat -v -f /etc/ppp/connect finished (pid 5437), status = 0x0
Serial connection established.
using channel 4
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x5c33b68f> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0xa <asyncmap 0x0> <auth chap MD5> <magic 0x1063eb9> <pcomp> <accomp>]
sent [LCP ConfNak id=0xa <auth pap>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x5c33b68f> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0xb <asyncmap 0x0> <auth pap> <magic 0x1063eb9> <pcomp> <accomp>]
sent [LCP ConfAck id=0xb <asyncmap 0x0> <auth pap> <magic 0x1063eb9> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0x5c33b68f]
sent [PAP AuthReq id=0x1 user="qiubutu" password=<hidden>]
rcvd [LCP DiscReq id=0xc magic=0x1063eb9]
rcvd [LCP EchoRep id=0x0 magic=0x1063eb9 5c 33 b6 8f]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP ProtRej id=0xd 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfNak id=0x1 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
rcvd [IPCP ConfNak id=0x2 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x3 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
rcvd [IPCP ConfReq id=0x6]
sent [IPCP ConfNak id=0x6 <addr 0.0.0.0>]
rcvd [IPCP ConfRej id=0x3 <compress VJ 0f 01> <ms-dns2 10.11.12.14>]
sent [IPCP ConfReq id=0x4 <addr 0.0.0.0> <ms-dns1 10.11.12.13>]
rcvd [IPCP ConfReq id=0x7]
sent [IPCP ConfAck id=0x7]
rcvd [IPCP ConfNak id=0x4 <addr 10.7.54.137> <ms-dns1 10.0.0.172>]
sent [IPCP ConfReq id=0x5 <addr 10.7.54.137> <ms-dns1 10.0.0.172>]
rcvd [IPCP ConfAck id=0x5 <addr 10.7.54.137> <ms-dns1 10.0.0.172>]
Could not determine remote IP address: defaulting to 10.64.64.64
Cannot determine ethernet address for proxy ARP
local  IP address 10.7.54.137
remote IP address 10.64.64.64
primary   DNS address 10.0.0.172
Script /etc/ppp/ip-up started (pid 5439)
Script /etc/ppp/ip-up finished (pid 5439), status = 0x0

——————————
接着把apn改为3gnet也能拨上,并且能ping通,也能打开网页

接着又把apn改为3gwap,能拨上,不能ping通,更不能打开网页

接着又把apn改为aaaa,也能拨上,不能ping通,不能打开网页
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载