Linux实现ppp拨号4G模块联网全球APN之中国(China)
- 网络运营商APN
-
- China Mobile (中国移动)
- China Unicom (中国联通)
- China Telecom (中国电信)
中国拥有三个网络运营商:
China Mobile (中国移动)
China Unicom (中国联通)
China Telecom (中国电信)
chat脚本配置
chat脚本主要用来通过AT命令完成4G模块的拨号过程
chat还有个常用的关键词为ABORT,这个关键词用于判断何时终止脚本,在AT交互过程中,模块发生错误,并且输出一些错误信息时,ABORT可根据设定的词,停止当前脚本。
以下脚本命名为“gprs-connect-chat”
修改gprs-connect-chat脚本
vi /etc/ppp/peers/gprs-chat-connect
网络运营商APN
China Mobile (中国移动)
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK \rAT+CGDCONT=1,"IP","cmnet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
China Unicom (中国联通)
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK \rAT+CGDCONT=1,"IP","3gnet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
China Telecom (中国电信)
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK \rAT+CGDCONT=1,"IP","ctnet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c