Wireless USB

From HotDec

Jump to: navigation, search

We have bought an ChiefMax Ralink RT73 802.11g Wireless USB Ethernet Adapter for the lab.

Contents

Drivers with ndiswrapper

First install ndiswrapper. Obtain the Windows drivers. I had to install onto a Windows machine and then take the C:/Program Files/RALINK/Installer/ directory, but there's probably a linux way to do this with cabextract and unshield. I just can't find the cab files somehow.

Install ndiswrapper:

tar xvzf ndiswrapper-1.21.tar.gz
cd cd ndiswrapper-1.21/
make
su
make install

Extract and install drivers obtained from Windows:

tar xvzf rt73.win.tgz
cd Installer/WINXP/
/usr/sbin/ndiswrapper -i rt73.inf
/usr/sbin/ndiswrapper -l

The output should be:

Installed drivers:
rt73            driver installed

Load the module:

/sbin/depmod -a
/sbin/modprobe ndiswrapper

The wireless adapter should now work!

Boot Process

We'd like the wireless network to be correct on each boot, without intervention. Here's how:

Red Hat

Add the module to the boot process:

su
cd /etc/sysconfig/modules
echo "modprobe ndiswrapper" >> init.modules
chmod 700 init.modules

Create the ifup configuration file for wlan0: /etc/sysconfig/network-scripts/ifcfg-wlan0=

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Wireless
DHCP_HOSTNAME=elegy.mie.uiuc.edu
USERCTL=no
PEERDNS=yes
IPV6INIT=no
MODE=Managed
ESSID='UIUCnet'
IPADDR=192.17.222.28
RATE=Auto
CHANNEL=
DOMAIN=

At this point, the driver loads and is correctly configured by ifup on boot, but wlan0 is the default route in the routing table. This is undesirable, since most wireless traffic is filtered by the VPN. The reason that wlan0 is the default is simply because it was the last one to be configured, and it was last simply because 'w' comes after 'e' in the alphabet. To solve this, then, all we need to add is the following line, on line 53:

/etc/rc.d/init.d/network:

     44 # find all the interfaces besides loopback.
     45 # ignore aliases, alternative configurations, and editor backup files
     46 interfaces=`ls ifcfg* | \
     47             LANG=C sed -e '/\(ifcfg-lo\|rpmsave\|:\|rpmorig\|rpmnew\)/d' \
     48                        -e '/\(~\|\.bak\)$/d' \
     49                        -e '/ifcfg-[A-Za-z0-9\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \
     50             LANG=C sort -k 1,1 -k 2n | \
     51             LANG=C sed 's/ //'`
     52
     53 interfaces=`echo "$interfaces" | sort -r`
     54
     55 # See how we were called.
     56 case "$1" in
     57   start)
     58         # IPv6 hook (pre IPv4 start)
     59         if [ "$NETWORKING_IPV6" = "yes" ]; then

Debian

(TODO)

Native Drivers (Deprecated)

The Linux Driver can be found here under the heading "RT2571W/RT2671". Using these Linux-native drivers seems to cause the kernel to hang when performing operations such as ifup/down and setting the essid.These drivers seem to cause the kernel to lock up randomly.


Installing the driver on Debian (2.6 kernel)

  • In aptitude, install 'linux-headers-386' and 'tofrodos'
cp Makefile.6 Makefile
make
sudo bash
mkdir -p /etc/Wireless/RT73STA/
dos2unix rt73sta.dat
cp rt73sta.dat /etc/Wireless/RT73STA/
cp rt73.bin /etc/Wireless/RT73STA/
insmod rt73.ko

Now to make it properly configured on startup (still as root):

mkdir -p /lib/modules/<version>/kernel/drivers/net/wireless/rt73
mv rt73.ko /lib/modules/<version>/kernel/drivers/net/wireless/rt73
depmod

Add "rt73" to the end of the file "/etc/modules"

To use the wired internet

Sometimes the routing tables are such that the wireless adapter is being used instead of the wired ethernet. This is undesirable since the wireless is filtered by a VPN server, and VPN clients are not generally installed (and have proven unreliable). To force the network to use the wired ethernet, use the following command:

route del default rausb0</pre>