当前位置: 技术问答>linux和unix
pppd cdma 如何上网
来源: 互联网 发布时间:2016-07-08
本文导语: 大家好!我要在arm上实现cdma上网,请有故经验的高手指点! 设备是:一个cdma modem(华为EC121,内插联通卡),连接usb,虚拟成串口 pppd connect 'chat -v "" "AT" "" "ATDT#777 CONNECT"' user CARD password CARD /dev/ttyUSB0 2304...
大家好!我要在arm上实现cdma上网,请有故经验的高手指点!
设备是:一个cdma modem(华为EC121,内插联通卡),连接usb,虚拟成串口
pppd connect 'chat -v "" "AT" "" "ATDT#777 CONNECT"' user CARD password CARD /dev/ttyUSB0 230400 nodetach crtscts debug usepeerdns defaultroute
输出:
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 /dev/ttyUSB0
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
LCP: timeout sending Config-Requests
Connection terminated.
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 /dev/ttyUSB0
tcflush failed: Bad file descriptor
tcsetattr: Invalid argument (line 1001)
我使用ppp里面的脚本也没有成功!
设备是:一个cdma modem(华为EC121,内插联通卡),连接usb,虚拟成串口
pppd connect 'chat -v "" "AT" "" "ATDT#777 CONNECT"' user CARD password CARD /dev/ttyUSB0 230400 nodetach crtscts debug usepeerdns defaultroute
输出:
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 /dev/ttyUSB0
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
LCP: timeout sending Config-Requests
Connection terminated.
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 /dev/ttyUSB0
tcflush failed: Bad file descriptor
tcsetattr: Invalid argument (line 1001)
我使用ppp里面的脚本也没有成功!
|
Edit your /etc/wvdial.conf
Init1 = ATZ
Init2 = ATQ0 M1 L1 X3 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
Abort On No Dialtone = False
New PPPD = yes
Phone = #777
Modem = /dev/ttyUSB0
Username = 10digitReliancePhoneNumber
Password = 10digitReliancePhoneNumber
After this, you should use wvdial as root
This will give some output and will show the primary and secondary dns entries. Unfortunately, For some reason wvdial doesn’t change the DNS name servers so you have to do it manually :
Edit /etc/resolv.conf in your favourite text editor and add the following :
nameserver {the ip of your priimary dns}202.138.103.100 for me
nameserver {the ip of your secondary dns}202.138.96.2
Close the connection and reconnect. It should all work fine for you now