I'm using a laptop as a wifi access point. Since this laptop has the proper hardware, I was able to use hostapd. I wanted to use DHCP and iptables/NAT forwarding instead of a bridge to have more control over the connection. I made a script to execute all commands.My devices are able to connect to the access point and have full access to the internet for the first few minutes. After this amount of time, no devices are able to connect to the access point anymore. The only way to re-establish a connection is if I reboot the laptop and relaunch the script.Here is my script:#!/bin/bashecho 1 > /proc/sys/net/ipv4/ip_forward# Clear iptables Rulesiptables -Fiptables -t nat -F# iptables Rulesiptables -A FORWARD -d 192.168.1.0/24 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPTiptables -A FORWARD -s 192.168.1.0/24 -i wlan0 -j ACCEPTiptables -t nat -A POSTROUTING -o p4p1 -j MASQUERADE# Set wlan0 IPip addr add 192.168.1.1/24 broadcast 192.168.1.255 dev wlan0ip link set wlan0 up# Set DHCPdnsmasq -C /dev/null >/dev/null 2>&1 --listen-address=192.168.1.1 --dhcp-range=192.168.1.2,192.168.1.200,12h# hostapdhostapd /etc/hostapd/hostapd.confWhere hostapd.conf has the following content:ctrl_interface=/var/run/hostapdctrl_interface_group=wheelmacaddr_acl=0auth_algs=1ignore_broadcast_ssid=0wpa=3wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPrsn_pairwise=CCMPwpa_passphrase=testomestodriver=nl80211interface=wlan0hw_mode=gchannel=1ssid=osumi-0Additional information:Network hardware: Broadcom Corporation BCM4311 802.11a/b/g (rev 01)Network subsystem: Dell Wireless 1490 Dual Band WLAN Mini-CardNetwork driver: b43-pci-bridgeOS: Fedora 17 (up to date)Below is an image of an iPod showing correct IP and router information
Losing wifi connection to access point after a few minutes (hostapd, dnsmasq, iptables)
iptables;wifi;dhcp
The solution to my problem was to install the latest b43 community drivers. I followed the instructions here: http://linuxwireless.org/en/users/Drivers/b43, rebooted the laptop, and have been connected for two hours or so without any disconnections with multiple iOS and Android devices.