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 .

Chapter 2

Common Configuration Examples using Wireless Extensions

In this section, we present common configurations for both AP and stations supported by the MadWifi driver. We assume the driver and all necessary modules have already been loaded. The underlying wireless device is assumed to be wifi0 unless otherwise noted. The ethernet device is assumed to be eth0.

Single AP on a Preselected Channel

In this section, we give an example on how to configure a single MadWifi AP in 802.11a on channel 36 with ESSID Ätheros Wireless Network". The desired IP address for the AP is 192.168.0.20.

    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
    ath0
    myprompt# iwconfig ath0 essid Ätheros Wireless Network" channel 36
    myprompt# brctl addbr br0
    myprompt# brctl addif br0 eth0
    myprompt# brctl addif ath0
    myprompt# brctl setfd br0 1
    myprompt# ifconfig ath0 up
    myprompt# ifconfig eth0 up
    myprompt# ifconfig br0 192.168.0.20 up 

Single AP with hostapd on an Automatically Chosen Channel

In this example, we configure a single MadWifi AP in 802.11g using the auto channel select. The AP will use WPA-PSK via hostapd. The user space program hostapd requires a configuration file. The AP will have an IP address of 192.168.0.20.

    Example: The configuration file (named /etc/hostapd.conf) is shown below.

        interface=ath0 bridge=br0
        driver=madwifi
        logger_syslog=0
        logger_syslog_level=0
        logger_stdout=0
        logger_stdout_level=0
        debug=0
        eapol_key_index_workaround=0
        dump_file=/tmp/hostapd.dump.0.0
        ssid=Ätheros Wireless Network"
        wpa=1
        wpa_passphrase=mypassphrase
        wpa_key_mgmt=WPA-PSK
        wpa_pairwise=TKIP CCMP
        wpa_group_rekey=600 

Now, the following commands will create the AP.

        myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
        ath0
        myprompt# iwconfig ath0 essid Ätheros Wireless Network"
        myprompt# iwpriv ath0 mode 11g
        myprompt# brctl addbr br0
        myprompt# brctl addif br0 eth0
        myprompt# brctl addif ath0
          myprompt# brctl setfd br0 1
        myprompt# ifconfig ath0 up
        myprompt# ifconfig eth0 up
        myprompt# ifconfig br0 192.168.0.20 up
        myprompt# hostapd -dd /etc/hostapd.conf 

WPA-PSK Station Using wpa_supplicant

In this example, we will configure the driver to be a station attempting to associate with the WPA-PSK AP in the example above. The station will have an IP address of 192.168.0.100.

    Example: The user space program wpa_supplicant requires a configuration file. The file used in this example is shown below and named /tmp/my_psk.conf.

        network={
                ssid=Ätheros Wireless Network"
                scan_ssid=1
                key_mgmt=WPA-PSK
                psk="mypassphrase"
        } 

Now, the following commands will create the station which will scan for the AP with an SSID of Atheros Wireless Network.

        myprompt# wlanconfig ath create wlandev wifi0 wlanmode sta
        ath0
        myprompt# iwconfig ath0 essid Ätheros Wireless Network"
        myprompt# ifconfig ath0 192.168.0.100 up
        myprompt# wpa_supplicant -iath0 -c /tmp/my_psk.conf -d 

Three APs on a Preselected Channel

In this section, we give an example on how to configure a three MadWifi APs in 802.11a on channel 36 with ESSIDs Ätheros_AP1", Ätheros_AP2", and Ätheros_AP3". All three APs are bridged together. The desired IP address for the AP is 192.168.0.20.

    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
    ath0
    myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
    ath1
    myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
    ath2
    myprompt# iwconfig ath0 essid Ätheros_AP1" channel 36
    myprompt# iwconfig ath1 essid Ätheros_AP2"
    myprompt# iwconfig ath2 essid Ätheros_AP3"
    myprompt# brctl addbr br0
    myprompt# brctl addif br0 eth0
    myprompt# brctl addif ath0
    myprompt# brctl addif ath1
    myprompt# brctl addif ath2
    myprompt# brctl setfd br0 1
    myprompt# ifconfig ath0 up
    myprompt# ifconfig ath1 up
    myprompt# ifconfig ath2 up
    myprompt# ifconfig eth0 up
    myprompt# ifconfig br0 192.168.0.20 up 

