Linux realizes ppp dial-up 4G module networking in global APN China (China)

Linux realizes ppp dial-up 4G module networking in global APN China (China)

China has three network operators:
China Mobile (China Mobile)
China Unicom (China Unicom)
China Telecom (China Telecom)

Insert picture description here
chat script configuration The
chat script is mainly used to complete the dialing process of the 4G module through AT commands.
There is also a common key to chat. The word is ABORT. This keyword is used to determine when to terminate the script. During the AT interaction, when an error occurs in the module and some error messages are output, ABORT can stop the current script according to the set word.

The following script is named "gprs-connect-chat" to
modify the gprs-connect-chat script
vi /etc/ppp/peers/gprs-chat-connect

Network operator APN

China Mobile (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 (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 (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 

Guess you like

Origin blog.csdn.net/weixin_41493857/article/details/108680872