Adverts

The motherboard that I build my AMD64 board around came with a built in wireless card which, as I'd never used wireless, I'd never bothered to get working under Linux. I knew that the Linux support for wireless cards wasn't great so when I installed Debian it seemed like a waste of time trying to get it working - even though I hate having devices that aren't working. Well times change and now I need to use the wireless card. The first thing to do is find out what type of card it is. This I did by querying the Windows drivers but that was simply because I was booted into Windows at the time. I could equally well have run the command lspci. Which would tell me what PCI devices were connected to the machine. Running this command gave:

RaLink RT2500 802.11g Cardbus/mini-PCI (rev 01)

Once you know what card you have you need to get the drivers. RaLink provided an early set of drivers but from what I have read they are pretty poor and unsupported so I don't recommend trying them. There are two open source drivers for this family of cards both from the same project - a legacy driver and new driver. The legacy driver is being maintained but most of the development effort seems to have moved onto the new driver now. The problem is that the new driver is still highly experimental - it works for the most part but it needs a very new kernel (2.6.22 when 2.6.21 has only just been released into Sid).The legacy drivers cover these chipsets: rt2400, rt2500, rt2570, rt61 and rt73 so I will try the legacy driver for now. In order for the set up to be satisfactory it needs to be able to maintain a good solid link, use WPA-PSK encryption, and run moderately quickly 802.11g is preferred but I'll suffer 802.11b.

I first tried to use the version of the driver currently supplied by Debian. The installation of that driver, using module-assistant, is detailed in the great "howto" page linked below in the references section. The problem is that it doesn't work for me. The source provided by Debian is very old (well over a year out of date at the time of writing) and seems to have a number of bugs. The solution it to grab the latest source and compile up and install your own module. Sounds daunting but it's really easy.

Grab the latest source from here and unpack it on your system. As root enter the directory it is unpacked into and then descend into the Modules directory. Making sure that you have the kernel headers for you current kernel installed run:

make clean
make

To build the kernel module. It will be called something like rt2500.ko and be in the modules directory. To install the module copy the .ko file to /lib/modules/<uname -a>/kernel/drivers/net/wireless where uname -a is the currently running kernel. Then run:

depmod
modprobe rt2500

Running depmod tells the system about the module and modprobe installs it. If you don't run depmod first modprobe will claim it is unable to find the module. Assuming that has all worked you shoud now have a device called ra0 (or similar) which you can start with ifup ra0.

Now you need to configure your interface. That is done using /etc/network/interfaces and makes use of iwpriv and iwconfig to set parameters on the card. The reason we have to set parameters directly on the card is because the Linux wireless tools don't directly support WPA at the moment. The alternative is to use WEP but that has long been considered massively broken (good tools can break it in < 1 minute). For completeness, nothing currently supports WPA2. You will need to install the package wireless-tools to get the iwpriv and iwconfig tools. The iwconfig tool is like ifconfig except specialized for wireless cards. The iwpriv tool is used to set security on the card. There is also a very useful iwlist utility which tells you about your wireless network and cards.

Once you are happy you have all the tools add or modify the ra0 stanza in the /etc/network/interfaces file. The example below should probably work for most WPA set ups. If you want to use WEP then remove all the pre-up lines and replace them with a line such as "wireless-key 0123456789abcdef". There are plenty of more settings that can be used to tweak your network connection but the vast majority of cards will now auto-negotiate the best connection.

auto ra0
iface ra0 inet dhcp 
wireless-essid MyESSID 
pre-up ifconfig ra0 up
pre-up iwconfig ra0 essid "youressidname"
pre-up iwpriv ra0 set AuthMode=WPAPSK
pre-up iwpriv ra0 set EncrypType=TKIP
pre-up iwpriv ra0 set WPAPSK=”wireless password”  

That's about it if your network is now working. It might be worth specifying that the network is managed

wireless_mode managed

as it might give better speeds. 

 

References

Adverts

Donate and Help

Please support this site and
Bandwidth doesn't grow on trees y' know :o)

Adverts

Get Adsense