歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux文化 >> linux ppp GPRS撥號問題

linux ppp GPRS撥號問題

日期:2017/2/27 12:08:11   编辑:Linux文化

>>> 此貼的回復 >> 你可以試試把 /mnt/ppp/peers/gprs 裡的 usepeerdns 去掉,我以前是這麼試的,但是不知道為什麼

>>> 此貼的回復 >> 你試一下用這個命令 pppd debug /dev/ttyS3 115200 -detach crtscts defaultroute user card password card connect /usr/sbin/dialernew&

>>> 此貼的回復 >> 你的PPP撥號參數配置有問題或者沒有設置用戶名所致(見我下面/etc/options文件裡的說明),導致不能和PPP server端握手成功獲取local IP and server IP! 我3,4年前在一塊ARM板子上弄通過,由於嵌入式上很多要自己做,redhat上會更簡單,也更容易,如果做嵌入式,你應該先在PC上弄通,在移植到目標板上,大致給你說說,希望對你有所幫助 1. 配置kernel使它支持如下PPP選項: PPP(point-to-point) support PPP multilink support(EXPERIMENTAL) PPP support for async serial prots PPP support for sync tty ports PPP Deflate compression PPP BSD-Compress compression 2.編譯交叉編譯ppp-2.4.1,將./pppd/pppd, ,/chat/chat, ./pppdump/pppdump, ./pppstats/pppstats四個文件拷貝到嵌入式文件系統的/usr/sbin目錄下,並將他們的文件屬性改為755. 3.在嵌入式文件系統中: a、 建立一個ppp設備: mknod /dev/ppp c 108 0 並改變/etc/ppp文件夾的屬性:chmod 600 /etc/ppp. b、 編輯/etc/modules.conf文檔,增加一行: options ppp_async flag_time=0 c、 編輯/etc/resolv.conf,加入一行: nameserver 211.136.17.107(注釋:這是愛立信的GPRS域名解析服務器DNS地址,當時GPRS沒現在普及,為了這個地址狂打了幾天電信的技術支持,但很多support好水啊,不懂裝懂(借機損一下那些拿高工資又比較水的telecomer,嘿嘿,不要板磚拍我啊,怕怕的,我),最後終於問到一個帥哥,告訴了我這個。) d、 檢查/etc/host.conf腳本,確保有order hosts,bind 4.e、 /etc/ppp目錄下建立如下文件(這裡怎麼貼附件?真暈,要我挨個貼啊,辛苦是辛苦了點,好在今天心情好,就一並貼了吧,呵呵。為了好看清楚,每個文件用“#------#”分隔,各個它們都要有可執行權限哦): #------------------------------------------------# # File: # /etc/ppp/gprs # # Description: # This file holds the serial cable and IrDA pppd options for GPRS phones

# Tell the ppp-daemon to accept mangled data receive-all

# Give some debug info debug kdebug 7

# Print out all the option values which have been set. dump

# Serial device to which terminal is connected; # with serial port (COM1 in Windows) use /dev/ttyS0 # and with IrDA use /dev/ircomm0. #/dev/ircomm0 # IrDA /dev/ttyAM1 # serial cable (NOTE: 這個地方你要改為真正的你用的串口,比如/dev/ttyS0)

# Serial port line speed 115200

# Turn off waiting of carrier detect or flow control signal # With IrDA it should be disabled with nocrtscts option. -crtscts # serial cable #nocrtscts # IrDA # Ignore carrier detect signal from the modem local

# To keep pppd on the terminal nodetach

# Accept the peer's idea of our local IP address ipcp-accept-local # Accept the peer's idea of its (remote) IP address ipcp-accept-remote

# IP addresses: # - accept peers idea of our local address and set address peer as 10.0.0.1 # (any address would do, since IPCP gives 0.0.0.0 to it) # - if you use the 10. network at home or something and pppd rejects it, # change the address to something else 0.0.0.0:0.0.0.0

-chap #-pap

# pppd must not propose any IP address to the peer! #noipdefault

# No ppp compression novj novjccomp

papcrypt nodeflate

#No ppp magic number nomagic

# no asyn cmap asyncmap 0

# Add default route defaultroute

# Connect script connect /etc/ppp/gprs-connect-chat

# Disconnect script disconnect /etc/ppp/gprs-disconnect-chat

#------------------------------------------------# # File: # /etc/ppp/options # receive-all nopcomp noaccomp nomagic debug # Mobile is connected to the first serial port /dev/ttyAM1 (NOTE: 這個地方你要改為真正的你用的串口,比如/dev/ttyS0) 115200 connect '/usr/sbin/chat -e -f /etc/ppp/gprs-connect-chat -v' disconnect '/usr/sbin/chat -e -f /etc/ppp/chat-disconnect -v' modem noauth noccp novj novjccomp defaultroute noipdefault user foo (NOTE:這個很重要,當時搞的我好痛苦,嘿嘿。windows下撥號可以不用用戶名,但Linux不行,所以我們騙linux一下,設一個假的好了,另外,還要參見/etc/pap-secrets,呵呵) lock

#------------------------------------------------# #!/bin/sh # # File: # /etc/ppp/chat-gprs-connect # # Description: # chat script to open Sonera GPRS service with GPRS phones. If ppp # negotiation stalls, try restarting the phone. To try with other GPRS # operator setting, change the PDP contex setting. The settings work with # all Ericsson models, but Nokia 8310 does not suppor QoS parameters with # AT commands, so just delete those lines and it'll work. # # Set PDP context CID=1, protocol=IP, APN=internet: # AT+CGDCONT=1,"IP","internet","",0,0 # # Set CID=1 QoS requirements from the network, not supported by 8310: # AT+CGQREQ=1,0,0,0,0,0 # # Set CID=1 minimum acceptable QoS parameters, not supported by 8310: # AT+CGQMIN=1,0,0,0,0,0 # # 'Call' CID=1 (activate PDP context one, perform GPRS attach): # ATD*99***1# # # ogin:-BREAK-ogin: \ # TIMEOUT 5 \ # assword: \ # SAY "\nLogged in OK...\n" \

# The actual chat script: exec chat \ TIMEOUT 5 \ ECHO ON \ ABORT '\nBUSY\r' \ ABORT '\nERROR\r' \ ABORT '\nNO ANSWER\r' \ ABORT '\nNO CARRIER\r' \ ABORT '\nNO DIALTONE\r' \ ABORT '\nRINGING\r\n\r\nRINGING\r' \ '' AT \ TIMEOUT 12 \ SAY "Press CTRL-C to close the connection at any stage!" \ SAY "\ndefining PDP context...\n" \ OK AT+CGATT? \ OK AT+CGATT=1 \ OK AT+CGATT? \ OK 'AT+CGDCONT=1,"IP"' \ OK AT+CGQREQ=1,0,0,3,0,0 \ OK AT+CGACT=1,1 \ OK ATDT*99***1# \ TIMEOUT 120 \ SAY "\nwaiting up to 2 mintues for connect...\n"\ CONNECT "" \ SAY "\nConnected. now logging in...\n" \ SAY "\nIf the following ppp negotiations fail,\n" \ SAY "try restarting the phone.\n" # NOTE: PDP context可能會因你的貓不同而有所區別,查它的手冊來寫吧

#------------------------------------------------#

#!/bin/sh # # File: # /etc/ppp/chat-gprs-disconnect # # send break exec /usr/sbin/chat -V -s -S \ ABORT "BUSY" \ ABORT "ERROR" \ ABORT "NO DIALTONE" \ SAY "\nSending break to the modem\n" \ "" "\K" \ "" "+++ATH" \ SAY "\nPDP context detached\n" #------------------------------------------------# # File: # /etc/ppp/chap-secrets # Secrets for authentication using CHAP # client server secret IP addresses ####### redhat-config-network will overwrite this part!!! (begin) ########## ####### redhat-config-network will overwrite this part!!! (end) ############ #------------------------------------------------# # File: #/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) ############ foo * "" * 剩下的文件就是那些關於ip-down,ip-up,ip-down.ipv6to4,ip-up.ipv6to4了,沒啥好說的了, 最後只有祝你good luck了


摘自:linuxforum.net


Copyright © Linux教程網 All Rights Reserved