Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Access Point with hostapd

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
paracetamolo
Posts: 5
Joined: 2009-04-29 19:54

Access Point with hostapd

#1 Post by paracetamolo »

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

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

Re: Access Point with hostapd

#2 Post by .sw »

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.

Post Reply