Use a recent kernel >= 2.6.30 or an older one with backported wireless stack (compat-wireless).
Use hostap >= 0.6.9
Every mac80211 driver should support hostapd through the user space driver nl80211 so we'll talk about these because they are the way to go in the future but older drivers are also supported (hostap, prism54, madwifi).
Install and configure:
Code: Select all
sudo aptitude install hostapd
Edit /etc/init.d/hostapd/hostapd.conf to configure your ap, this is an example with bridge:
Code: Select all
interface=wlan0
bridge=br0
driver=nl80211
ssid=my-wifi
channel=1
hw_mode=g
# 1=open auth, 2=shared key, 3=both
auth_algs=3
# Static WEP key configuration
wep_default_key=0
wep_key0=mykey
# # Static WPA2 key configuration
# #1=wpa1, 2=wpa2, 3=both
# wpa=3
# wpa_passphrase=mykey
# wpa_key_mgmt=WPA-PSK
# wpa_pairwise=TKIP
# #this can create problem with Windows clients, just leave it commented
# rsn_pairwise=CCMP
#MAC address filtering
macaddr_acl=0
#enables/disables broadcasting the ssid
ignore_broadcast_ssid=0
# Needed for Windows clients
eapol_key_index_workaround=0
# Create a socket to control hostapd through hostapd_cli
ctrl_interface=/var/run/hostapd
# Only root can configure hostapd
ctrl_interface_group=0
Code: Select all
auto lo
iface lo inet loopback
auto eth0
auto wlan0
auto br0
iface br0 inet static
address 192.168.1.2
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
bridge_ports eth0 wlan0
Code: Select all
sudo /etc/init.d/networking restart
sudo /etc/init.d/hostapd restart
Code: Select all
sudo iw dev wlan0 scan | grep SSID
I obtained several time messages claiming that the interface couldn't be configured or put in master/ap mode but it was just a matter of finding the right configuration file, so don't give up too early or try to compile bleeding edge drivers until you are really shure.
References:
http://linuxwireless.org/en/users/Documentation/hostapd
Complete hostap.conf
Supported drivers