Debian rt2500 Howto
This HOWTO details using an rt2500 card with Debian.
Preparing the Compilation Environment
Debian provides a tool named
module-assistant which automates the process of installing out-of-kernel modules onto your Debian system. To prepare your system to install the rt2500 driver, you will need to install module-assistant and instruct it to prepare itself. This preparation includes automatically installing the kernel headers for your kernel, if they're not already present.
# apt-get install module-assistant # module-assistant prepare
Obtaining the Driver
The rt2500 driver source is contained in the
rt2500-source package. This package is in the Debian repositories for the testing ("Etch") and unstable ("Sid") branches. It is not in the stable (3.1 aka "Sarge") repository.
For Etch or Sid, simply:
# apt-get install rt2500-source
For Sarge, you will have to download one of the available versions of rt2500-source and install it with:
# dpkg --install rt2500-source-*.deb
With the source package installed, we can now use module-assistant to compile the driver for us.
Compiling the Driver
To compile the driver, simply type:
# module-assistant auto-install rt2500-source
This will compile the driver against the kernel headers matching the kernel you're currently using, put the compiled driver module in the right place to be used by your kernel, and load the module for you. Your rt2500-based card should now show up with:
# ifconfig -a
NB: In future, the rt2500 kernel module should be loaded automatically on boot. If it isn't, append the module name to
# echo rt2500 >> /etc/modules
NB: This section is entirely optional, but may make your life easier.
Your rt2500 card should show up on your system with a name such as
eth1. The number is assigned incrementally by the kernel in the order in which interfaces are discovered. This means that changing your system, by compiling other network card drivers or upgrading your kernel, can change the identifier which is assigned to your card. This can be a nonobvious bug to track down when it occurs.
ifrename utility can be used to assign names to interfaces using a variety of techniques, overriding the kernel's naming scheme. Most usefully for us, we can give a particular name for an interface based on its MAC address, a unique identifier. To install the
# apt-get install ifrename
To get the MAC address of your rt2500 device, assuming it is named
# ifconfig eth1
The MAC address is on the first line, indicated by
HWaddr:. To tell
ifrename to use a different name (such as
eth-wifi for the interface with this MAC address, we need to create a
/etc/iftab file. This is documented in
man iftab, but for a quick setup:
# echo -e 'eth-wifi\t\tmac 00:00:00:00:00:00
Replace 00:00:00:00:00:00 with the MAC address of your device. To double-check that
ifrename will do what you expect it to do:
# ifrename -DV
If it's not working as expected, try tweaking the configuration file. If it is:
This will automatically be performed on boot, so from now on you can treat your wireless card as having the name you've chosen.
Of course, if you need your wireless working to install
ifrename, you can delay this step. However, don't forget to change anything you put in
/etc/network/interfaces (see "Automate It") to match your new interface name.
Configure the Card
Download the wireless-tools package if it's not already installed.
# apt-get install wireless-tools
wireless-tools provides you with the
iwpriv commands. Along with
ifconfig command, these should be enough to get your card working. Check the manpages for details; you probably don't need
iwpriv unless you're using WPA.
WPA isn't directly supported by the Linux Wireless Tools API, so you need to use
iwpriv to enable functionality directly on the card:
# ifconfig eth-wifi up # iwconfig eth-wifi channel 5 # iwconfig eth-wifi essid youressidname # iwpriv eth-wifi set AuthMode=WPAPSK # iwpriv eth-wifi set EncrypType=TKIP # iwpriv eth-wifi set WPAPSK="wireless password" # ifconfig eth-wifi 10.0.0.2
ifconfig is being used to control the interface state and IP configuration,
iwconfig for general wireless configuration, and
iwpriv for WPA-specific options.
Once everything is working, you probably want the card to activate on startup. In Debian, the file
/etc/network/interfaces contains settings for network interfaces, and is documented in
man 5 interfaces. Integration of the
iwconfig commands is described in
Add something similar to these lines somewhere in the file:
auto eth-wifi iface eth-wifi inet dhcp wireless-essid MyESSID wireless-key 12345678
The "auto" line means it will be brought up automatically during the boot sequence. Replace MyESSID with your ESSID and 12345678 with your WEP key if you have one. Don't put dashes in your WEP key. If you don't have a WEP key, which is bad, then comment out that line by putting a # in front of it.
This will use DHCP. For static IP addressing, see the manpage for the configuration file. Note that for static IP addressing, you will need to put your DNS information into
/etc/resolv.conf by hand, unless you use the
resolvconf package (see "Tip:
You can now bring your wireless interface down and up by hand with the following commands:
# ifdown eth-wifi # ifup eth-wifi
If you wish to use WPA then add the lines below in addition to those above
pre-up ifconfig eth-wifi up pre-up iwpriv eth-wifi set AuthMode=WPAPSK pre-up iwpriv eth-wifi set EncrypType=TKIP pre-up iwconfig eth-wifi essid youressidname pre-up iwpriv eth-wifi set WPAPSK=”wireless password”
resolvconf package allows other packages to update the
/etc/resolv.conf file automatically. It allows you to put DNS server information in the interface stanzas in
/etc/network/interfaces, so you don't have to edit two files. Install it with:
# apt-get install resolvconf
Once installed, you can add lines like the following to your interface stanza:
dns-nameservers x.x.x.x dns-search yourdomainname
This is an example of a working configuration using WEP:
auto eth-wifi iface eth-wifi inet static address 192.168.1.1 netmask 255.255.255.0 wireless_mode ad-hoc wireless_channel 7 wireless_essid mynetwork wireless_keymode restricted wireless_key1 55d317375c1ce6f0aa0f0d3aef
This is the configuration from a firewall machine, which is why it has no
gateway option. Note that this machine probably should be run as an access point, but the rt2500 driver does not support this, so it's an ad-hoc network. Ad-hoc 802.11g networks are limited to 11Mbps by the 802.11g spec, though this can be violated with an
wireless_keymode restricted will stop any non-WEP-encrypted traffic being received by the firewall, which is a sensible precaution if you're relying on the limited security that WEP provides.