Linux下无线网卡的安装
用lsusb查看USB的安装情况,如下图使用yum安装
已经成功安装
查看无线网卡
进入到cd /lib/modules/2.6.32-431.el6.i686/kernel/drivers/net/ wimax/wireless/查看无线网卡版本
[root@host2 net]# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 002: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter
根据已有的驱动,把驱动拷到linux下
然后编译安装驱动
查看无线网卡有命令iwconfig
[root@host2 rtl]# iwconfig
-bash: iwconfig: command not found
提示没有这个指令
需要安装无线网卡工具
[root@host2 rtl]# cd /media/cdrom/Packages/
[root@host2 Packages]# ll |grep -i wireless
-r--r--r--. 2 root root 94584 Jul 3 2011 wireless-tools-29-5.1.1.el6.i686.rpm
-r--r--r--. 2 root root 95848 Jul 3 2011 wireless-tools-29-5.1.1.el6.x86_64.rpm
[root@host2 Packages]# yum install wireless -y
现在可以使用iwconfig查看无线网卡设置了
[root@host2~]# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
wlan0 unassociated Nickname:"rtl_wifi"
Mode:Auto Access Point: Not-Associated Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/100 Signal level=0 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
无线网卡wlan0已经出现了
现在将我们的wlan0启动
[root@host2 ~]# ifconfig wlan0 up
搜索无线网络
[root@host2~]# iwlist wlan0 scanning
你会看到你附近能搜索的无线网列表
[root@host2 rtl3037]# iwlist wlan0 scanning
wlan0 Scan completed :
Cell 01 - Address: A8:57:4E:78:A4:02
ESSID:"NET-1"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:300 Mb/s
Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD310050F204104A00011010440001021047001000000000000010000000A8574E78A402103C0001011049000600372A000120
Signal level=23/100
Cell 02 - Address: F8:D1:11:FB:F6:D4
ESSID:"php-1"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:300 Mb/s
Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Signal level=23/100
到这一步已经可以找到无线网了
想要连接无线网还需要安装一个wpa工具
进入系统光盘查看与wpa相关的软件包
[root@host2 rtl3037]# cd /media/cdrom/Packages/
[root@host2 Packages]# ll |grep -i wpa_supplicant
-r--r--r--. 2 root root 374368 Feb 4 2013 wpa_supplicant-0.7.3-4.el6_3.i686.rpm
安装这个软件包来连接
[root@h2ost Packages]# yum install wpa_supplicant -y
安装好后用 wpa_passphrase来设置无线网的名称和密码
格式是 wpa_passphrase <SSID> [password]
[root@host2 Packages]# wpa_passphrase NET-1
# reading passphrase from stdin
123!@#qaz
network={
ssid="NET-1"
#psk="123!@#qaz"
}
设置好后就可以连接了
连接用 wpa_supplicant 命令
[root@host2]# wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf
-B 后台运行 -i 选择网卡 -D wext -c 配置文件地址
动态获得IP地址
[root@host2 Packages]# dhcpclient wlan0
编辑开机脚本
[root@lhost2 Packages]# vim /etc/rc.d/rc.local
在末尾添加以下3条命令
modprobe 3037u
wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant/wpa_supplicant.conf
dhcpclient