Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1085657
  • 博文数量: 169
  • 博客积分: 12306
  • 博客等级: 上将
  • 技术积分: 1299
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-29 14:55
文章分类

全部博文(169)

文章存档

2012年(18)

2011年(78)

2010年(15)

2009年(1)

2008年(11)

2007年(39)

2006年(7)

我的朋友

分类: LINUX

2010-12-27 16:44:38

用的是联通的卡,拨号之前先添加以下三个脚本
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 ]
rcvd [LCP ConfReq id=0x6 ]
sent [LCP ConfAck id=0x6 ]
rcvd [LCP ConfAck id=0x1 ]
sent [LCP EchoReq id=0x0 magic=0x523be8ce]
rcvd [LCP DiscReq id=0x7 magic=0x1063389]
rcvd [CHAP Challenge id=0x1 , 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 ]
sent [IPCP ConfReq id=0x1 ]
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 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfNak id=0x2 ]
sent [IPCP ConfReq id=0x3 ]
rcvd [IPCP ConfReq id=0x4]
sent [IPCP ConfNak id=0x4 ]
rcvd [IPCP ConfRej id=0x3 ]
sent [IPCP ConfReq id=0x4 ]
rcvd [IPCP ConfReq id=0x5]
sent [IPCP ConfAck id=0x5]
rcvd [IPCP ConfNak id=0x4 ]
sent [IPCP ConfReq id=0x5 ]
rcvd [IPCP ConfAck id=0x5 ]
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 ]
rcvd [LCP ConfReq id=0xa ]
sent [LCP ConfNak id=0xa ]
rcvd [LCP ConfAck id=0x1 ]
rcvd [LCP ConfReq id=0xb ]
sent [LCP ConfAck id=0xb ]
sent [LCP EchoReq id=0x0 magic=0x5c33b68f]
sent [PAP AuthReq id=0x1 user="qiubutu" password=]
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 ]
sent [IPCP ConfReq id=0x1 ]
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 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfNak id=0x2 ]
sent [IPCP ConfReq id=0x3 ]
rcvd [IPCP ConfReq id=0x6]
sent [IPCP ConfNak id=0x6 ]
rcvd [IPCP ConfRej id=0x3 ]
sent [IPCP ConfReq id=0x4 ]
rcvd [IPCP ConfReq id=0x7]
sent [IPCP ConfAck id=0x7]
rcvd [IPCP ConfNak id=0x4 ]
sent [IPCP ConfReq id=0x5 ]
rcvd [IPCP ConfAck id=0x5 ]
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通,不能打开网页
阅读(4840) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-12-30 12:38:35

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com

chinaunix网友2010-12-30 12:38:35

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com