HOW TO: Zydas ZD1211 wireless with automatic WPA
Aim
This is the Edgy version of my previous guide. As before, I hope this helps you set up a WPA encrypted wireless network when using a ZD1211 based wireless card, such as the Safecom SWLU-5400 dongle. It comes in 3 parts:
Part 1 – Installing the module
Part 2 – Installing wpa supplicant
User level
Intermedidate. This isn't meant to be a simple list of commands to type in to a terminal because networking has too many options for any one script to cover. You may need to tweak some of the commands or files to your own system settings.
Roadmap
The kernel team are developing a kernel module for this card called ZD1211RW. Expected to be fully functional in 2.6.18, this should mean that these cards will work “out of the box” with the packaged wpa_supplicant. More details can be found at http://zd1211.ath.cx/
Prerequisites
You can navigate around the file system using the terminal
You can copy and move files using the terminal
You can edit files from the terminal.
You can untar packages
You can follow bad how to's
All downloaded files are assumed to be in /usr/src.
Part 1 – Installing the module
1) With Edgy, the delivered wpasupplicant now works using the wext driver. However I couldn't get the built in zd1211rw module to work. To remove the module, open a terminal and type
Code:
sudo modprobe -r zd1211rw
2)To stop the module from loading up on a reboot, blacklist this module by editing /etc/modprobe.d/blacklist and entering on a new line
3) The following may not be essential, but it's worth installing to ensure better success with this and any future projects you might do. In a terminal type:
Code:
sudo apt-get install build-essential kernel-package gcc libncurses5 libncurses5-dev libqt3-mt-dev wireless-tools libssl-dev
4) Work out which version of the kernel you have by typing:
5) Obtain the correct headers and source for the kernel. In my case I'm running 2.6.17-10-generic, so I need to get:
Code:
sudo apt-get install linux-headers-2.6.17-10 linux-headers-2.6.17-10-386 linux-headers-2.6.17-10-generic linux-headers-386 linux-headers-generic linux-source
6) Unpack the source and create a standard symbolic link.
Code:
cd /usr/src
sudo tar -xvjf linux-source-2.6.17.tar.bz2
sudo ln -s /usr/src/linux-headers-2.6.17-10 /usr/src/linux-headers
sudo ln -s /usr/src/linux-source-2.6.17 /usr/src/linux
7) Also make sure you have a link in /lib/modules/2.6.17-10-386/build pointing to /usr/src/linux-headers-2.6.17-10-386. This should be already present, but if not type:
Code:
sudo ln -s /usr/src/linux-headers-2.6.17-10-386 /lib/modules/2.6.17-10-386/build
8.) In /usr/src, download a working version of the ZD1211 driver from http://zd1211.ath.cx/download/.
There are multiple versions of the driver and you may need to experiment with different drivers to get one that works for your particular dongle and kernel. For me, the r77 worked.
{Edit 5th Nov 2006. Have upgraded to r83 as this is more stable and doesn't fill my log. The instructions are identical for this package as well}
9) In /usr/src, untar the source package you selected and edit the Makefile to have the following options:
KERNEL_SOURCE=/usr/src/linux
ZD1211REV_B=0 (set this to 1 if you have a ZD1211B)
10) Compile the module by typing:
Code:
sudo make
sudo make install
11) Copy the resulting zd1211.ko by typing
[code]
use sudo cp /usr/src/zd1211-driver-r77/zd1211.ko /lib/modules/2.6.17-10-386/build/drivers/usb/net/
[code]
12) Install the module using
Code:
sudo depmod
sudo modprobe -v zd1211
13) Now connect the dongle and type
You should see something like:
Code:
[17180336.828000] zd1211 - http://zd1211.ath.cx/ - r77
[17180336.828000] Based on www.zydas.com.tw driver version 2.5.0.0
[17180336.828000] usbcore: registered new driver zd1211
If you get any error codes here, you will need to go back to 8.) and use another driver package.
14) If you have an unsecured network, you should be able to start browsing. To check type:
to list all the active network connections
to list the status of your wireless connection.
You may need to edit /etc/network/interfaces. To help I've pasted my file below
Code:
auto lo
iface lo inet loopback
#iface eth0 inet static
#address 192.168.0.135
#netmask 255.255.255.0
#gateway 192.168.0.1
auto wlan0
iface wlan0 inet static
pre-up wpa_supplicant -Bw -i wlan0 -c /etc/wpa_supplicant.conf -D wext
post-down killall -q wpa_supplicant
address 192.168.0.134
netmask 255.255.255.0
gateway 192.168.0.1
wireless-essid mySSID
Note I use static addressing, not DHCP.
If you go to SYSTEM-ADMINISTRATION-NETWORKING you can bring up the networking tool to manually disable your ethernet connection and set up wep encryption. I found keeping only the wireless or wired interface active made my system more stable.
Note if you use a different kernel or recompile your kernel differently, you may well need to do this again. It's worth posting the driver package that worked for you and the kernel/system used.
Part 2 – Setting up WPA encryption
Unless you're comfortable with the world and their dog also using your wireless network, you should really put some encryption on it. WEP is trivial to do and trivial to break. Currently WPA/PSK is much more secure.
Luckily, the Edgy version of WPA suplicant is compatable with the ZD1211 chipset. It does this by using the standard wireless extensions (wext) driver interface instead of the Zydas interface.
1) Create /etc/wpa_supplicant.conf, changing the values in italics:
Code:
network={
ssid = “network id”
scan_ssid = 1
pairwise=TKIP
psk=”encryption key”
key_mgmt=WPA-PSK
proto=WPA
}
where network id is your SSID, and encryption key is your router encryption password.
2) Set up your AP to be encrypted, then test the supplicant by typing:
Code:
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -D wext -ddddd
and reading the output on the terminal for any error messages. This took a few attempts with my keyboard becoming very slow as the connection was made. If your connection is dropped repeatedly, you may need a different driver.
3) If you can connect OK, you can terminate the supplicant by typing CTRL+C, and set it in the background by typing into a terminal
Code:
sudo wpa_supplicant -Bw -i wlan0 -c /etc/wpa_supplicant.conf -D zydas
4) To have your wireless network come up automatically with wpasupplicant, edit /etc/network/interfaces to my version above.
5) Then restart your network, type
Code:
sudo /etc/init.d/networking restart
and hopefully wpa should now be working.........
Hope this helps
Bookmarks