Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Configuring the MadWifi device

Automated VAP creation

MadWifi support multiple VAPs. If you are using MadWifi-old, then this section is not useful, as it deals with the handling of the special abilities of MadWifi-NG within the Debian networking scripts.

Any snapshot more recent than r1407 will create a sta mode VAP for each atheros device by default. If a madwifi-ng-base package is currently installed, please remove it and upgrade your madwifi packages.

To disable the autocreation behaviour:

# echo "options ath_pci autocreate=none" > /etc/modprobe.d/madwifi

Or you may specify a mode in [sta|ap|wds|adhoc|ahdemo|monitor]:

# echo "options ath_pci autocreate=ap" > /etc/modprobe.d/madwifi

Matt Brown has written some more advanced scripts to nicely integrate the madwifi-ng setup with the Debian ifupdown framework. They use the wireless-tools extensions to determine the mode to create the interface in. These are most useful for creating multiple VAPs, especially in ap mode. It may be useful to disable the autocreation of the sta VAP when using these. They are included in the madwifi-tools package and are also available separately from:

Then to create a MadWifi interface simply create a stanza like

iface ath0 inet static
        madwifi-base wifi0
        wireless-mode master
        # in the debian package, you may use 'madwifi-mode' [ap|adhoc|ahdemo|monitor|sta|wds]
        # instead of the spurious wireless-mode, which is technically misleading

and ifup/ifdown will take care of creating and destroying VAPs as necessary. Wireless configuration for the VAP can be configured as per normal with the wireless tools directives.

Alternatively, you can automate all the creation of the device from your /etc/network/interfaces file, simply by using the pre-up/post-down routines. ie:

iface ath0 inet static
        pre-up wlanconfig ath0 create wlandev wifi0 wlanmode ap
        post-down wlanconfig ath0 destroy
        wireless-essid my-essid

Thus avoiding the requirement of third-party scripting to handle the devices.


The /etc/network/interfaces file is the standard Debian method of controlling network interfaces. This file is well documented in the Debian distribution, both internally and by external sources. These include:

The following paragraphs will consist of a handful of example interfaces entries for using MadWifi devices. For each possible command parameter of iwconfig you can include an option in /etc/network/interfaces named like that parameter with a "wireless-" prefix. Wireless devices are more complex to setup correctly, because of the nature of their usage, and the broad range of features available to them. For example, some of them are removeable and some support multiple VAPs (madwifi-ng). Therefore, some special handling is required to exploit as much as possible out of these features.

Client to an access point (essid of "") with WEP security, using wireless-tools and obtaining an IP via DHCP:

auto ath0
iface ath0 inet dhcp
	wireless-key 46f04863257ac8040905ea0002

If your access point is configured to use WEP in restricted mode you will need to add:

        pre-up iwpriv ath0 authmode 2

Debian users who have wpasupplicant >=0.4.8-1 installed can take advantage of ifupdown integration via the following examples:

Client to an WPA/WPA2 encrypted access point via wpa_supplicant and obtaining an IP via DHCP:

auto ath0
iface ath0 inet dhcp
	# For linux >= 2.6.14 and recent madwifi (>=r1500) use 'wext', otherwise use 'madwifi'
	wpa-driver wext
	wpa-ssid MyNet
	wpa-psk 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f

A CardBus card is hot-pluggable, and not always present. This is when the allow-hotplug class of net.agent (hotplug/udev) becomes useful:

allow-hotplug ath0
iface ath0 inet dhcp
	wpa-driver wext
	wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

So when the CardBus card generates a hotplug event, the networking scripts are hooked and bring it up. This can be useful even if you're wireless device is permanently installed, for instance, if you have a laptop and want to be remove and reload the kernel modules, e.g., during sleep states.

Advanced Mobile Users Configuration

Debian Etch includes wireless roaming using a wpa_supplicant and feature called wpa-roam. In this case, the stanza in /etc/network/interfaces might look like:

iface ath0 inet manual
        wpa-driver wext
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Notice we're disabling the ifup-initiated DHCP client, since wpa_supplicant takes care of bringing up and down the DHCP client as the network becomes available or unavailable respectively.

In the file /etc/wpa_supplicant/wpa_supplicant.conf, add "network" stanzas corresponding to all the networks you use. For instance:


        psk="sssh it is a secret"


For more details, see wpa_action(8) and the files in /usr/share/doc/wpasupplicant, especially README.modes.gz.