工作的大体思路如下:
用iwconfig开启无线网卡的电源,并查找区域内的无线网络
连接到相应的无线网络
通过ifconfig启用无线网卡,并获取IP(如果使用DHCP)
注意:
假设无线被识别为wlan0,如果的网卡没有被识别为wlan0,可以在 *** 作时做相应的修改。
具体过程
1、 打开无线网卡电源
iwconfig wlan0 txpower on
无线网络的信号灯应该亮了。
2、 列出区域内的无线网络
iwlist wlan0 scan
3、 假设要连接到网络MyHome(即essid为MyHome的网络),那么输入命令
iwconfig wlan0 essid "MyHome"
如果网络是加密的,密码是0123456789,那么就输入命令
iwconfig wlan0 essid "MyHome" key 0123-4567-89
4、 如果正常,输入
iwconfig wlan0
就可以看到连接正常的各项参数了。
5、 启用无线网卡
ifconfig wlan0 up
6、 如果是用DHCP获取IP的,那么用dhclient 或dhcpcd获取ip
dhclient wlan0
或
dhcpcd wlan0
7、 现在无线网卡应该可以正常使用了。
【WCDMA】【EVDO】【TD-SCDMA】目前可以做到硬件兼容 MG3732 MC8630 MT3732产品名称:MG3732产品类别:WCDMA系列品 牌:中兴产品信息:网络:WCDMA/HSPA频段:"WCDMA850/1900/2100MHzGSM850/900/1800/1900MHz"温度:-30℃~+75℃电压:3.3V~4.25V/典型值3.8V功耗:待机电流约10mA接口:双排36Pin邮票孔贴片USB:USB 2.0驱动:Windows/WinCE/Linux/Android速率:3.6Mbps/384Kbps功能:暂不支持UART和PCM音频:差分/单端两路模拟语音命令:标准AT命令/ZTE专有命令认证:3C/RoHS/型号核准证亮点:单面布局,超薄设计,面积小、体积小,硬件兼容MC8630尺 寸:39.5×31.0×2.65mm产品名称:MC8630产品类别:CDMA2000系列品 牌:中兴产品信息:网络 CDMA2000 1X/EV-DO Rev.A频段 800MHz温度 -30℃~+75℃电压 3.0V~4.4V/典型值3.6V功耗 待机电流约3mA接口 双排36Pin邮票孔贴片USB USB 2.0驱动 Windows/WinCE/Linux/Android速率 3.1Mbps/1.8Mbps功能 手机版本支持UART串口音频 差分/单端模拟语音/PCM数字语音命令 标准AT命令/电信AT命令认证 型号核准证亮点 单面布局,超薄设计,面积小、体积小,硬件兼容MG3732尺 寸:39.5×27.0×2.35mm产品名称:MT3732产品类别:TD-SCDMA系列品 牌:中兴产品信息:网络:TDGSM850/900/1800/1900MHz"温度:-30℃~+75℃电压:3.3V~4.25V/典型值3.8V功耗:待机电流约10mA接口:双排36Pin邮票孔贴片USB:USB 2.0驱动:Windows/WinCE/Linux/Android速率:3.6Mbps/384Kbps功能:暂不支持UART和PCM音频:差分/单端两路模拟语音命令:标准AT命令/ZTE专有命令认证:3C/RoHS/型号核准证亮点:单面布局,超薄设计,面积小、体积小,硬件兼容MC8630尺 寸:39.5×31.0×2.65mm[root@localhost ~]# cat /etc/wvdial.conf[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init6 = AT+CFUN =1
Phone = *99#
Idle Seconds = 300
Auto DNS = 0
Password = any
Modem Type = Analog Modem
Stupid Mode = 1
Compuserve = 0
Baud = 115200
New PPPD = yes
Dial Command = ATDT
Ask Password = 0
Init = AT+CGDCONT=1,"IP","3gnet"
ISDN = 0
Username = any
Modem = /dev/ttyUSB1
[root@localhost ~]# cat /etc/ppp/options
noipdefault
ipcp-accept-local
ipcp-accept-remote
defaultroute
noauth
crtscts
debug
dns 220.21.4.130
dns 221.5.88.88
[root@localhost ~]# wvdial
-->WvDial: Internet dialer version 1.61
-->Initializing modem.
-->Sending: AT+CGDCONT=1,"IP","3gnet"
AT+CGDCONT=1,"IP","3gnet"
ERROR
-->Bad init string.
-->Initializing modem.
-->Sending: AT+CGDCONT=1,"IP","3gnet"
AAT+CGDCONT=1,"IP","3gnet"
ERROR
-->Bad init string.
-->Initializing modem.
-->Sending: AT+CGDCONT=1,"IP","3gnet"
AT+CGDCONT=1,"IP","3gnet"
OK
-->Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
-->Sending: AT+CFUN =1
AT+CFUN =1
OK
-->Modem initialized.
-->Idle Seconds = 300, disabling automatic reconnect.
-->Sending: ATDT*99#
-->Waiting for carrier.
ATDT*99#
CONNECT 7200000
-->Carrier detected. Starting PPP immediately.
-->Starting pppd at Thu Oct 27 14:45:46 2011
-->Pid of pppd: 2804
-->Using interface ppp0
-->Disconnecting at Thu Oct 27 14:46:16 2011
-->The PPP daemon has died: A modem hung up the phone (exit code = 16)
-->man pppd explains pppd error codes in more detail.
-->Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
[root@localhost ~]# tail -n 50 /var/log/messages
Oct 27 14:45:38 localhost kernel: [ 1680.465277] usb 1-1: SerialNumber: 1234567890ABCDEF
Oct 27 14:45:39 localhost kernel: [ 1681.196845] scsi4 : usb-storage 1-1:1.2
Oct 27 14:45:39 localhost usb_modeswitch: switched to 1e89:1a20 (USB Modem: USB Modem)
Oct 27 14:45:39 localhost kernel: [ 1681.748929] USB Serial support registered for GSM modem (1-port)
Oct 27 14:45:39 localhost kernel: [ 1681.749378] usbcore: registered new interface driver option
Oct 27 14:45:39 localhost kernel: [ 1681.749386] option: v0.7.2:USB Driver for GSM modems
Oct 27 14:45:39 localhost logger: usb_modeswitch: adding device ID 1e89:1a20 to driver "option"
Oct 27 14:45:39 localhost kernel: [ 1681.759098] option 1-1:1.0: GSM modem (1-port) converter detected
Oct 27 14:45:39 localhost kernel: [ 1681.759462] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
Oct 27 14:45:39 localhost kernel: [ 1681.759597] option 1-1:1.1: GSM modem (1-port) converter detected
Oct 27 14:45:39 localhost kernel: [ 1681.759871] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
Oct 27 14:45:39 localhost kernel: [ 1681.760171] option 1-1:1.3: GSM modem (1-port) converter detected
Oct 27 14:45:39 localhost kernel: [ 1681.760714] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
Oct 27 14:45:40 localhost kernel: [ 1682.199117] scsi 4:0:0:0: Direct-Access USBModem Disk 2.31 PQ: 0 ANSI: 2
Oct 27 14:45:40 localhost kernel: [ 1682.202604] sd 4:0:0:0: Attached scsi generic sg1 type 0
Oct 27 14:45:40 localhost kernel: [ 1682.205810] sd 4:0:0:0: [sdb] Attached SCSI removable disk
Oct 27 14:45:40 localhost mtp-probe: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1"
Oct 27 14:45:40 localhost mtp-probe: bus: 1, device: 7 was not an MTP device
Oct 27 14:45:40 localhost modem-manager[818]: <info>(ttyUSB1) opening serial port...
Oct 27 14:45:41 localhost modem-manager[818]: <info>(ttyUSB2) opening serial port...
Oct 27 14:45:41 localhost modem-manager[818]: <info>(ttyUSB0) opening serial port...
Oct 27 14:45:46 localhost kernel: [ 1688.604307] PPP generic driver version 2.4.2
Oct 27 14:45:46 localhost pppd[2804]: pppd 2.4.5 started by suozhang, uid 0
Oct 27 14:45:46 localhost pppd[2804]: Using interface ppp0
Oct 27 14:45:46 localhost lldpad[925]: evb_ifdownort ppp0 remove failed
Oct 27 14:45:46 localhost lldpad[925]: vdp_ifdownpp0 vdp data remove failed
Oct 27 14:45:46 localhost pppd[2804]: Connect: ppp0 <-->/dev/ttyUSB1
Oct 27 14:45:48 localhost modem-manager[818]: <info>(ttyUSB1) closing serial port...
Oct 27 14:45:48 localhost modem-manager[818]: <info>(ttyUSB1) serial port closed
Oct 27 14:45:48 localhost modem-manager[818]: <info>(ttyUSB1) opening serial port...
Oct 27 14:45:55 localhost modem-manager[818]: <info>(ttyUSB2) closing serial port...
Oct 27 14:45:55 localhost modem-manager[818]: <info>(ttyUSB2) serial port closed
Oct 27 14:45:55 localhost modem-manager[818]: <info>(ttyUSB2) opening serial port...
Oct 27 14:45:55 localhost modem-manager[818]: <info>(ttyUSB1) closing serial port...
Oct 27 14:45:55 localhost modem-manager[818]: <info>(ttyUSB1) serial port closed
Oct 27 14:45:59 localhost modem-manager[818]: <info>(ttyUSB0) closing serial port...
Oct 27 14:45:59 localhost modem-manager[818]: <info>(ttyUSB0) serial port closed
Oct 27 14:45:59 localhost modem-manager[818]: <info>(ttyUSB0) opening serial port...
Oct 27 14:46:01 localhost modem-manager[818]: <info>(ttyUSB2) closing serial port...
Oct 27 14:46:01 localhost modem-manager[818]: <info>(ttyUSB2) serial port closed
Oct 27 14:46:02 localhost modem-manager[818]: <info>(ttyUSB0) closing serial port...
Oct 27 14:46:02 localhost modem-manager[818]: <info>(ttyUSB0) serial port closed
Oct 27 14:46:02 localhost modem-manager[818]: <warn>plugin 'Generic' claimed to support tty/ttyUSB0 but couldn't: (-1) (unknown)
Oct 27 14:46:16 localhost pppd[2804]: LCP: timeout sending Config-Requests
Oct 27 14:46:16 localhost pppd[2804]: Connection terminated.
Oct 27 14:46:16 localhost avahi-daemon[743]: Withdrawing workstation service for ppp0.
Oct 27 14:46:16 localhost pppd[2804]: Modem hangup
Oct 27 14:46:16 localhost pppd[2804]: Exit.
Oct 27 14:46:16 localhost lldpad[925]: evb_ifdownort ppp0 remove failed
Oct 27 14:46:16 localhost lldpad[925]: vdp_ifdownpp0 vdp data remove failed
[root@localhost ~]#
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)