0. Preface
First of all, I'd like to thank luca_linux for posting the great ipw2200+wpa HOWTO, which helped me get my own WPA set up. However, that HOWTO is a little old (based on an older wpasupplicant and Ubuntu 5.04?) and assumed that one had internet access from the WPA-needing system (how else to apt-get wpasupplicant?). Also, the newer wpasupplicant package provides its own startup script. So here is my updated version, most specifically targeted at newer users not as familiar with Linux.
1. Assumptions
- You have access to a computer setup with internet access that can download a small file (156KB) and transfer it to some portable media (e.g. a floppy disk).
- You have successfully installed Ubuntu 5.10 (Breezy Badger) on the system that needs WPA-enabled wireless access.
- You have your wireless card driver installed and correctly configured.
2. Download wpasupplicant
On the internet-enabled computer, download wpasupplicant from the Ubuntu repository. On a Linux machine, it would look like this:
Code:
wget http://us.archive.ubuntu.com/ubuntu/pool/universe/w/wpasupplicant/wpasupplicant_0.4.5-0ubuntu1_i386.deb
And then copy it to a floppy drive (or whatever you plan to copy it to):
Code:
mount /media/floppy
cp wpasupplicant_0.4.5-0ubuntu1_i386.deb /media/floppy
umount /media/floppy
3. Install wpasupplicant
Now get on your Breezy Badger machine, mount the disk with wpasupplicant, and install it:
Code:
mount /media/floppy
sudo dpkg -i /media/floppy/wpasupplicant_0.4.5-0ubuntu1_i386.deb
4. Edit wpasupplicant configuration files
First I would recommend backing up the default configuration files:
Code:
sudo cp /etc/default/wpasupplicant /etc/default/wpasupplicant_backup
sudo cp /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf_backup
Then begin by editing /etc/default/wpasupplicant:
Code:
sudo gedit /etc/default/wpasupplicant
Change line 5 to:
and change line 16 to something like:
Code:
OPTIONS="-D madwifi -i ath0 -c /etc/wpa_supplicant.conf -w"
Values in red need to be customized to match your system. The first parameter indicates the driver being used, in my example madwifi for my Netgear WG311T, but can be one of: hostap, hermes, madwifi, atmel, wext, ndiswrapper, broadcom, ipw, wired, bsd, and ndis. If not sure which one to use, consult the wpa_supplicant README.
Now we will edit /etc/wpa_supplicant.conf:
Code:
sudo gedit /etc/wpa_supplicant.conf
Comment out the last 4 lines like so:
Code:
#network={
# ssid=""
# key_mgmt=NONE
#}
Then we will append the appropriate information to the end of this file from the terminal:
Code:
wpa_passphrase your_ssid | grep -v "#psk" | sudo tee -a /etc/wpa_supplicant.conf
Once again, your_ssid needs to be customized to match your setup. This step allows us to store the passphrase in something other than plain text. The operation will appear to halt: it is waiting for you to enter in your WPA passphrase. Type it in, and press enter. Some output will appear: that information has just been added to your configuration file. Then we will only allow root to read the file:
Code:
sudo chmod 600 /etc/wpa_supplicant.conf
Now we are done editing the configuration files!
5. Configure wpasupplicant to start when booting
It is essential that wpasupplicant run after your wireless card driver is loaded but before Ubuntu attempts to configure it via DHCP or whatever. Since the scripts in /etc/rcS.d are executed in ascending alphanumeric order, this meant, in the case of my setup, after the hotplug (run level 40) but before networking (also run level 40). Therefore, I needed the startup script to be alphabetically between "hotplug" and "networking", so I called it "iwpa":
Code:
cd /etc/rcS.d
sudo ln -s ../init.d/wpasupplicant S40iwpa
Now wpasupplicant will startup at the appropriate time each time you have to reboot.
6. Start wpasupplicant
Fortunately, we don't have to reboot to enjoy the newly configured WPA. Just bring up the startup script and restart your networking:
Code:
sudo invoke-rc.d wpasupplicant start
sudo invoke-rc.d networking restart
Enjoy!