自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

PPP設(shè)置之pppd撥號(hào)

網(wǎng)絡(luò) 網(wǎng)絡(luò)管理
下面我們主要講解一下在Linux系統(tǒng)下PPP的有關(guān)配置。重點(diǎn)講解的是pppd通過GPRS上網(wǎng)的內(nèi)容。希望對(duì)大家有所幫助。

前面的內(nèi)容,我們都講解了PPP協(xié)議的一些基本應(yīng)用,以及一些相關(guān)的配置。那么這里我們就主要講解一下實(shí)現(xiàn)Linux下pppd通過GPRS撥號(hào)上網(wǎng)的過程。昨天把開發(fā)板的bootloader刪了,沒辦法,只得在PC上調(diào)GPRS撥號(hào)了.先在windows下?lián)芴?hào)成功,然后用工具看撥號(hào)時(shí)具體使用了哪些AT命令,再使用這些命令到linux下使用pppd來撥號(hào),最后終于成功了,之前開發(fā)板上不能成功撥號(hào)極有可就是AT指令有問題,現(xiàn)在只有等開發(fā)板回來后再到ARM7上調(diào)了.

下面貼一下?lián)芴?hào)使用的幾個(gè)腳本,GPRS模塊是使用的華為的GTM900-B:

1,   /etc/ppp/peers/gprs: 復(fù)制內(nèi)容到剪貼板

代碼:

  1. #/etc/ppp/peers/gprs  
  2. # This is pppd script for China Mobile, used Huawei GTM900-B GPRS Module  
  3. # Usage: root>pppd call gprs  
  4. /dev/ttyS0  
  5. 19200  
  6. crtscts  
  7. modem  
  8. #noauth  
  9. debug  
  10. nodetach  
  11. #hide-password  
  12. usepeerdns  
  13. noipdefault  
  14. defaultroute  
  15. user "cmnet"  
  16. 0.0.0.0:0.0.0.0  
  17. #ipcp-accept-local  
  18. #ipcp-accept-remote  
  19. #lcp-echo-failure   12  
  20. #lcp-echo-interval 3  
  21. #noccp  
  22. #novj  
  23. #novjccomp  
  24. #persist  
  25. connect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat'  
  26. #connect '/bin/chat -v -s -f /etc/ppp/gprs-connect-chat'  
  27. #disconnect '/bin/chat -v -f /etc/ppp/gprs-disconnect-chat'2 

gprs-connect-chat: 復(fù)制內(nèi)容到剪貼板

代碼:

  1. #/etc/ppp/gprs-connect-chat  
  2. # chat script for China Mobile, used HuaWei GTM900-B GPRS module.  
  3. TIMEOUT       15  
  4. ABORT           "DELAYED"  
  5. ABORT           "BUSY"  
  6. ABORT           "ERROR"  
  7. ABORT           "NO DIALTONE"  
  8. ABORT           "NO CARRIER"  
  9. TIMEOUT       40  
  10. ''              \rAT  
  11. OK             ATS0=0  
  12. OK              ATE0V1  
  13. OK              AT+CGDCONT=1,"IP","CMNET"  
  14. OK              ATDT*99***1#  
  15. CONNECT       ''3 

用于chap認(rèn)證的密碼文件:chap-secrets,由于移動(dòng)的GPRS服務(wù)不需要用戶名和密碼,所以剛開始沒設(shè)用戶名和密碼,結(jié)果在chap認(rèn)證的時(shí)候總不能通過.后來在gprs里添加user "cmnet"和這個(gè)密碼文件后就OK了. 復(fù)制內(nèi)容到剪貼板

代碼:

  1. #/etc/ppp/chap-secrets  
  2. #client server secret IP address   
  3. "cmnet" *     "cmnet" * 4
  4. 另外還有個(gè)可選的,斷開連接的腳本如下: 復(fù)制內(nèi)容到剪貼板  

