Tuesday, 29 May 2007

Ubuntu, a Prism2 based PCMCIA card and WPA

Here are the steps I've followed to configure my Prism2 based PCMCIA card on Ubuntu 7.04 feisty fawn (Xubuntu).

The particular model I'm using is a Tellus TWL-C11 but I'm sure that the exact procedure applies to others like:
  • Digital Data Communications, WPC-0100
  • Belkin, 11Mbps Wireless Notebook Network Adapter
  • Senao, SL-2011CD/SL-2011CDPLUS
  • NETGEAR, MA401
  • SMC-2632
  • US Robotics 2410
(list taken from /etc/pcmcia/hostap_cs.conf)

First of all, you will need to install (or make sure that you have them already installed) two packages:
  • wpasupplicant
  • hostap_utils
You can install them from "Applications/System/Synaptic Package Manager".

After that we'll need to configure the interface. This can be done in /etc/network/interfaces:

auto wlan0
iface wlan0 inet dhcp
wpa-driver hostap
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

This will configure the interface with DHCP and it will force it to use WPA.

Then, a WPA configuration file is needed in /etc/wpa_supplicant/wpa_supplicant.conf. This location is arbitrary, some people place the file directly under /etc (if you do this, remember to change /etc/network/interfaces accordingly).

You can find a post on how to write this file here.

We are almost done. If you insert your card now you will notice that... it doesn't work! The reason why is because Ubuntu is loading three drivers for this card: the right one (hostap) and two incorrect ones (orinoco_cs and hermes). Apparently, this is a known bug in Ubuntu.

But fear not! There is an easy way around it. You'll need to copy the file called /etc/hotplug/blacklist.d/hostap-utils into /etc/modprobe.d/blacklist-hostap-utils (basically copy and rename) and then you have to edit it (use vim, gedit... whatever) and add "blacklist " (blacklist + SPACE) in front of the four lines in the file. It should look like this:

blacklist orinoco_pci
blacklist orinoco_cs
...
and so on.

And that's it! You don't even need to reboot your box, after reinserting your card you should enjoy the pleasures of secure wireless access!

No comments: