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 .

Changes from Version 1 of UserDocs/UsersGuideExamples

Author:
p0g0 (IP: 0.0.0.0)
Timestamp:
03/30/07 13:05:17 (12 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserDocs/UsersGuideExamples

    v v1  
     1= Chapter 2 = 
     2 
     3== Common Configuration Examples using Wireless Extensions == 
     4In 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. 
     5[[PageOutline]] 
     6=== Single AP on a Preselected Channel === 
     7In 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. 
     8{{{ 
     9    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     10    ath0 
     11    myprompt# iwconfig ath0 essid Ätheros Wireless Network" channel 36 
     12    myprompt# brctl addbr br0 
     13    myprompt# brctl addif br0 eth0 
     14    myprompt# brctl addif ath0 
     15    myprompt# brctl setfd br0 1 
     16    myprompt# ifconfig ath0 up 
     17    myprompt# ifconfig eth0 up 
     18    myprompt# ifconfig br0 192.168.0.20 up  
     19}}} 
     20=== Single AP with hostapd on an Automatically Chosen Channel === 
     21In 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. 
     22{{{ 
     23    Example: The configuration file (named /etc/hostapd.conf) is shown below. 
     24 
     25        interface=ath0 bridge=br0 
     26        driver=madwifi 
     27        logger_syslog=0 
     28        logger_syslog_level=0 
     29        logger_stdout=0 
     30        logger_stdout_level=0 
     31        debug=0 
     32        eapol_key_index_workaround=0 
     33        dump_file=/tmp/hostapd.dump.0.0 
     34        ssid=Ätheros Wireless Network" 
     35        wpa=1 
     36        wpa_passphrase=mypassphrase 
     37        wpa_key_mgmt=WPA-PSK 
     38        wpa_pairwise=TKIP CCMP 
     39        wpa_group_rekey=600  
     40}}} 
     41    Now, the following commands will create the AP. 
     42{{{ 
     43        myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     44        ath0 
     45        myprompt# iwconfig ath0 essid Ätheros Wireless Network" 
     46        myprompt# iwpriv ath0 mode 11g 
     47        myprompt# brctl addbr br0 
     48        myprompt# brctl addif br0 eth0 
     49        myprompt# brctl addif ath0 
     50          myprompt# brctl setfd br0 1 
     51        myprompt# ifconfig ath0 up 
     52        myprompt# ifconfig eth0 up 
     53        myprompt# ifconfig br0 192.168.0.20 up 
     54        myprompt# hostapd -dd /etc/hostapd.conf  
     55}}} 
     56=== WPA-PSK Station Using wpa_supplicant === 
     57In 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. 
     58{{{ 
     59    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. 
     60 
     61        network={ 
     62                ssid=Ätheros Wireless Network" 
     63                scan_ssid=1 
     64                key_mgmt=WPA-PSK 
     65                psk="mypassphrase" 
     66        }  
     67}}} 
     68    Now, the following commands will create the station which will scan for the AP with an SSID of Atheros Wireless Network. 
     69{{{ 
     70        myprompt# wlanconfig ath create wlandev wifi0 wlanmode sta 
     71        ath0 
     72        myprompt# iwconfig ath0 essid Ätheros Wireless Network" 
     73        myprompt# ifconfig ath0 192.168.0.100 up 
     74        myprompt# wpa_supplicant -iath0 -c /tmp/my_psk.conf -d  
     75}}} 
     76== Three APs on a Preselected Channel == 
     77In 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. 
     78{{{ 
     79    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     80    ath0 
     81    myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     82    ath1 
     83    myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     84    ath2 
     85    myprompt# iwconfig ath0 essid Ätheros_AP1" channel 36 
     86    myprompt# iwconfig ath1 essid Ätheros_AP2" 
     87    myprompt# iwconfig ath2 essid Ätheros_AP3" 
     88    myprompt# brctl addbr br0 
     89    myprompt# brctl addif br0 eth0 
     90    myprompt# brctl addif ath0 
     91    myprompt# brctl addif ath1 
     92    myprompt# brctl addif ath2 
     93    myprompt# brctl setfd br0 1 
     94    myprompt# ifconfig ath0 up 
     95    myprompt# ifconfig ath1 up 
     96    myprompt# ifconfig ath2 up 
     97    myprompt# ifconfig eth0 up 
     98    myprompt# ifconfig br0 192.168.0.20 up  
     99}}} 
     100== Single Wireless Device AP Repeater == 
     101In 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). 
     102In 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. 
     103{{{ 
     104    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     105    ath0 
     106    myprompt# wlanconfig ath create wlandev wifi0 wlanmode sta nosbeacon 
     107    ath1 
     108    myprompt# iwconfig ath0 essid Ätheros_Base_AP" 
     109    myprompt# iwconfig ath1 essid Ätheros_Base_AP" 
     110    myprompt# iwpriv ath0 wds 1 
     111    myprompt# iwpriv ath1 wds 1 
     112    myprompt# ifconfig ath1 up 
     113    Now, wait for association. 
     114    myprompt# ifconfig ath0 up 
     115    myprompt# ifconfig eth0 up 
     116    myprompt# brctl addbr br0 
     117    myprompt# brctl addif br0 eth0 
     118    myprompt# brctl addif ath0 
     119    myprompt# brctl addif ath1 
     120    myprompt# brctl setfd br0 1 
     121    myprompt# ifconfig br0 up  
     122}}} 
     123== Dual Wireless Device AP Repeater == 
     124In 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. 
     125To 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. 
     126In this example, our AP will also be able to "receive" IP traffic and will have the IP address of 192.168.0.20. 
     127{{{ 
     128    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode sta 
     129    ath0 
     130    myprompt# wlanconfig ath create wlandev wifi1 wlanmode ap 
     131    ath1 
     132    myprompt# iwconfig ath0 essid Ätheros_Base_AP" 
     133    myprompt# iwconfig ath1 essid Ätheros_Repeater_AP" 
     134    myprompt# iwpriv ath0 wds 1 
     135    myprompt# iwpriv ath1 wds 1 
     136    myprompt# ifconfig ath1 up 
     137    myprompt# ifconfig ath0 up 
     138    myprompt# ifconfig eth0 up 
     139    myprompt# brctl addbr br0 
     140    myprompt# brctl addif br0 eth0 
     141    myprompt# brctl addif ath0 
     142    myprompt# brctl addif ath1 
     143    myprompt# brctl setfd br0 1 
     144    myprompt# ifconfig br0 192.168.0.20 up  
     145}}} 
     146== Base AP Which Understands WDS (4 Address) Frames == 
     147In 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. 
     148{{{ 
     149    Example: myprompt# wlanconfig ath create wlandev wifi0 wlanmode ap 
     150    ath0 
     151    myprompt# iwconfig ath0 essid Ätheros_Base_AP" 
     152    myprompt# iwpriv ath0 wds 1 
     153    myprompt# ifconfig ath0 up 
     154    myprompt# ifconfig eth0 up 
     155    myprompt# brctl addbr br0 
     156    myprompt# brctl addif br0 eth0 
     157    myprompt# brctl addif ath0 
     158    myprompt# brctl setfd br0 1 
     159    myprompt# ifconfig br0 192.168.0.20 up  
     160}}}