Wireless connection using Linux Slackware 10.2

last updated 2 April 2006

The old link

About two years ago, me and a friend decided to link our houses together with a wireless link. We had two very old WaveLAN ISA cards available, so we decided to use them. The cards operate at 2.4GHz (like the modern cards), but they only reach a maximum of 2Mbits/sec). This worked well untill the airspace around us became saturated with more modern WiFi cards and access points which caused the older cards the drop packets -- many packets. It was time to find a better solution for our peer-to-peer connection.

The new link

First, we had to find a PCI WiFi card that would work reliably under Linux and that would play nicely with the Linux Wireless Tools. Since JAWUG used the Linksys Wireless routers with great success in their community project, we looked at the Linksys WiFi cards, but we were very disappointed. The Linksys PCI cards use the highly proprietary Broadcom chipset. Broadcom has refused to provide any public documentation for their chipsets, nor have they provided any public drivers for Linux.

There is a current effort to reverse engineer how the chipset works, but it is very alpha and very unstable. Avoid the Linksys PCI WiFi card at all costs.

We started looking at other cards and chipsets available in the South African market that have good support under Linux. In our seach, we used the Linux Wireless Devices page to find the most suitable drivers and chipsets. We identified the following cards available in South Africa with suitable Linux support:
We decided on the Gigabyte GN-WP01GS card. The cards are relatively cheap (much cheaper than a full Linksys router) at around R220 a peace, excluding VAT. Ralink open-sourced their driver in December 2005 and it is available on their web-site here.

Building it

The physical link consists of two directional 18dBi yagi antennas. Each antenna is connected to the GN-WP01GS card via a length of low-loss co-axial cable. The low-loss cable has a male N-Type connector on each end. The cable terminates into the GN-WP01GS with a pigtail (female N-Type connector on one end and SMA gold-plated connector on the end that goes into the WiFi card).

Our routers are stock standard installations of Slackware 10.2. The only difference is that we used the 2.6.13 kernel that ships with Slackware 10.2. Make sure you download the 2.6.13 kernel source code from a Slackware mirror near you and that the 2.6.13 kernel source is placed in /usr/src/linux-2.6.13.

Install the card in your Linux machine. When you've booted it up, you should be able to see the card using the PCI tools (lspci). It should also be listed in the /proc/pci kernel file:

  Bus  0, device  11, function  0:
    Network controller: PCI device 1814:0301 (RaLink) (rev 0).
      IRQ 10.
      Master Capable.  Latency=32. 
      Non-prefetchable 32 bit memory at 0xe6000000 [0xe6007fff].

Next, download the RT61 chipset driver source code. Put the tar.gz file in /usr/local/src and extract it:

root@fw:/usr/local/src# wget http://www.ralinktech.com/drivers/Linux/2005_1230_RT61_
Linux_STA_Drv1.0.3.0.tar.gz

root@fw:/usr/local/src# tar -zxf 2005_1230_RT61_Linux_STA_Drv1.0.3.0.tar.gz
root@fw:/usr/local/src#

The driver extracts the files into a long directory name which I renamed to RT61 to retain my sanity. Follow the instructions contained in the readme file (in the RT61/Module/ sub-directory) to compile the kernel module.

If you've completed compiling the kernel module for the card, make very sure that you have also copied the configuration file (rt61sta.dat) and the *.bin files into your /etc/Wireless/RT61STA directory. Next, we insert the kernel module and bring up the card's interface. Unlike ethernet cards, whose interface names are called eth0, eth1 and so on, the Ralink driver names the interfaces ra0, ra1 and so on.

Here's a quick script to insert the module, bring up the interface and set the networking parameters for peer-to-peer networking:

#!/bin/bash

# load the module
cd /usr/local/src/RT61/Module
insmod rt61.ko

# bring up the interface
ifconfig ra0 192.168.100.1

# set wireless stuff
iwpriv ra0 set NetworkType=Adhoc
iwpriv ra0 set AuthMode=WPANONE
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set SSID="MYLINK"
iwpriv ra0 set WPAPSK="12345678"
iwpriv ra0 set SSID="MYLINK"

# print some stats
iwpriv ra0 get_site_survey
iwconfig ra0

# add required routes:
# we assume that 192.168.200.0/24 sits on the other side
# and that the other side's IP is 192.168.100.2
route add -net 192.168.200.0/24 gw 192.168.100.2

Note, in the above example, that you have to set the SSID after you've set the encryption type and again after you've set the encryption key. For your own safety, you must use encryption on your link and you must change the key shown above ("12345678") to something else. The key must be at least 8 characters, but shorter than 63 characters.

Please mail any questions/corrections/suggestions to the address shown below.


E-mail comments to