Access Point with hostapd

Share your own howto's etc. Not for support questions!

Access Point with hostapd

Postby paracetamolo » 2010-02-03 09:17

With Debian, most of wireless cards and hostapd it is possible to set up a wireless access point.

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


Sample /etc/network/interfaces to bridge wireless to ethernet:
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


Restart the services:
Code: Select all
sudo /etc/init.d/networking restart
sudo /etc/init.d/hostapd restart


Check from another machine if it is working:
Code: Select all
sudo iw dev wlan0 scan | grep SSID


Troubleshooting:
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
paracetamolo
 
Posts: 5
Joined: 2009-04-29 19:54

Re: Access Point with hostapd

Postby .sw » 2010-02-03 16:04

Can you confirm if this works with an Intel PRO/Wireless 3945ABG adapter ?
Code: Select all
mac80211 - iwl3945

In here it says there is no support for AP or monitor mode.

I'd really love to turn this machine into an AP.

Thanks.
.sw
 
Posts: 1
Joined: 2010-02-03 15:54


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable