Serial

PPP / 3G 調製解調器沒有獲得 IP:沒有執行網路協議

  • December 14, 2021

使用中的調製解調器:SIM5310 連接到基於 ARM 的電路板。

root@cm-debian:~# uname -a
Linux cm-debian 4.4.0-cm-t335-5.1-00030-gd350d89-dirty #29 SMP Sat Nov 4 19:18:48 PDT 2017 armv7l GNU/Linux

我現在正在使用 minicom 初始化聊天,而不是使用腳本。

使用 AT 命令我可以看到分配了一個 IP 地址

at+cgpaddr
+CGPADDR: 1,"176.13.98.14"
+CGPADDR: 2,"0.0.0.0"

AT ping 到 8.8.8.8 也可以:

at+cping="8.8.8.8",1
OK
+STIN: 25
+STIN: 25
+CPING: 1,8.8.8.8,64,484,255
+CPING: 1,8.8.8.8,64,394,255
+CPING: 1,8.8.8.8,64,392,255
+CPING: 1,8.8.8.8,64,771,255
+CPING: 3,4,4,0,392,771,510

更多資訊:

at+cgatt?    
+CGATT: 1# packet domain attached

at+cgact?  
+CGACT: 1,1 # PDP context is activated
+CGACT: 2,0

ati
Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM5310
Revision: SIM5310_V1.5
IMEI: 359768030163686
+GCAP: +CGSM,+DS,+ES

這是 pppd 的輸出

root@cm-debian:~# pppd -detach noauth  noipdefault debug usepeerdns /dev/ttyO1 115200 ipcp-accept-local ipcp-accept-remote
   using channel 36
   Using interface ppp0
   Connect: ppp0 <--> /dev/ttyO1
   sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x4748d05c> <pcomp> <accomp>]
   rcvd [LCP ConfReq id=0x50 <asyncmap 0x0> <auth pap> <magic 0x15c05db> <pcomp> <accomp>]
   No auth is possible
   sent [LCP ConfRej id=0x50 <auth pap>]
   rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x4748d05c> <pcomp> <accomp>]
   rcvd [LCP ConfReq id=0x51 <asyncmap 0x0> <magic 0x15c05db> <pcomp> <accomp>]
   sent [LCP ConfAck id=0x51 <asyncmap 0x0> <magic 0x15c05db> <pcomp> <accomp>]
   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 DiscReq id=0x52 magic=0x15c05db]
   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>]
   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>]
   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>]
   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>]
   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>]
   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>]
   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>]
   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>]
   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>]
   IPCP: timeout sending Config-Requests
   sent [LCP TermReq id=0x2 "No network protocols running"]
   sent [LCP TermReq id=0x3 "No network protocols running"]
   Connection terminated.
   Modem hangup

嘗試使用 pap 空白使用者/通過身份驗證:

root@cm-debian:~# pppd -detach user "" password "" noipdefault debug usepeerdns /dev/ttyO1 115200 ipcp-accept-local ipcp-accept-remote
using channel 37
Using interface ppp0
Connect: ppp0 <--> /dev/ttyO1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x9300f3d> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x53 <asyncmap 0x0> <auth pap> <magic 0x15fa3e3> <pcomp> <accomp>]
sent [LCP ConfAck id=0x53 <asyncmap 0x0> <auth pap> <magic 0x15fa3e3> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x9300f3d> <pcomp> <accomp>]
sent [PAP AuthReq id=0x1 user="" password=<hidden>]
rcvd [LCP DiscReq id=0x54 magic=0x15fa3e3]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
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>]
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>]
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>]
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>]
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>]
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>]
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>]
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>]
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>]
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>]
IPCP: timeout sending Config-Requests
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
Modem hangup

禁用標頭壓縮等:

root@cm-debian:~# pppd -detach user "" password "" novj noccp novjccomp noipdefault debug usepeerdns /dev/ttyO1 115200 ipcp-accept-local ipcp-accept-remote
using channel 38
Using interface ppp0
Connect: ppp0 <--> /dev/ttyO1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x670e49b4> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x55 <asyncmap 0x0> <auth pap> <magic 0x161ece0> <pcomp> <accomp>]
sent [LCP ConfAck id=0x55 <asyncmap 0x0> <auth pap> <magic 0x161ece0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x670e49b4> <pcomp> <accomp>]
sent [PAP AuthReq id=0x1 user="" password=<hidden>]
rcvd [LCP DiscReq id=0x56 magic=0x161ece0]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
IPCP: timeout sending Config-Requests
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
Modem hangup

更新:

我可以使用以下屬性獲取 ms-wins IP 地址: 注意:這種情況偶爾會發生,主要返回 0.0.0.0 wins 地址

root@cm-debian:~# pppd -detach user "" password ""  debug usepeerdns /dev/ttyO1 115200
using channel 52
Using interface ppp0
Connect: ppp0 <--> /dev/ttyO1
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x6f1654a4> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x76 <asyncmap 0x0> <auth pap> <magic 0x18a9792> <pcomp> <accomp>]
sent [LCP ConfAck id=0x76 <asyncmap 0x0> <auth pap> <magic 0x18a9792> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x6f1654a4> <pcomp> <accomp>]
sent [PAP AuthReq id=0x1 user="" password=<hidden>]
rcvd [LCP DiscReq id=0x77 magic=0x18a9792]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
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 [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> <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> <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> <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> <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> <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> <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> <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> <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> <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> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
IPCP: timeout sending Config-Requests
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
Modem hangup

有任何想法嗎?

在 at+cgdcont 中使用“sphone”而不是“internetg”

引用自:https://serverfault.com/questions/896808