Installing a wireless USB dongle in linux (Zydas zd1211)
How to install a Zydas USB 802.11b/g Dongle on ClarkConnect (Home 3.2) and act as an Access Point. The following is how I managed to install wireless drivers in linux, most of the principles will apply to other distros. (but specifically Clarkconnect which is based on Redhat / Centos)
Install the devel and wireless packages required to build the module
Code:
apt-get update
apt-get install wireless-tools cc-devel kernel-sourcecode#`uname -r` kernel-devel#`uname -r`
(note the ` are back ticks not apostrophes ' )
All kernel packages need to be the same revision so that the correct source and build paths are setup
Download the zd1211 drivers, transfer to /var/tmp
Code:
cd /var/tmp
tar zxvf zd1211-driver-82.tgz
cd /var/tmp/zd1211-driver-r82/
Then install module as per instructions:-
Code:
make
make install
modprobe -v zd1211 #presuming there were no errors in the above compile
lsmod | grep "zd1211" #you should see zd1211 loaded (see dmesg otherwise))
ifconfig wlan0 up #iwconfig will not work otherwise
You should now have wlan0 interface up and running. Type 'iwconfig' to see
The problem I had was that once wlan0 was configured I could not get dnsmasq to play with the wireless interface - it would not assign an IP, even with manual editing of the /etc/dnsmasq/dhcp.conf. Some rumoured fixes include disabling the firewall which sounds like a routing problem so if you wish to try and get it to work with wlan0 then please skip the 'Rename Wlan0' section below substituting eth2 for wlan0 and let me know how you did it!
RENAME WLAN0
To resolve as posted in the forums by rmjb you need to rename wlanX to ethX (or whatever number, i have eth0 = external, eth1 = internal, eth2 = wireless - you can use which ever you wish)
To do this you need to add into /etc/init.d/network
Code:
# ---------Following section added by rmjb-------------
# Optionally remap interface names based on MAC address.
# '/sbin/ifrename' is part of wireless-tools package.
# /etc/iftab is currently not created by default. Jean II
if [ -x /sbin/ifrename ] && [ -r /etc/iftab ]; then
echo -n "Remapping network interfaces name: "
ifrename -p
echo "done."
fi
# --------Preceeding section added by rmjb-------------
After the following:
Code:
# Even if VLAN is configured, without the utility we can't do much
[ ! -x /sbin/vconfig ] && VLAN=
Then create a file /etc/iftab and insert the mac addresses of your interfaces you wish to rename:-
Code:
# Edimax zydas USB dongle
eth2 mac 00:2E:09:74:*
* can be used as wildcards for ease of config for multiple dongles, only add the interfaces you wish to rename and as you can have as many interfaces as you wish using the above format
To test do the following and if successful do a reboot at the end (ifrename will give in an error if there are any problems):-
ifconfig wlan0 down
ifrename
ifconfig eth2 up
shutdown -r now
END RENAME SECTION
Use iwconfig to configure your network e.g.
Code:
iwconfig eth2 essid ccwlan channel 1 key s:<your_key_goes_here> rate 11M mode master
Check that /etc/sysconfig/network-scripts/ifcfg-eth2 exists and contains your network configuration, modify as required. If it doesn't then create one by copying the ifcfg-eth1 file and renaming it.
Set the IP settings in the webconfig and configure the device as eth2, LAN, wireless, Static if needed.
Configure DHCP through the webconfig for your new device eth2,
If all has gone well, your network should be broadcasting and you should be able to enter the same details on your client machines to connect to the network - if you can connect but not obtain an IP then it is a DHCP problem and see below for details. If you can't connect but can see the network it maybe a WEP problem see below.
Troubleshooting
Use 'lsusb' to see if your device is listed on the usb controller. Check the ID's against those on the http://zd1211.ath.cx/ webpage to check it is indeed a zydas chipset
Check that you have the correct versions of the devel and sourcecode packages.
(Check the directories /usr/src/ and /lib/modules/ have the correct version of kernel directories.) Installation of kernel-devel should setup the source and build links in /lib/modules/ to point to the right place.
DNS and Snort and others may complain about wlan0 being an unknown interface but a reboot should cure this, or an unplug replug of your USB dongle. (check dmesg and /var/log/messages for details), remove /etc/sysconfig/network-scripts/ifcfg-wlan0 if it exists.
If you can see the network but can't connect, check your security keys, if you think everything is in order, then disable WEP on the wireless by using and see if you can connect
Code:
iwconfig eth2 key off
the format for key is by default HEX unless you use the prefix s: for ACSII (text) keys.
Key Lengths (WEP)
40bit (64bit) 10 hex digits (5 ASCII)
104bit (128bit) 26 hex digits (13 ASCII)
232bit(256bit) 58 hex digits (29 ASCII)
Note that WEP can be cracked in minutes using sophisticated tools and will only keep the simplest of intruders away. Use WPA for extra security, driver-r58 or new use the following wpa-supplicant
Comments
9 comments postedI would like to add that another newer version of the driver (zd1211rw) has since been included in the kernel as of 2.6.18, however this doesn't include master mode abilities, but works great for connecting up to your access point. This saves the need to compile your own module, and I've found that you can still revert to the old module (zd1211) by editing /etc/modprobe.conf
Read more up here
http://linuxwireless.org/en/users/Drivers/zd1211rw
The description you've presented here is quite clear for me, thanx.
My question is: would these steps be the same for my Ubuntu 8.04? I've already almost cracked my head trying to put it straight with those 802 drivers...
BR,
Mike @ Mobile application development
Ubuntu may come with the new zd1211rw driver which is now the officially supported version, if anything the steps are much simpler because that module is supplied with the kernel now and doesn't need compiling. Which kernel version are you using? run 'uname -a' from a terminal to see. Also try 'locate zd1211rw'. If it exists then you *should* be able to configure using the inbuilt network manager from Ubuntu. You can ignore the rename section too - thats specific to Clarkconnect.
I guess there has been a version update with all the improved features on the kernel part..! Angeline @ Marcus evans scam
Thanks my dad was having trouble with this so now thanks to this article, the issue is resolved and the world can go on (dad was a bit grumpy because he didnt know what to do).
Scott @ Wireless Home Security Alarm System Reviews
The zd1211 driver for the 2.4 kernel (the kernel used by Unslung) is unstable. It suffers from a tendency to lock up not just the NSLU2, but in some cases it will also lock up the access point with which it has associated. Additionally, the driver has a significant unaligned-access problem, which slows it down when it isn't locked up.These may be some disadvantage of using zd1211
Really nice post i like that you are sharing such a nice stuff...
Thanks for the tutorial, it was very helpful.
Regards,
Allie @ Mobile Application Development
Excellent post. I certainly learned a lot.
Post new comment