Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have configured a wifi hotspot using this tutorial: How to setup a wi-fi hotspot (access point mode)? It worked but then I wrote a script to automate things and while I tested it Network Manager crashed and then the hotspot didn't work anymore. I purged the programs, reinstalled them and disabled Network Manager but it still does not work. Other laptops can see and connect but they have limited connection. Here is what I am getting:

Configuration file: hostapd-minimal.conf
Using interface wlan0 with hwaddr 6c:62:6d:1f:9f:35 and ssid "abc"
wlan0: STA f0:a2:25:76:1e:01 IEEE 802.11: authenticated
wlan0: STA f0:a2:25:76:1e:01 IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED f0:a2:25:76:1e:01
wlan0: STA f0:a2:25:76:1e:01 RADIUS: starting accounting session 5122AE3B-00000000
wlan0: STA f0:a2:25:76:1e:01 WPA: pairwise key handshake completed (RSN)
wlan0: AP-STA-DISCONNECTED f0:a2:25:76:1e:01
wlan0: STA f0:a2:25:76:1e:01 IEEE 802.11: disassociated
Could not set station f0:a2:25:76:1e:01 flags for kernel driver (errno=11).

This is the automated script:

#!/bin/bash    
# start wireless AP

SSID=$1
echo $SSID

#set SSID
sed -i "/ssid/d" hostapd-minimal.conf
echo ssid=${SSID} >> hostapd-minimal.conf

#set ehto interface
sed -i 's/# auto eth0/auto eth0/' /etc/network/interfaces 
sed -i 's/# iface eth0 inet dhcp/iface eth0 inet dhcp/' /etc/network/interfaces 

#set wlan0 interface
sed -i 's/# auto wlan0/auto wlan0/' /etc/network/interfaces 
sed -i 's/# iface wlan0 inet static/iface wlan0 inet static/' /etc/network/interfaces 
sed -i 's/# address 10.10.0.1/address 10.10.0.1/' /etc/network/interfaces  
sed -i 's/# netmask 255.255.255.0/netmask 255.255.255.0/' /etc/network/interfaces

echo Stoping network-manager...
service network-manager stop

echo Reseting interfaces...
ifdown eth0
ifup eth0

#ifconfig mon.wlan0 down
echo Starting isc-dhcp-server...
start isc-dhcp-server

#ip forwarding
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.0.0/16 -o eth0 -j MASQUERADE

echo Starting AP...
gnome-terminal -x bash -c "./hostapd/hostapd/hostapd hostapd-minimal.conf;bash" &

sleep 1
echo AP Wireless complete

If anyone has any suggestions they would be greatly appreciated.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.