代碼:

  1. ABORT        OK  
  2. ABORT        BUSY  
  3. ABORT        DELAYED  
  4. ABORT        "NO ANSWER"  
  5. ABORT        "NO CARRIER"  
  6. ABORT        "NO DIALTONE"  
  7. ABORT        VOICE  
  8. ABORT        ERROR  
  9. ABORT        RINGING  
  10. TIMEOUT        12  
  11. ""        \\k\\k\\k\\d+++ATH  
  12. "使用: 將PC上的DNS刪掉后運(yùn)行如下:  
  13. [root@localhost ppp]# pppd call gprs  
  14. timeout set to 15 seconds  
  15. abort on (DELAYED)  
  16. abort on (BUSY)  
  17. abort on (ERROR)  
  18. abort on (NO DIALTONE)  
  19. abort on (NO CARRIER)  
  20. timeout set to 40 seconds  
  21. send (^MAT^M)  
  22. expect (OK)  
  23. ^M^M  
  24. OK  
  25. -- got it  
  26.  
  27. send (ATS0=0^M)  
  28. expect (OK)  
  29. ^M  
  30. AT^M  
  31. OK  
  32. -- got it  
  33.  
  34. send (ATE0V1^M)  
  35. expect (OK)  
  36. ^M  
  37. ATS0=0^M^M  
  38. OK  
  39. -- got it  
  40.  
  41. send (AT+CGDCONT=1,"IP","CMNET"^M)  
  42. expect (OK)  
  43. ^M  
  44. ATE0V1^M^M  
  45. OK  
  46. -- got it  
  47.  
  48. send (ATDT*99***1#^M)  
  49. expect (CONNECT)  
  50. ^M  
  51. ^M  
  52. OK^M  
  53. ^M  
  54. CONNECT  
  55. -- got it  
  56.  
  57. send (^M)  
  58. Serial connection established.  
  59. using channel 42  
  60. Using interface ppp0  
  61. Connect: ppp0 <--> /dev/ttyS0  
  62. sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8c5e3d45> <pcomp> <accomp>]  
  63. rcvd [LCP ConfRej id=0x1 <magic 0x8c5e3d45>]  
  64. sent [LCP ConfReq id=0x2 <asyncmap 0x0> <pcomp> <accomp>]  
  65. rcvd [LCP ConfAck id=0x2 <asyncmap 0x0> <pcomp> <accomp>]  
  66. rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MD5> <pcomp> <accomp>]  
  67. sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth chap MD5> <pcomp> <accomp>]  
  68. rcvd [CHAP Challenge id=0x1 <fb17db52a81bc14997f72e2932ab0b342bab961d49c611>name = ""]  
  69. sent [CHAP Response id=0x1 <2c757eac52b8d9a7d80ca7a77c419ad9>name = "cmnet"]  
  70. rcvd [CHAP Success id=0x1 ""]  
  71. CHAP authentication succeeded  
  72. sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]  
  73. sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]  
  74. rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]  
  75. rcvd [IPCP ConfReq id=0x1 <addr 221.177.160.163>]  
  76. sent [IPCP ConfAck id=0x1 <addr 221.177.160.163>]  
  77. rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]  
  78. sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]  
  79. rcvd [IPCP ConfNak id=0x2 <addr 10.165.226.25> <ms-dns1 211.137.64.163> <ms-dns3 211.136.20.203>]  
  80. sent [IPCP ConfReq id=0x3 <addr 10.165.226.25> <ms-dns1 211.137.64.163> <ms-dns3 211.136.20.203>]  
  81. rcvd [IPCP ConfAck id=0x3 <addr 10.165.226.25> <ms-dns1 211.137.64.163> <ms-dns3 211.136.20.203>]  
  82. local   IP address 10.165.226.25  
  83. remote IP address 221.177.160.163  
  84. primary DNS address 211.137.64.163  
  85. secondary DNS address 211.136.20.203 

再將這里的DNS給PC或作個(gè)連接到/etc/ppp/resolf.conf應(yīng)該就OK了.

責(zé)任編輯:佟健 來源: hi.baidu.com
相關(guān)推薦

2010-09-03 09:57:08

PPPDGPRS

2010-09-03 09:50:19

armPPP

2010-09-06 11:58:39

ppp撥號(hào)Linux

2010-09-09 17:27:43

PPP Multili

2010-09-09 17:31:15

ppp authent

2010-09-03 10:23:49

PPP Multili

2010-09-06 13:41:43

PPPPPTP

2011-03-31 11:22:20

CACTI交換設(shè)備

2011-08-23 14:29:45

pppd中文man

2010-09-06 14:07:07

PPP Multili

2010-09-03 09:43:37

Linux內(nèi)核PPP

2011-03-31 11:12:37

CACTINet-SNMP

2011-11-01 13:25:29

2011-03-31 11:50:31

CACTI安全

2010-09-06 09:18:08

PPP Options

2010-09-09 17:21:16

2010-09-28 09:20:28

Linux PPP設(shè)置

2011-03-31 11:29:24

CACTISNMP服務(wù)

2009-12-18 16:00:48

2011-03-03 16:47:32

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)