分类: 系统运维
2010-09-10 23:31:28
TD卡ubuntu下拨号实验
一、拨号前的准备工作
1、定制内核并安装
我的ubuntu主机上的内核版本是linux-
2、挂载usb文件系统
将
/etc/fstab
usbfs /proc/bus/usb usbfs default 0 0 |
这样,在/proc/bus/usb将会出现devices文件,可以通过该文件来查看usb设备信息。
插入
T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=04cc ProdID= S: Manufacturer=NXP Semiconductors S: Product=NexperiaTM System Solution S: SerialNumber=000000-00-000000 C:* #Ifs= 7 Cfg#= 2 Atr=c0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=16ms I:* If#= 2 Alt= 0 #EPs= 2 Cls= E: Ad=05(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm E: Ad=84(I) Atr=03(Int.) MxPS= 16 Ivl=16ms I:* If#= 4 Alt= 0 #EPs= 2 Cls= E: Ad=08(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm E: Ad=87(I) Atr=03(Int.) MxPS= 16 Ivl=16ms I:* If#= 6 Alt= 0 #EPs= 2 Cls= E: Ad=0b(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=8b(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms |
根据以上的“NexperiaTM”,我到网上一搜,该卡依据TD-SCDMA标准,就是说国产的。
二、拨号
我用的卡插入到ubuntu主机后便在/dev目录下生成了ttyACMX设备节点,我使用tip串口工具连接到ttyACM0后,发送AT指令成功,我就没有使用usb_modswitch来进行设备转换。
确定了卡的类型,我使用ubuntu下的wvdial拨号时脚本就好确定了。安装wvdial后进行如下配置:
/etc/wvdial.conf
[Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2+FCLASS=0 Modem Type = USB Modem Baud = 115200 New PPPD = yes Modem = /dev/ttyACM0 ISDN = 0 Phone = *99***1# Username =any Password =any Stupid Mode = 1 |
使用wvdial拨号,终端中显示如下:
root@mark-desktop:/lib/modules/ --> WvDial: Internet dialer version 1.60 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2+FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2+FCLASS=0 OK --> Modem initialized. --> Sending: ATDT*99***1# --> Waiting for carrier. ATDT*99***1# CONNECT 236800 --> Carrier detected. Starting PPP immediately. --> Starting pppd at Fri Sep 10 16:04:47 2010 --> Pid of pppd: 5047 --> Using interface ppp0 --> pppd: 貒锟?H锟斤拷 --> pppd: 貒锟?H锟斤拷 --> pppd: 貒锟?H锟斤拷 --> pppd: 貒锟?H锟斤拷 --> pppd: 貒锟?H锟斤拷 --> local IP address --> pppd: 貒锟?H锟斤拷 --> remote IP address 192.200.1.21 --> pppd: 貒锟?H锟斤拷 --> primary DNS address 211.136.192.6 --> pppd: 貒锟?H锟斤拷 --> secondary DNS address 211.136.17.107 --> pppd: 貒锟?H锟斤拷 |
ifconfig命令后看到多了ppp0接口,证明拨号已成功。此时,打开浏览器能够访问外网了。