需安装软件usb_modeswitch libusb-compat libusb-1.0.0 usb-modeswitch-data
下载地址:
http://www.draisberghof.de/usb_modeswitch/
Libusb-1.0.0可在线安装:
#sudo apt-get install libusb-1.0.0
其他软件下载后解压,安装;
插入3G无线网卡,lsusb查看设备:
Bus 003 Device 008: ID 12d1:1f01 HuaweiTechnologies Co., Ltd.
然后配置usb_modeswitch.conf
#sudo vi /etc/usb_modeswitch.conf
在最后一行添加如下内容:
#Huawei E303
DefaultVendor = 0x12d1
DefaultProduct = 0x1f01
保存退出。
在/etc/usb_modeswitch.d/目录下创建文件12d1:1f01
#sudo vi /etc/usb_modeswitch.d/12d1:1f01
编辑写入如下内容:
#HuaweiE303
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor= 0x12d1
RargetProduct= 0x1f01
MessageEndPoint = "0x01"
MessageContent="55534243000000000000000000000011060000000000000000000000000000"
NoDriverLoading=1
保存退出。
如果3G无线网卡没有在HuaweiTechnologies Co.,Ltd后显示出Modem信息,可用如下命令:
#usb_modeswitch -c/etc/usb_modeswitch.d/12d1\:1f01
安装上网相关配置软件:
#sudo apt-get install ppp wvdial
修改配置文件vim /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99***1#
Password = 123
Username = 123
root@ubuntu:~# wvdial
--> WvDial: Internet dialer version 1.61
--> 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
--> Carrier detected. Waiting for prompt.
--> Don't know what to do! Starting pppd and hoping for the best.
--> Starting pppd at Thu Jun 13 10:01:19 2013
--> Pid of pppd: 1177
--> Using interface ppp0
--> pppd: °èH[01]ðH[01]
--> pppd: °èH[01]ðH[01]
--> pppd: °èH[01]ðH[01]
--> pppd: °èH[01]ðH[01]
--> pppd: °èH[01]ðH[01]
--> pppd: °èH[01]ðH[01]
--> local IP address 10.46.230.16
--> pppd: °èH[01]ðH[01]
--> remote IP address 10.64.64.64
--> pppd: °èH[01]ðH[01]
--> primary DNS address 218.104.111.114
--> pppd: °èH[01]ðH[01]
--> secondary DNS address 218.104.111.122
--> pppd: °èH[01]ðH[01]
^CCaught signal 2: Attempting to exit gracefully...
--> Terminating on signal 15
--> pppd: ▒▒H[01]▒▒H[01]
--> Connect time 0.4 minutes.
--> pppd: ▒▒H[01]▒▒H[01]
--> pppd: ▒▒H[01]▒▒H[01]
--> pppd: ▒▒H[01]▒▒H[01]
--> Disconnecting at Thu Jun 13 10:01:44 2013