pppd拨号流程详解


-
Linux下ppp拨号
ABORT DELAYED ABORT BUSY ABORT ERROR ABORT NO DIALTONE ABORT NO CARRIER H AT #'OK-+++\c-OK ATHO TIMEOUT 5 AT OK AT+CGDCONT=1, IP,3gnet,,0,0 OK ATDT-99# CONNECT chat肘本主要有 TIMEOUT、 ABORT和AT指令交互等等构成。更多帮助使用 man chat TIME○UT不解释∫, ABORT指定∫AT指令交互时,出∫仆么样的错误chat将退出。AT指 令交互是”接收”“发送的形式。 比如第一行,意思是不接收任何信息,直接发送AT AT 第二行的意思是等待接收OK,如果OK,发送AT+ CGDCONT=1这个命令。 如果一切正常,会看到如下og。我们可以在log看到3g模块上AT指令的交互情况 pppd call wcdma timeout set to 5 seconds abort on(DELAYED) abort on (Busy) abort on (ERROR) abort on(NO DIALTONe abort on (NO CARRIER timeout set to 5 seconds send(MATAM) expect(OK) AMA OK got it send(AT+CGDCoNT-=1, IP 0, 0AM) expect(OK) AT+CGDCONT=1, IP,3gnet,0,0MAM OK - got it send (ATDT* 99#M) expect(CONNECT) ATDT*99#AMAM CONNECT - got it send (M) Serial connection established using channel 9 Using interface pppo Connect: ppp0 <->/dev/ttyUSB0 sent [LCP ConfReq id=0x1 casyncmap 0x0> <magic Oxf5d87df8> <pcomp> <accomp> rcvd [LCp Conf req id=0x20 <asyncmap 0X0> <auth chap MD5><magic Ox172fd2b><pcomp> <accomp> No auth is possible sent [LCP ConfRej id=0x20 <auth chap MD5> rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic Oxf5d87df8> <pcomp> accomp> rcvd [LCP Conf Req id=0x21 <asyncmap 0x0><magic Ox172fd2b><pcomp><accomp> sent [LCP ConfAck id=0x21 <asyncmap 0x0> <magic Ox172fd2b><pcomp> <accomp> sent [CCP ConfReq id=0x1 <deflate 15><deflate(old#)15><bsd v1 15> sent [IPCP ConfReq id=0x1 <compress v] Of 01> <addr 0.0.0.0> <ms-dns1 00.0.0><ms-dns3 0.0.0.0 rcvd [Lcp discRe id=0x22 magic=0x172fd2b rcvd[ LCP ProtRej id=0x2380fd01010001a0478001804780015032f Protocol-Reject for 'Compression Control Protocol(0x80fd) received rcvd [IPCP ConfNak id=Ox1 <ms-dns1 10.11.12.13> <ms-dns3 10111214><ms-wins 10.11.1213><ms-wins10.11.12.14>] sent [IPCP ConfReq id=0x2 <compress VJ of 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <mdns310.11.1214] rcvd [IPCP ConfNak id=0x2 <ms-dns1 10.11.12.13> <ms-dns3 10.11.12 14> <ms-wins 1011.12.13>< ms-wins10.11.12.14>] sent [IPCP Conf Req id=0x3 <compress VJ Of 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> < ms-dns310.11.1214>] rcvd [IPCP ConfReq id=0x10] sent [IPCP ConfNak id=0x10 <addr 0.0.0.0> rcvd [IPCP ConfRej id=0X3 <compress vJ Of 01> sent [IPCP ConfReq id=0x4 <addr 0000><ms-dns1 10111213><ms-dns3 10.11.12.14> rcvd [IPCP ConfReq id=0x11] sent [IPCP ConfAck id=0x11 rcvd [IPCP ConfNak id=0x4 <addr 172.20.255.208><ms-dns1 20299. 160.68><ms-dns3 202991664>] sent [IPCP ConfReq id=0x5 <addr 172.20.255.208> <ms-dns1 202.99.160.68> <ms-dns3 20299166.4>] rcvd [IPCP ConfAck id=0x5 <addr 172.20.255.208><ms-dns1 20299. 160.68><ms-dns3 202991664>] Could not determine remote IP address: defaulting to 10.64.64.64 not replacing existing default route via 192.168.8.254 local IP address 172.20. 255.208 remote iP address 10. 64 64 64 primary DNS address 202.99.160.68 secondary dNs address 202.99.166.4 chap- secets和pap- secets文件 chap- secets和pap- secets文件是用于peer需要chp或者pap认证的服务器,我们好像用 不到,有兴趣的可以验证一下。需要说明的是如果需要认证,chat脚本|,user3gnet的3gnet 就是用户名。下面是个 chap-secets例了 #/etc/ppp/chap-secrets +client server secret Ip address 3gnet"*3gnet"* 有关CHAP和PAP认证,可以参考 http://download.oracle.com/docs/cd/e19253-01/819-7059/pppsvrconfig.reference-fig-23/index html CDMA2000/EV-DO 木节使用的是 huawei em660模块,使用中国电信CDMA2000/EV-DO pppd脚本 路径/etc/pp/ peers/cdma200 #/etc/ppp/peers/cdma2000 #This is pppd script, used Huawei EM660 /dev/ttyUSBO 115200 crtscts modem debug detach usepeerans defaultroute user "ctnet@mycdmacn password vnet. mobi fuser card #password card 0.0.0.0:000.0 connect /usr/sbin/chat -s-v-f/etc/ppp/cdma 2000-connect-chat chat脚本 #/etc/ppp/ cdma2000-connect-chat TIMEOUT 5 ABORT DELAYED" ABORT BUSY ABORT ERROR ABORT NO DIALTONE ABORT NO CARRIER AT OK-+++\c-OK ATHO TIMEOUT 40 AT OK ATDT#777 CONNECT 如果不出问趣,有如下信息 pppd call cdma 2000 timeout set to 5 seconds abort on (DELAYED) bort on(BUSY) abort on (ERROR) abort on(NO DIALTONE abort on(NO CARRIer send (ATAM) expect (OK) AMAM K ot it send(AtHoam) timeout set to 40 seconds send (ATAM) expect (OK) ATHOAMAM OK - got it send(ATDT777 M) expect(CONNECT) ATAMA OKM ATDTH777AMAM CONNECT got it send( M) Serial connection established using channel 1 Using interface pppO Connect: pppo <-->/dev/ttyUSBO rcvd [LCP ConfReq id=0x1 <mru 1448> <asyncmap 0x0> <auth chap MD5> <magic 0x5f285a5a><pcomp> <accomp> sent [LCP ConfReq id=0x1 <asyncmap 0X0> <magic Oxb32928c5><pcomp> <accomp>] sent [LCP ConfAck id=0x1 <mru 1448> <asyncmap 0x0> <auth chap MD5> <magic 0x5f285a5a><pcomp> <accomp> rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic Oxb32928C5><pcomp> <accomp> rcvd CHAP Challenge id=0x2 <0Oeedod70ca12053417660bc4c6c2bc7>, name utstar. com sent CHAP Response id=0x2 <c2b7e8bdee 2f5ec82706206714e27e3e, name cnet@ mycdma cn" d [Chap Success id=0x2" CHAP authentication succeeded CHAP authentication succeeded sent [CCP ConfReq id=0x1 <deflate 15><deflate(old#)15><bsd v1 15>1 sent [IPCP ConfReq id=ox1 <compress vJ of 01> <addr 0.0.0.0> <ms-dns1 00.0.0><ms-dns3 0.0.00>] rcvd[ LCP ProtRej id-0×180fa01010001a0478001804780015032刊 Protocol-Reject for Compression Control Protocol(0x80fd) received rcvd [IPCP ConfReq id=0X3 <compress vJ07 00> <addr 115.168.41.17> sent [IPCP ConfAck id=0x3 <compress VJ 07 00> <addr 115.. 17> rcvd [IPCP ConfNak id=Ox1 <compress v 07 00> <addr 114.81.240 179> <ms-dns1 1162361598>< ms-cns32226.2518习 sent [IPCP ConfReq id=0x2 <compress VJ 07 00> <addr 114.81.240 179> <ms-dns1 116236.1598>< ms-cns3222.662518> rcvd [IPCP ConfAck id=0X2 <compress V 07 00> <addr 114.81.240.179> <ms-dns1 1162361598>< ms-dns3222662518x not replacing existing default route via 192. 168.8.254 local IP address 11481.240 179 remote iP address 115.168,41.17 primary DNS address 116.236.159.8 secondary DNs address 222. 66.251.8 TD-SCDMA 本节使用的是 zte mu301模块,使用中国移动TD- SCDMA。 mu301模块不是很稳定,比如AT+ CGDCONT和AT+CFUN命令都不返回OK,和移动 TD-SCDMA 提供的4T命令接口规范不符 ppd脚本 #/etc/ppp/peers/ cdma 2000 #This is pppd script, used Huawei EM660 /dev/ttyUSB2 115200 crtscts modem debug detach usepeerdns defaultroute usercmnet connect/usr/sbin/chat-S-v-f / etc/ppp/tdscdma-connect-chat hat脚本 #/etc/ppp/tdscdma-connect-chat TIMEOUT 5 ABORT DELAYED ABORT BUSY ABORT ERROR ABORT NO DIALTONE ABORT NO CARRIER AT #'OK-+++\c-OK'ATHO TIMEOUT 40 AT #OK ATEOV1 #OK ATSO=O #OK AT+CFUN=1 OK AT+CGDCONT=1IPcmnet ATDT*98*1# CONNECT 运行的lg pppd call tdscdma timeout set to 5 seconds abort on (DELAYED) abort on(BUSy) abort on(ERROR abort on(NO DIALTONE abort on (NO CARRIER timeout set to 40 seconds send(ATM) expect (OK) OK got it send(at+cG DOnT=1, IP"cmnet"AM) send (ATDT*98*1#M) expect(CONNECT) CONNECT got it send (m) Serial connection established using channel 1 Using interface pppo Connect: ppp0 <-->/dev/ttyUSB2 sent [LCP ConfReq id=0x 1 <asyncmap 0x0> <magic 0x1b56a691><pcomp> <accomp> rcvd [LCP ConfReq id=0X0 <mru 1500> <asyncmap Oxffffffff> <auth chap MD5><magic 0x11223344><pcomp> <accomp> No auth is possibl sent [LCP ConfRej id=0x0 <auth chap MD5> rcvd [LCP ConfAck id=0x1 <asyncmap 0x0><magic 0x1b56a691><pcomp> <accomp> rcvd [LCp ConfReq id=0x1 <mru 1500> <asyncmap Oxffffffff> <magic 0x11223344> <pcomp> <accomp> sent [LCP ConfAck id=OX1 <mru 1500> <asyncmap Oxffffffff> <magic Ox11223344> <pcomp> <accomp>] sent [CCP ConfReq id=oxl <deflate 15> <deflate old#)15><bsd v1 15>1 sent [IPCP ConfReq id=0x1 <compress VJ Of 01><addr 0.0.0.0> <ms-dns1 00.0.0><ms-dns3 0.0.0.0>] rcvd[ CP ProtRej id=0x280fd0101000f1a0478001804780015032f Protocol-Reject for Compression Control Protocol(Ox80fd) received sent [IPCP ConfReq id=Ox1 <compress vJ of 01> <addr 0000><ms-dns1 00.0.0><ms-dns3 0.0.0.0>] rcvd [IPCP ConfReg id=0x3 caddr 192.168.0.1> sent [IPCP ConfAck id=0X3 <addr 192.168.0.1>] rcvd [lcp Echo req id=0x4 magic=0x11223344 sent [LCP Echo Rep id=0x 4 magic=0x1b56a691 sent [IPCP ConfReq id=0x1 <compress VJ Of 01> <addr 0000><ms-dns1 00.0.0><ms-dns3 0.0.0.0> rcvd [IPCP ConfRej id=Ox1 <compress VJ Of 01> sent [IPCP Conf Req id=0x2 <addr 0.0.0.0><ms-dns1 00.0.0><ms-dns3 0.0.0.0> rcvd [IPCP ConfNak id=0x2 <addr 10.61.. 221> <ms-dns1 211 136.112.50><ms-dns3 211.136150.66>] sent [IPCP ConfReq id=0x3 <addr 10.61.167.221> <ms-dns1 211.. 112.50> <mS-dns3 211.136.150.66> cvd [IPCP ContAck id=0X3 <addr 10.61.167. 221> <ms-dns1 211.136.112.50> <ms-dns3 21113615066>] not replacing existing default route via 192. 168.8.254 local IP address 10.61,.167.221 remote ip address 192.168.0.1 primary DNS address 211.. 112.50 secondary DNS address 211. 136. 150.66

