Linux - 16 - Wireless networking
This page descibes how i got my wireless kit working under linux. Please look at the linux wireless FAQ for a more generic guide.
Hardware
i chose DABs value adapters, one PCI, one PCMCIA. The PCI card was 17 pounds and the PCMCIA was around 15 pounds. Both have identical realtek 8180 chipsets.
Output of /sbin/lspci 04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.: Unknown device 8180 (rev 20)
Drivers
A quick note about WEP key length
WEP keys come in several flavours, 64bit, 128bit, 256bit etc. However these key lengths are the internal key length used by WEP. Keys you supply to the hardware are slightly shorter. For 64bit WEP you only configure the network card/access point with 40 bits, with 128bit, only 104 bits.
Generating keys
To generate a random hex string just pipe /dev/random (virtual file containing pseudo random bytes) through dd (copy utility) into hexdump (converts bytes to ascii hex).
cat /dev/random | dd bs=1 count=100 | hexdump
WinXP drivers + ndiswrapper
An amazing idea, use windows XP drivers which are more up to date (by popular demand) under linux. It's called NdisWrapper and supports a variety of devices. Simply download, compile, install, download XP driver, tell NdisWrapper where XP driver is. The biggest advantage is that the latest wireless toolkit can be used, and works properly too unlike the native driver.
This is the setup script i use
#!/bin/bash
echo "Starting Realtek 8180 (ndiswrapper)"
# settings
/sbin/iwconfig wlan0 mode Managed
/sbin/iwconfig wlan0 channel 1
/sbin/iwconfig wlan0 essid Studyrouter
/sbin/iwconfig wlan0 key restricted
/sbin/iwconfig wlan0 key my_wep_key_removed_for_privacy_reasons
/sbin/iwconfig wlan0 ap any
# Configure wlan0 IP address with DHCP
# renew lease, name host
/sbin/dhcpcd -n -h ${HOSTNAME} wlan0
Realtek linux driver 1.3/1.5
These are binary drivers built against 2.4.20 kernels - therefore you'll only be able to run them on 2.4.20 similar kernels. They do not support the latest wireless extension features unlike their XP counterparts. I strongly recommend the use of kernel version independent ndiswrapper as above.
i did have the 1.3 driver working at one point but had no success with the 1.5 version. Hopefully new drivers for later kernels will become available via the realtek website soon.