Single Wireless Device AP Repeater

In this section, we give an example on how to configure MadWifi as a repeater operating with a single wireless device (e.g., wifi0). We assume there is an existing AP with an SSID of Atheros_Base_AP. We wish to "repeat" this AP using our device. To do this, we will create two VAPs. The first VAP will be an AP VAP which will serve all the clients in our range. The second VAP will be a station VAP used to association with the existing AP named Atheros_Base_AP. In order to have both a station and AP VAP coexist on one base device (e.g., wifi0), the AP VAP must be created first followed by the station VAP with the nosbeacon option selected for the station VAP. However, the station VAP must be brought up first and allowed to associate since it will choose the channel of the existing AP (Atheros_Base_AP). In this example, our AP will not be able to "receive" IP traffic because no IP address will be assigned to the bridge device. However, by assigning an IP address, the AP can also receive traffic (using 3 address frames). To support the 4 address frame format needed for repeating, the wds option must be enabled. It is assumed the existing AP understands how to handle 4 address frames.

    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
    ath0
    myprompt# wlanconfig ath create wlandev wifi0 wlanmode sta nosbeacon
    ath1
    myprompt# iwconfig ath0 essid Ätheros_Base_AP"
    myprompt# iwconfig ath1 essid Ätheros_Base_AP"
    myprompt# iwpriv ath0 wds 1
    myprompt# iwpriv ath1 wds 1
    myprompt# ifconfig ath1 up
    Now, wait for association.
    myprompt# ifconfig ath0 up
    myprompt# ifconfig eth0 up
    myprompt# brctl addbr br0
    myprompt# brctl addif br0 eth0
    myprompt# brctl addif ath0
    myprompt# brctl addif ath1
    myprompt# brctl setfd br0 1
    myprompt# ifconfig br0 up 

Dual Wireless Device AP Repeater

In this section, we give an example on how to configure MadWifi as a "repeater" operating with dual wireless devices (e.g., wifi0 and wifi1). We assume there is an existing AP with an SSID of Atheros_Base_AP in the 802.11a band. We wish to "repeat" this AP using our device but will use a different SSID (Atheros_Repeater_AP) for distribution in our coverage area. Furthermore, the local distribution will be in the 802.11g band, not the 802.11a band. Thus, we are assuming that wireless device wifi0 is capable of operating in the 802.11a band, and wifi1 is capable of operating in the 802.11b band. To do this, we will create two VAPs. The VAP associated with wifi0 will be a station VAP and the VAP associated with wifi1 will be the AP VAP. Note, the order of creation does not matter now since the VAPs are on different wireless devices. The AP VAP must serve all the clients in our range and forward their traffic to the base AP via 4 address format. In this example, our AP will also be able to "receive" IP traffic and will have the IP address of 192.168.0.20.

    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode sta
    ath0
    myprompt# wlanconfig ath create wlandev wifi1 wlanmode ap
    ath1
    myprompt# iwconfig ath0 essid Ätheros_Base_AP"
    myprompt# iwconfig ath1 essid Ätheros_Repeater_AP"
    myprompt# iwpriv ath0 wds 1
    myprompt# iwpriv ath1 wds 1
    myprompt# ifconfig ath1 up
    myprompt# ifconfig ath0 up
    myprompt# ifconfig eth0 up
    myprompt# brctl addbr br0
    myprompt# brctl addif br0 eth0
    myprompt# brctl addif ath0
    myprompt# brctl addif ath1
    myprompt# brctl setfd br0 1
    myprompt# ifconfig br0 192.168.0.20 up 

Base AP Which Understands WDS (4 Address) Frames

In this section, we give an example of how to configure MadWifi to be a base AP which handles 4 address 802.11 frames. The AP will use Auto channel selection in the 802.11a band and will have an ssid of Atheros_Base_AP. The AP will have an IP address of 192.168.0.20. The underlying wireless device is assumed to be wifi0.

    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap
    ath0
    myprompt# iwconfig ath0 essid Ätheros_Base_AP"
    myprompt# iwpriv ath0 wds 1
    myprompt# ifconfig ath0 up
    myprompt# ifconfig eth0 up
    myprompt# brctl addbr br0
    myprompt# brctl addif br0 eth0
    myprompt# brctl addif ath0
    myprompt# brctl setfd br0 1
    myprompt# ifconfig br0 192.168.0.20 up