-
2018-11-01
-
2018-08-27
-
2018-07-11
-
2018-04-01
-
2018-01-25
-
2016-01-18
-
2015-03-27
-
2015-01-05
-
2014-11-19
-
2014-10-09
-
下载
2016-2022年中国檀香行业市场研究及投资前景预测报告.pdf
2016-2022年中国檀香行业市场研究及投资前景预测报告.pdf
-
下载
2010-2014年中国高吸水性树脂SAP市场调查及投资发展前景战略研究报告.pdf
2010-2014年中国高吸水性树脂SAP市场调查及投资发展前景战略研究报告.pdf
-
下载
2019-2025年中国工业物业管理行业市场深度调研及发展战略研究报告.pdf
2019-2025年中国工业物业管理行业市场深度调研及发展战略研究报告.pdf
-
下载
最新版 kafka_2.12-2.8.0.tgz
最新版 kafka_2.12-2.8.0.tgz
-
下载
2019-2025年中国平板电脑行业市场竞争战略制定与实施研究报告.pdf
2019-2025年中国平板电脑行业市场竞争战略制定与实施研究报告.pdf
-
下载
2019-2025年中国模具行业市场深度调研及发展战略研究报告.pdf
2019-2025年中国模具行业市场深度调研及发展战略研究报告.pdf
-
下载
IOS风格PPT模板.zip
IOS风格PPT模板.zip
-
下载
2019-2025年中国功能性糖果行业市场深度调研及前景趋势预测报告 151页.pdf
2019-2025年中国功能性糖果行业市场深度调研及前景趋势预测报告 151页.pdf
-
下载
2016-2021年中国汽车减振器行业市场研究预测报告.pdf
2016-2021年中国汽车减振器行业市场研究预测报告.pdf
-
下载
F211-8岗位竞聘PPT 34个.zip
F211-8岗位竞聘PPT 34个.zip
