D-Link DWL-G122 USB无线网卡驱动安装配置

时间:2022-03-29 00:24:26

 
D-Link DWL-G122 USB WLAN

1、修改内核, 增加WLAN支持
# cd /usr/src/linux-2.6.18-lemote
# make menuconfig
依次点击Device Drivers --->Network device support -->Wireless LAN (non-hamradio) -->
选中Wireless Lan drivers (non-hamradio) & Wireless Extensions

# make
# make modules_install
# cp vmlinux /boot/vmlinux-2.6.18-godson2e

2、下载rt73驱动程序
DWL-G122 H/W Ver: C1采用Ralink的rt73 (rt2571W)芯片组。
驱动程序从The rt2x00 Open Source Project网站上下载,如下所示:
# wget http://rt2x00.serialmonkey.com/rt73-cvs-daily.tar.gz

3、编译、安装驱动
由于下载的是cvs版本,解压后的目录名中的日期会变化,请自行修改。
# tar zxvf rt73-cvs-daily.tar.gz
# cd rt73-cvs-20070309/Module
# make
# make install

修改/etc/modprobe.d/aliases文件, 在最后增加一行:alias rausb0 rt73
然后运行/sbin/depmod -a

4、安装Wireless Tools
# apt-get install iwconfig
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package iwconfig
debian:/etc/network# apt-get install wireless-tools
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
wireless-tools
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 108kB of archives.
After unpacking 365kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
wireless-tools
Install these packages without verification [y/N]? y
Get:1 http://www.lemote.com etch/main wireless-tools 28-1 [108kB]
Fetched 108kB in 5s (19.3kB/s)
Selecting previously deselected package wireless-tools.
(Reading database ... 92733 files and directories currently installed.)
Unpacking wireless-tools (from .../wireless-tools_28-1_mipsel.deb) ...
Setting up wireless-tools (28-1) ...

5、配置WLAN
重新启动机器,先用lsusb查看USB状态
# lsusb
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 07d1:3c03 D-Link System

再用lsmod查看是否用rt73模块,
# lsmod
rt73 398144 0
uhci_hcd 25808 0

或从/var/log/messages中查看有没有下列信息:
Mar 10 20:09:57 localhost kernel: rtusb init ====>
Mar 10 20:09:57 localhost kernel: idVendor = 0x7d1, idProduct = 0x3c03
Mar 10 20:09:57 localhost kernel: usbcore: registered new driver rt73

启动接口
# ifconfig rausb0 up
# ifconfig
rausb0 Link encap:Ethernet HWaddr 00:19:5B:81:B9:9E
inet6 addr: fe80::219:5bff:fe81:b99e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:270 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17766 (17.2 KiB) TX bytes:0 (0.0 B)

查看WLAN
# iwconfig
rausb0 RT73 WLAN ESSID:""
Mode:Managed Frequency=2.412 GHz Bit Rate=54 Mb/s
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=0/100 Signal level:-121 dBm Noise level:-115 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

扫描WLAN,找到AP
# iwlist rausb0 scanning
rausb0 Scan completed :
Cell 01 - Address: 00:15:E9:F3:3F:B0
ESSID:"dd-wrt"
Mode:Managed
Channel:1
Encryption key:on
Bit Rates:2 Mb/s

连接AP,使用5位ASCII密码
# iwconfig rausb0 essid "dd-wrt" mode Managed key s:*****

# iwconfig
rausb0 RT73 WLAN ESSID:"dd-wrt"
Mode:Managed Frequency=2.412 GHz Access Point: 00:15:E9:F3:3F:B0
Bit Rate=54 Mb/s
RTS thr:off Fragment thr:off
Encryption key:****-****-**
Link Quality=100/100 Signal level:-28 dBm Noise level:-79 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

使用DHCP获取IP地址
# dhclient rausb0
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/rausb0/00:19:5b:81:b9:9e
Sending on LPF/rausb0/00:19:5b:81:b9:9e
Sending on Socket/fallback
DHCPDISCOVER on rausb0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.1
DHCPREQUEST on rausb0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.191 -- renewal in 246 seconds.

如果想开机时就启动无线网络,那么通过修改/etc/network/interfaces文件就能实现,在该文件中增加如下内容:
auto rausb0
iface rausb0 inet dhcp
pre-up ifconfig rausb0 up
pre-up iwconfig rausb0 essid "dd-wrt" key s:*****

上面的essid和key根据自己的具体情况做修改。