Try to relocate nmcli nm wifi off before both rfkill
12:15:12 ~$ sudo /usr/local/sbin/nzone status
nzone is not running
12:15:29 ~$ sudo /usr/local/sbin/nzone start BASE256
starting nzone
net.ipv4.ip_forward = 1
Configuration file: /etc/wlan0_hostap.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
12:15:41 ~$ sudo /usr/local/sbin/nzone stop
stopping nzone
network-manager stop/waiting
network-manager start/running, process 3573
Configuration file: /etc/wlan0_hostap.conf
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid "NZ@McD1"
Failed to set beacon parameters
wlan0: Unable to setup interface.
wlan0: Could not connect to kernel driver
12:15:55 ~$ sudo /usr/local/sbin/nzone start BASE256
starting nzone
net.ipv4.ip_forward = 1
SIOCSIFFLAGS: Operación imposible por estar la radiofrecuencia desactivada
SIOCSIFFLAGS: Operación imposible por estar la radiofrecuencia desactivada
Configuration file: /etc/wlan0_hostap.conf
rfkill: WLAN hard blocked
rfkill: WLAN soft blocked
Could not set interface wlan0 flags (UP): Operation not possible due to RF-kill
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid "NZ@McD1"
Failed to set beacon parameters
wlan0: Unable to setup interface.
wlan0: Could not connect to kernel driver
ELOOP: remaining timeout: -1.936196 eloop_data=0xd15d80 user_data=0xd150e0 handler=0x4450d0
My script IS the simple shell file, the problem is how Ubuntu 14 and network manager works with wireless driver and how hostapd is affected with that.Looks like it has the same or similar errors. I've restarted the machine because the wlan0 wasn't working correctly after the changes. I've started nzone, some errors shown, stoped it, started it again, and more errors than before. Here's the output:
I don't know man, maybe I should write a simple .sh which reads a mac file, uses "macchanger -m $MAC wlan0" and does the iptables and hostapd stuff...
My script IS the simple shell file, the problem is how Ubuntu 14 and network manager works with wireless driver and how hostapd is affected with that.
There is no problem with changing MAC, just try
ifconfig wlan0
ifconfig wlan0 down hw ether 00:11:22:33:44:55 up
ifconfig wlan0
That will be great because I'm actually have no time to check and fix it by myself for Ubuntu 14I know, I know, I'll have a look at hostapd so maybe I can find a way to fix this...
That will be great because I'm actually have no time to check and fix it by myself for Ubuntu 14
sudo apt-get remove hostapd
cd ~/tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd #so we will not update the package with apt-get upgrade
13:45:06 ~/homepass$ sudo ./nzone.sh install BASE16
update-rc.d: warning: /etc/init.d/nzone missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
Use of uninitialized value $argv[1] in pattern match (m//) at /usr/sbin/update-rc.d line 299.
update-rc.d: error: expected NN after start
usage: update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
-n: not really
-f: force
The disable|enable API is not stable and might change in the future.
starting nzone
net.ipv4.ip_forward = 1
Configuration file: /etc/wlan0_hostap.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid 'NZ@McD1'
13:54:13 ~/homepass$ sudo /usr/local/sbin/nzone stop
stopping nzone
network-manager stop/waiting
network-manager start/running, process 4550
Configuration file: /etc/wlan0_hostap.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid 'NZ@McD1'
13:54:30 ~/homepass$ sudo /usr/local/sbin/nzone start BASE16
starting nzone
net.ipv4.ip_forward = 1
Configuration file: /etc/wlan0_hostap.conf
Failed to update rate sets in kernel module
Using interface wlan0 with hwaddr c4:85:08:1c:cf:6e and ssid 'NZ@McD1'
Ok after a quick search on Ubuntu the idea is to downgrade hostapd to version 1.0-3ubuntu2.1 which wasn't buggier:
The install shows several errors:
After that, I've stopped it:
And started it again:
There are some fails as you can see. It works during some seconds... I've managed to make it a few longer commenting the crontab line just after start nzone but even with all these things it still doesn't work. I've also added mac filtering on hostapd config in order to allow only my 3DS, that works. Searching for this I've found ap-hotspot, an app that creates a hotspot correctly, maybe joining that app with the mac change could work...
"Failed to update rate sets in kernel module"
This is not actually a problem, dicamarques had the same errors on Debian but streetpass worked fine. But the unchanged MAC is not good. Have you tried ifconfig wlan0 down hw ether .... up?
ifconfig wlan0 down hw ether $MAC up
ap-hotspot start
ifconfig mon.wlan0 down hw ether $MAC up #just in case
wait several minutes and start again
It's working so I can automate it with no problems.# WiFi Hotspot
interface=wlan0
driver=nl80211
#Access Point
ssid=NZ@McD1
hw_mode=g
# WiFi Channel:
channel=1
macaddr_acl=1
accept_mac_file=/etc/hostapd/accept
auth_algs=1
If ap-hotspot is obtainable with apt-get, then this is not a big deal adopt the script for it just for Ubuntu 14Yep... I did. Don't worry, I'm trying a workaround with ap-hotspot, something like...
And for the ap-hotspot configuration, in /etc/ap-hotspot.conf I've changed it a few so I can filter macs and remove wpa
It's working so I can automate it with no problems.
So an important thing to make yours work in U14.04 (if you manage to get some time) is to downgrade hostapd![]()
#!/bin/bash
macs=(
"4e:53:50:4f:4f:40" "4e:53:50:4f:4f:41" "4e:53:50:4f:4f:42" "4e:53:50:4f:4f:43"
"4e:53:50:4f:4f:44" "4e:53:50:4f:4f:45" "4e:53:50:4f:4f:46" "4e:53:50:4f:4f:47"
"4e:53:50:4f:4f:48" "4e:53:50:4f:4f:49" "4e:53:50:4f:4f:4A" "4e:53:50:4f:4f:4B"
"4e:53:50:4f:4f:4C" "4e:53:50:4f:4f:4D" "4e:53:50:4f:4f:4E" "4e:53:50:4f:4f:4F"
)
for i in "${macs[@]}"
do
echo "Using $i MAC address for the hotspot"
sudo ap-hotspot stop
sleep 10
sudo ifconfig wlan0 down hw ether "$i" up
sleep 5
sudo ap-hotspot start
#sleep 10
#sudo ifconfig mon.wlan0 down hw ether "$i" up
echo "Waiting 10 minutes..."
sleep 600
done
sudo apt-get remove hostapd
cd ~/tmp
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd #so we will not update the package with apt-get upgrade
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot
# WiFi Hotspot
interface=wlan0
driver=nl80211
#Access Point
ssid=NZ@McD1
hw_mode=g
# WiFi Channel:
channel=1
macaddr_acl=1
accept_mac_file=/etc/hostapd/accept
auth_algs=1
Using sleep is not a good options, is there a pid file option for ap-hotspot? Also what is the minimum set of configuration file pareters, two macfilter may be omittet for sure at least. It is for easy setup.A first and dirty approach having the ap-hotspot installed and already well configured like this works:
Code:#!/bin/bash macs=( "4e:53:50:4f:4f:40" "4e:53:50:4f:4f:41" "4e:53:50:4f:4f:42" "4e:53:50:4f:4f:43" "4e:53:50:4f:4f:44" "4e:53:50:4f:4f:45" "4e:53:50:4f:4f:46" "4e:53:50:4f:4f:47" "4e:53:50:4f:4f:48" "4e:53:50:4f:4f:49" "4e:53:50:4f:4f:4A" "4e:53:50:4f:4f:4B" "4e:53:50:4f:4f:4C" "4e:53:50:4f:4f:4D" "4e:53:50:4f:4f:4E" "4e:53:50:4f:4f:4F" ) for i in "${macs[@]}" do echo "Using $i MAC address for the hotspot" sudo ap-hotspot stop sleep 10 sudo ifconfig wlan0 down hw ether "$i" up sleep 5 sudo ap-hotspot start #sleep 10 #sudo ifconfig mon.wlan0 down hw ether "$i" up echo "Waiting 10 minutes..." sleep 600 done
So adding to this the generation of your mac lists and read the file, adding in the install script the hostapd fix
and the ap-hotspot install:
and lastly echoing a file in /etc/ap-hotspot.conf with the content:
would do the trick![]()
Using sleep is not a good options, is there a pid file option for ap-hotspot? Also what is the minimum set of configuration file pareters, two macfilter may be omittet for sure at least. It is for easy setup.
interface=wlan0
driver=nl80211
ssid=NZ@McD1
hw_mode=g
channel=1
auth_algs=1
serginator
Can you check if it work with no hw_mode parameter? The rest looks like the default hostapd.conf file
Yep, it works too commenting that hw_mode=g line.