Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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/bash
echo 1 > /proc/sys/net/ipv4/ip_forward

# Clear iptables Rules
iptables -F
iptables -t nat -F

# iptables Rules
iptables -A FORWARD -d 192.168.1.0/24 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/24 -i wlan0 -j ACCEPT
iptables -t nat -A POSTROUTING -o p4p1 -j MASQUERADE

# Set wlan0 IP
ip addr add 192.168.1.1/24 broadcast 192.168.1.255 dev wlan0
ip link set wlan0 up

# Set DHCP
dnsmasq -C /dev/null >/dev/null 2>&1 --listen-address=192.168.1.1 --dhcp-range=192.168.1.2,192.168.1.200,12h

# hostapd
hostapd /etc/hostapd/hostapd.conf

Where hostapd.conf has the following content:

ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
wpa_passphrase=testomesto
driver=nl80211
interface=wlan0
hw_mode=g
channel=1
ssid=osumi-0

Additional information:

  • Network hardware: Broadcom Corporation BCM4311 802.11a/b/g (rev 01)
  • Network subsystem: Dell Wireless 1490 Dual Band WLAN Mini-Card
  • Network driver: b43-pci-bridge
  • OS: Fedora 17 (up to date)

Below is an image of an iPod showing correct IP and router information enter image description here

share|improve this question
1  
The output of dmesg is most of the time helpful. –  scai Aug 1 '12 at 15:36

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.