HOWTO - Set up MadWiFi

From WikiDoc

Jump to: navigation, search

Overview

MadWiFi is a kernel mode driver for wireless networking cards using the Atheros chipsets. Before you use it, you have to be sure you're running an Atheros chipset. An easy way to test this is to run the command

# lspci |grep Atheros

and you should see output somewhat like this:

01:09.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

If you don't see any output at all before you're back at the prompt, you probably aren't compatible with MadWiFi. If you think you should be using MadWiFi, check the compatibility list in the MadWiFi Wiki [1] to see if your card is listed.

Building

Before you can use the MadWiFi driver, you have to build it. Luckily the default KateOS installation includes everything you need to do that. If you installed only a minimal system, you'll need to make sure you have the kernel-headers, gcc, and uucp. Grab the MadWiFi source tarball from the MadWiFi site [2] and save it somewhere (say, ~/downloads). Then open up a terminal and type:

$ cd ~/downloads 	 # Or wherever you saved your file
$ tar xvzf madwifi-x.y.z.tar.gz 	 # Replace x.y.z with your version number
$ cd madwifi-x.y.z
$ make

Now, if you have everything MadWiFi needs to build, it should compile with no problems.

Installing

After the driver has compiled, you can install it:

$ su 	 # enter your root password
# make install

After that, if you have udev set up to load at boot time, the modules will be loaded at boot time. To load the modules without rebooting, become root and probe ath_pci:

$ su - 	 # enter the root password again
# modprobe ath_pci

In order to have it set up your interface on boot, edit your /etc/rc.d/rc.local file as root and add these lines:

ifconfig ath0 up > /dev/null
dhcpcd -t 10 -n ath0

Or you can spice it up so the steps blend in with the rest of the boot. Here's my rc.local file:

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local setup commands in here:

. /etc/rc.d/functions.sh

msg="`gettext inits_local "Bringing up interface ath0"`"
status ifconfig ath0 up

# You can add iwconfig stuff here, if you want to connect to a specific AP maybe using a key:
# msg="`gettext inits_local "Configuring ath0"`"
# status iwconfig ath0 essid "myessid" key "s:mykey"

msg="`gettext inits_local "Getting IP info for ath0"`"
status dhcpcd -t 10 -n ath0

Then you can run /etc/rc.d/rc.local as root to bring it up without rebooting (it'll load automatically at startup from now on):

$ su - 	 # enter root password
# /etc/rc.d/rc.local

* Bringing up interface ath0. . . . . . . . . . . . . . . . . . . . . . .[ OK ]
* Getting IP info for ath0. . . . . . . . . . . . . . . . . . . . . . . .[ OK ]

And by now you should have internet access, and you should have it after every boot, too (unless there aren't any access points around).

Personal tools