In a previous post I disgusted my unsuccessful attempts to use my favourite wireless network scanner, Ubuntu 7.10 (Gutsy).
One commenter suggested disabling network manager but even with Network Manager disabled the card would refuse to be put into monitor mode, essential for kismet.
My next plan of attack was to look at the offending driver. Kismet had worked in previous versions of ubuntu and some after some research I found that there was a new driver for the ralink card which was now included in the distro.
The rt2500 driver and other drivers for other ralink cards are provided by “serialmonkey” and I tried here first. There are two versions of the driver a legacy version and the new version.
My first thought was to compile the latest version of the “new” driver from CVS. Unfortunately the CVS version of rt2×00 driver won’t compile against current ubuntu kernel (2.6.22-14)
Here are my notes on what I did next…
Next, downloading and compiling the Enhanced Legacy Drivers from serialmonkey.com installs the older driver.
This legacy driver works reliably but breaks network manager meaning that everything has to be configured from the command line for everyday use.
When ‘make install’ is run as root from the rt2500 source package an alias is added to /etc/modprobe.d/ the file is called ralink and contains.
alias ra0 rt2500
Oddly though, the interface name is still “wlan0″
lsmod | grep rt25 reveals:
rt2500pci 19072 0
rt2x00pci 11520 1 rt2500pci
rt2x00lib 19584 2 rt2500pci,rt2x00pci
mac80211 171016 3 rt2500pci,rt2x00pci,rt2x00lib
eeprom_93cx6 3200 1 rt2500pci
rt2500 180836 1
it seems both drivers are loaded and nothing is really working.
A Better Way?
At this point a reader of this blog, Iain Cheyne, posted an interesting set of instructions which suggest that I am going about things in the wrong way. Instead of changing drivers, the poster suggests I should be upgrading to the latest version of kismet which should work with the new driver.
ok…. This is something I should try. The new version of kismet is not avaliable from ubuntu repos but I should be able to compile from source without too much trouble.
But first I have to restore my system to working order.
Module alias
I relised that I didn’t really know how ubuntu chooses which modules to load at boot.
I have found where the modules are located:
/lib/modules/2.6.22-14-generic/extra/rt2500.ko
/lib/modules/2.6.22-14-generic/ubuntu/wireless/rt2x00/rt2500pci.ko
Alias’ refering to them are found in the file:
/lib/modules/2.6.22-14-generic/modules.alias
This file is apparently built automatically by the command depmod and contains information about which drivers can be used for which hardware. Depmod looks through all the drivers under /lib/modules/ and picks out the information it needs. Not unexpectedly, I have entries for both rt2500 (the old driver) and rt2500pci (new driver) and they both specify the same hardware IDs (pci:v00001814d00000201sv*sd*bc*sc*i*)
I don’t know how the kernel decides to load modules I wonder if it uses the modules.alias file, or something else.
If it is the modules.alias file then logically if I simply remove the rt2500.ko file and run depmod then the configuration should be back to normal…
I’ll try it.
move the module to my home directory:
/lib/modules/2.6.22-14-generic/extra$ sudo mv rt2500.ko ~
$ sudo depmod
As if by magic the rt2500 entry has gone from the modules.alias file but the rt2500pci entry is still there!
The real test now is to reboot and find out which modules load.
The fisrt thing I notice after reboot is that Network Manager has already connected my wireless before my desktop loads. This can mean only one thing; the legacy driver hasn’t loaded and the new driver is being used.
lsmod confirms it.
$ lsmod | grep rt25
rt2500pci 19072 0
rt2x00pci 11520 1 rt2500pci
rt2x00lib 19584 2 rt2500pci,rt2x00pci
mac80211 171016 4 rc80211_simple,rt2500pci,rt2x00pci,rt2x00lib
eeprom_93cx6 3200 1 rt2500pci
My WiFi is restored
Next to compile kismet…(in part 3)
Summary
- To stop a module from loading at boot you can just delete it from the /lib/modules/<kernel> directories and run depmod.
- The legacy rt2500 module breakes Network Manager.
- There is a newer version of kismet than the one in the ubuntu repos.