Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
11
votes
1
answers
7193
views
"nl80211: 'nl80211' generic netlink not found" when starting hostapd
I have been trying to get my Ubuntu 11.10 laptop to make an access point to connect my blackberry playbook . hostapd gave error Configuration file: ./hostapd-minimal.conf nl80211: 'nl80211' generic netlink not found nl80211 driver initialization failed. Is this a BCM4312 problem? Can madwifi , hosta...
I have been trying to get my Ubuntu 11.10 laptop to make an access point to connect my blackberry playbook . hostapd gave error
Configuration file: ./hostapd-minimal.conf
nl80211: 'nl80211' generic netlink not found
nl80211 driver initialization failed.
Is this a BCM4312 problem? Can madwifi , hostap create wifi acccess point for me?
Connectify can do this on windows so is there no equivalent??
Giridaran Manivannan
(121 rep)
Apr 2, 2012, 11:38 AM
• Last activity: Jul 14, 2025, 05:08 PM
0
votes
0
answers
22
views
How to configure FreeBSD as WPA Enterpise access point?
I have a FreeBSD machine with an Atheros WiFi card and I want to use it as WPA Enterprise access point. I set up a RADIUS server on the FreeBSD machine and configure interface wlan0 and hostapd.conf, but I have no luck. My phone informs me that the MyWiFi network is password protected and refuses to...
I have a FreeBSD machine with an Atheros WiFi card and I want to use it as WPA Enterprise access point.
I set up a RADIUS server on the FreeBSD machine and configure interface wlan0 and hostapd.conf, but I have no luck. My phone informs me that the MyWiFi network is password protected and refuses to accept my certificate.
But I successfully use an access point (a white box with antennas and blue LEDs) as a WPA Enterprise access point from my phone. So I suppose I set up the RADIUS server correctly.
wlan0: flags=8843 metric 0 mtu 1500
options=0
ether 00:1a:cc:44:33:aa
inet 192.168.12.1 netmask 0xffffff00 broadcast 192.168.12.255
groups: wlan
ssid "MyFiWi" channel 1 (2412 MHz 11g) bssid 00:1a:cc:44:33:aa
regdomain NONE country DE ecm authmode 802.1x privacy MIXED
deftxkey UNDEF txpower 30 scanvalid 60 protmode CTS wme burst
dtimperiod 1 -dfs
parent interface: ath0
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status: running
nd6 options=29
My /etc/hostapd.conf:
# GLOBAL PARAMETERS
interface=wlan0
debug=0
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=MyFiWi
# WPA/IEEE 802.11i PARAMETERS
wpa=WPA-RADIUS
wpa_key_mgmt=WPA-EAP
ieee8021x=1
# RADIUS CLIENT PARAMETERS
own_ip_addr=192.168.12.1
nas_identifier=FreeBSD
auth_server_addr=127.0.0.1
auth_server_port=1812
auth_server_shared_secret=>
My /etc/wpa_supplicant.conf:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
#
# home network; allow all valid ciphers
network={
ssid="MyFiWi"
key_mgmt=WPA-EAP
eap=TLS
ca_cert="/home/MyFiWi.pem"
}
What I do wrong?
Sergey Zaykov
(101 rep)
Jul 13, 2025, 10:36 PM
2
votes
1
answers
2922
views
hostapd fails with nl80211 driver initialization on i.MX6 (RTL8812au)
I’m having some trouble with `hostapd` and `nl80211`. When I try to launch `hostapd`, this is what I get: ``` # /etc/init.d/hostapd start Starting HOSTAP Daemon: Configuration file: /etc/hostapd.conf nl80211: Driver does not support authentication/association or connect commands nl80211 driver initi...
I’m having some trouble with
hostapd
and nl80211
. When I try to launch hostapd
, this is what I get:
# /etc/init.d/hostapd start
Starting HOSTAP Daemon: Configuration file: /etc/hostapd.conf
nl80211: Driver does not support authentication/association or connect commands
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
Is this due to the Wi-Fi driver (RTL8812au
) or the nl80211
driver? I’m working on an ARM-based device with an i.MX6 processor. The driver is cross-compiled.
Something strange: iwconfig
works:
# iwconfig
wlan0 unassociated Nickname:""
Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
But when I run iw list
, nothing happens.
Can someone help me with this problem?
Additional info:
- Yocto and custom BSP on the i.MX6 board
- Kernel version: 3.14.28
- Linux distribution: Poky 1.8.1
- Wi-Fi USB key: Edimax EW-7811USC
PierreOlivier
(121 rep)
May 20, 2016, 01:24 PM
• Last activity: May 30, 2025, 02:03 PM
3
votes
1
answers
5580
views
Hostapd on a Raspberry Pi 3 with external WiFi card
I am trying to set an AP on a Raspberry Pi 3 using an external USB WiFi card and hostapd and dsnmasq. I have managed to achieve it using the internal WiFi card but when I try to switch to my external one I got the following error: $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf Configuration file...
I am trying to set an AP on a Raspberry Pi 3 using an external USB WiFi card and hostapd and dsnmasq. I have managed to achieve it using the internal WiFi card but when I try to switch to my external one I got the following error:
$ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
nl80211 driver initialization failed.
wlan1: interface state UNINITIALIZED->DISABLED
wlan1: AP-DISABLED
hostapd_free_hapd_data: Interface wlan1 wasn't started
I believe it is because by default the hostapd is using
nl80211
driver. This is the output of lsusb
- Bus 001 Device 004: ID 148f:3072 Ralink Technology, Corp. RT3072 Wireless Adapter
. And this is the output of lshw
*-network:1
description: Wireless interface
physical id: 3
bus info: usb@1:1.4
logical name: wlan1
serial: 98:3f:9f:24:a2:00
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=rt2800usb driverversion=4.14.71-v7+ firmware=0.36 ip=10.100.100.254 link=no m
ulticast=yes wireless=IEEE 802.11
So apparently this card is using the rt2080usb
driver but when I try to put it inside the hostapd.conf
and start manually the hostapd
I got the following error:
$ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Line 3: invalid/unknown driver 'rt2080usb'
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Failed to set up interface with /etc/hostapd/hostapd.conf
Failed to initialize interface
And this is my hostapd.conf
file:
interface=wlan1
ssid=WiPi
driver=rt2080usb
hw_mode=g
ieee80211n=1
wmm_enabled=1
channel=4
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=wifipasswordhere
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ht_capab=[HT20][SHORT-GI-20]
[EDIT] This is the output of the iwconfig
command:
wlan1 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short long limit:2 RTS thr:off Fragment thr:off
Power Management:off
wlan0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
And this is the output of the iw list
command:
valid interface combinations:
* #{ AP, mesh point } ENABLED
wlan1: AP-ENABLED
And this is the output of iwconfig
:
wlan1 IEEE 802.11 Mode:Master Tx-Power=20 dBm
Retry short long limit:2 RTS thr:off Fragment thr:off
Power Management:off
And this is the hostapd
log when I try to connect to my essid WiPi and run speedtest:
$ Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan1 with hwaddr 98:3f:9f:24:a2:00 and ssid "WiPi"
wlan1: interface state UNINITIALIZED->ENABLED
wlan1: AP-ENABLED
wlan1: STA 94:65:2d:d4:e0:5b IEEE 802.11: authenticated
wlan1: STA 94:65:2d:d4:e0:5b IEEE 802.11: associated (aid 1)
wlan1: AP-STA-CONNECTED 94:65:2d:d4:e0:5b
wlan1: STA 94:65:2d:d4:e0:5b RADIUS: starting accounting session 5BEC735C-00000000
wlan1: STA 94:65:2d:d4:e0:5b WPA: pairwise key handshake completed (RSN)
wlan1: AP-STA-DISCONNECTED 94:65:2d:d4:e0:5b
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED
wlan1: INTERFACE-ENABLED
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED
wlan1: INTERFACE-ENABLED
Failed to set beacon parameters
handle_probe_req: send failed
Georgi Stoyanov
(860 rep)
Nov 7, 2018, 07:09 PM
• Last activity: May 12, 2025, 03:08 AM
0
votes
1
answers
217
views
All WiFi 5G frequencies show "no IR". Is there a way to enable 5G in AP mode?
I have this WiFi module and want to set it up as an WiFi 5G AP. I can set it up as an AP in 2.4G by using hostapd.service, so it works for 2.4G. However, I want to set the AP using 5G, but it fails. I see "**no IR**" on all the 5G frequencies on **# iw list**. Does that mean there is just no way to...
I have this WiFi module and want to set it up as an WiFi 5G AP. I can set it up as an AP in 2.4G by using hostapd.service, so it works for 2.4G. However, I want to set the AP using 5G, but it fails.
I see "**no IR**" on all the 5G frequencies on **# iw list**.
Does that mean there is just no way to use 5G in AP mode on this WiFi ac module?
Thanks.
# lspci | grep -i wireless
08:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
# iw reg get
global
country 00: DFS-UNSET
(755 - 928 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
(2402 - 2472 @ 40), (N/A, 20), (N/A)
(2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
phy#0
country 99: DFS-UNSET
(2402 - 2472 @ 40), (N/A, 20), (N/A)
(5140 - 5360 @ 80), (N/A, 30), (N/A), PASSIVE-SCAN
(5715 - 5860 @ 80), (N/A, 30), (N/A), PASSIVE-SCAN
# iw list | grep -i frequencies -C 99 | egrep -i "\* 2|\* 5"
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 24.0 Mbps
* 54.0 Mbps
* 2412 MHz (20.0 dBm)
* 2417 MHz (20.0 dBm)
* 2422 MHz (20.0 dBm)
* 2427 MHz (20.0 dBm)
* 2432 MHz (20.0 dBm)
* 2437 MHz (20.0 dBm)
* 2442 MHz (20.0 dBm)
* 2447 MHz (20.0 dBm)
* 2452 MHz (20.0 dBm)
* 2457 MHz (20.0 dBm)
* 2462 MHz (20.0 dBm)
* 2467 MHz (disabled)
* 2472 MHz (disabled)
* 2484 MHz (disabled)
* 24.0 Mbps
* 54.0 Mbps
* 5180 MHz (30.0 dBm) (no IR)
* 5200 MHz (30.0 dBm) (no IR)
* 5220 MHz (30.0 dBm) (no IR)
* 5240 MHz (30.0 dBm) (no IR)
* 5260 MHz (30.0 dBm) (no IR, radar detection)
* 5280 MHz (30.0 dBm) (no IR, radar detection)
* 5300 MHz (30.0 dBm) (no IR, radar detection)
* 5320 MHz (30.0 dBm) (no IR, radar detection)
* 5500 MHz (disabled)
* 5520 MHz (disabled)
* 5540 MHz (disabled)
* 5560 MHz (disabled)
* 5580 MHz (disabled)
* 5600 MHz (disabled)
* 5620 MHz (disabled)
* 5640 MHz (disabled)
* 5660 MHz (disabled)
* 5680 MHz (disabled)
* 5700 MHz (disabled)
* 5720 MHz (disabled)
* 5745 MHz (30.0 dBm) (no IR)
* 5765 MHz (30.0 dBm) (no IR)
* 5785 MHz (30.0 dBm) (no IR)
* 5805 MHz (30.0 dBm) (no IR)
* 5825 MHz (30.0 dBm) (no IR)
* 5845 MHz (30.0 dBm) (no IR)
* 5865 MHz (disabled)
# uname -rv
6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06)
------------------------------- **Parting line** --------------------------------
Error messages after adding country_code=US in hostapd.conf and restart hostapd.service
May 06 09:17:21 Deb160 systemd: Starting hostapd.service - Access point and authentication server for Wi-Fi and Ethernet...
May 06 09:17:22 Deb160 kernel: ath10k_pci 0000:08:00.0: pdev param 0 not supported by firmware
May 06 09:17:22 Deb160 kernel: br0: port 2(wlp8s0) entered blocking state
May 06 09:17:22 Deb160 kernel: br0: port 2(wlp8s0) entered disabled state
May 06 09:17:22 Deb160 kernel: device wlp8s0 entered promiscuous mode
May 06 09:17:22 Deb160 hostapd: wlp8s0: interface state UNINITIALIZED->COUNTRY_UPDATE
May 06 09:17:22 Deb160 hostapd: Frequency 5765 (primary) not allowed for AP mode, flags: 0x1873 NO-IR
May 06 09:17:22 Deb160 hostapd: Primary frequency not allowed
May 06 09:17:22 Deb160 hostapd: wlp8s0: IEEE 802.11 Configured channel (153) or frequency (5765) (secondary_channel=0) not found from the channel list of the current mode (2) IEEE 802.11a
May 06 09:17:22 Deb160 hostapd: wlp8s0: IEEE 802.11 Configured channel (153) or frequency (5765) (secondary_channel=0) not found from the channel list of the current mode (2) IEEE 802.11a
May 06 09:17:22 Deb160 hostapd: wlp8s0: IEEE 802.11 Hardware does not support configured channel
May 06 09:17:22 Deb160 hostapd: wlp8s0: IEEE 802.11 Hardware does not support configured channel
May 06 09:17:22 Deb160 hostapd: Could not select hw_mode and channel. (-3)
May 06 09:17:22 Deb160 hostapd: wlp8s0: interface state COUNTRY_UPDATE->DISABLED
May 06 09:17:22 Deb160 hostapd: wlp8s0: AP-DISABLED
May 06 09:17:22 Deb160 hostapd: wlp8s0: Unable to setup interface.
May 06 09:17:22 Deb160 hostapd: wlp8s0: interface state DISABLED->DISABLED
May 06 09:17:22 Deb160 hostapd: wlp8s0: AP-DISABLED
May 06 09:17:22 Deb160 hostapd: wlp8s0: CTRL-EVENT-TERMINATING
May 06 09:17:22 Deb160 hostapd: hostapd_free_hapd_data: Interface wlp8s0 wasn't started
May 06 09:17:22 Deb160 hostapd: nl80211: deinit ifname=wlp8s0 disabled_11b_rates=0
May 06 09:17:22 Deb160 kernel: device wlp8s0 left promiscuous mode
May 06 09:17:22 Deb160 kernel: br0: port 2(wlp8s0) entered disabled state
May 06 09:17:23 Deb160 hostapd: nl80211: Failed to remove interface wlp8s0 from bridge br0: Invalid argument
May 06 09:17:24 Deb160 kernel: ath10k_pci 0000:08:00.0: pdev param 0 not supported by firmware
May 06 09:17:24 Deb160 systemd: hostapd.service: Control process exited, code=exited, status=1/FAILURE
May 06 09:17:24 Deb160 systemd: hostapd.service: Failed with result 'exit-code'.
May 06 09:17:24 Deb160 systemd: Failed to start hostapd.service - Access point and authentication server for Wi-Fi and Ethernet.
May 06 09:17:24 Deb160 systemd: hostapd.service: Consumed 2.484s CPU time.
May 06 09:17:26 Deb160 systemd: hostapd.service: Scheduled restart job, restart counter is at 1.
I also use iw to set US and restart hostapd, same errors.
# iw reg set US
# iw reg get
global
country US: DFS-FCC
(902 - 904 @ 2), (N/A, 30), (N/A)
(904 - 920 @ 16), (N/A, 30), (N/A)
(920 - 928 @ 8), (N/A, 30), (N/A)
(2400 - 2472 @ 40), (N/A, 30), (N/A)
(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
(5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
(5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
(5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
(5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
(57240 - 71000 @ 2160), (N/A, 40), (N/A)
phy#0
country 99: DFS-UNSET
(2402 - 2472 @ 40), (N/A, 20), (N/A)
(5140 - 5360 @ 80), (N/A, 30), (N/A), PASSIVE-SCAN
(5715 - 5860 @ 80), (N/A, 30), (N/A), PASSIVE-SCAN
Update alternative to debian or upstream, same errors after.
# update-alternatives --config regulatory.db
There are 2 choices for the alternative regulatory.db (providing /lib/firmware/regulatory.db).
Selection Path Priority Status
------------------------------------------------------------
0 /lib/firmware/regulatory.db-debian 100 auto mode
1 /lib/firmware/regulatory.db-debian 100 manual mode
* 2 /lib/firmware/regulatory.db-upstream 50 manual mode
Press to keep the current choice[*], or type selection number:
XavierWood
(87 rep)
May 5, 2025, 09:45 AM
• Last activity: May 6, 2025, 05:08 AM
1
votes
1
answers
3602
views
hostapd disables and enables interface
My hostapd, after some minutes of execution, it does this: ``` wlan1: INTERFACE-DISABLED wlan1: INTERFACE-ENABLED ``` then, connected clients lose connection and, if i try reconnecting, it wont't connect anymore. I also tried with WPA2, but if reconnecting it says wrong password. My hostapd.conf: ``...
My hostapd, after some minutes of execution, it does this:
wlan1: INTERFACE-DISABLED
wlan1: INTERFACE-ENABLED
then, connected clients lose connection and, if i try reconnecting, it wont't connect anymore. I also tried with WPA2, but if reconnecting it says wrong password.
My hostapd.conf:
interface=wlan1
driver=nl80211
ssid=the-bash-guy
hw_mode=g
channel=6
macaddr_acl=0
ignore_broadcast_ssid=0
ieee80211n=1
wme_enabled=1
My dnsmasq.conf:
interface=wlan1
dhcp-range=192.168.1.2,192.168.1.30,255.255.255.0,12h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.1
server=8.8.8.8
server=8.8.4.4
log-queries
log-dhcp
listen-address=127.0.0.1
Before starting hostapd, i did these (.sh file):
echo "BEFORE MONITOR MODE\n\n"
iwconfig wlan1
ifconfig wlan1 down
iwconfig wlan1 mode monitor
ifconfig wlan1 up
echo "AFTER MONITOR MODE\n\n"
iwconfig wlan1
echo "\n\nSTART HOSTAPD!\n\n"
ifconfig wlan1 192.168.1.1 netmask 255.255.255.0
hostapd ./hostapd.conf
then:
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface wlan1 -j ACCEPT
dnsmasq -C dnsmasq.conf -d
(wlan0 is Intel Wi-Fi AX200)
(wlan1 is RTL8812BU with the following driver: https://github.com/morrownr/88x2bu-20210702)
OS: 5.16.0-kali7-amd64
DoggoPlayer
(11 rep)
Apr 22, 2022, 09:09 AM
• Last activity: Apr 29, 2025, 10:06 PM
2
votes
1
answers
3429
views
Why configure bridge in hostapd.conf
In a lot of hostapd documentation (is there a single comprehensive one that covers all options?) I read that it is necessary to configure the bridge to which the wireless interface belongs to, using the hostapd `bridge` directive instead of adding them the way you would usually configure an interfac...
In a lot of hostapd documentation (is there a single comprehensive one that covers all options?) I read that it is necessary to configure the bridge to which the wireless interface belongs to, using the hostapd
bridge
directive instead of adding them the way you would usually configure an interface as part of a bridge. Why is this required? Is it possible to configure multiple wireless networks on different bridge that way?
Philippe
(569 rep)
Jan 3, 2022, 11:01 PM
• Last activity: Mar 20, 2025, 03:03 AM
0
votes
0
answers
66
views
Show encryption used by WiFi stations connected to my hotspot
I'm hosting a hotspot from my PC, which has a wired internet connection and a wifi adapter. The OS is Fedora 40, using Network Manager and wpa_supplicant. I have 3 wifi devices which are able to connect to this hotspot and use the internet. I want to know what "mode" each device chose to connect usi...
I'm hosting a hotspot from my PC, which has a wired internet connection and a wifi adapter. The OS is Fedora 40, using Network Manager and wpa_supplicant. I have 3 wifi devices which are able to connect to this hotspot and use the internet. I want to know what "mode" each device chose to connect using (by which I mean cipher suites/encryption techniques = WPA/WPA2 & TKIP/AES/CCMP). How do I query this information? My router seems to know this information just fine and shows it up in its web pages, now I want to be able to pull up the same info on my Linux PC.
hostapd does not seem to be installed, so I'm wary of installing it to use hostapd_cli because it might disrupt whatever is currently running. wpa_cli refuses to run because it can't connect to the running instance [wpa_cli is now running after enabling its control socket](https://www.jfcarter.net/~jimc/documents/bugfix/34-wpa_cli.html) , but I can't tell how to ask it for this information.
Background: I'm trying to debug some wifi connection issues with an IoT device, which is happily connecting to a hotspot hosted by my PC but not to my network hosted from the router device. I suspect an encryption issue.
Milind R
(111 rep)
Feb 25, 2025, 02:48 PM
• Last activity: Mar 12, 2025, 05:32 PM
0
votes
1
answers
153
views
Captive Portal w/ nginx, hostapd, nftables, dnsmasq
I'm trying to make captive portal with nginx, hostapd, nftables, dnsmasq and python-flask. I have two main problems 1) I'm not getting a popup on Android, but am on Iphone/OSX. 2) I'm not sure how to redirect the user after the connection. I have a nftables command, but I need an IP address for this...
I'm trying to make captive portal with nginx, hostapd, nftables, dnsmasq and python-flask.
I have two main problems
1) I'm not getting a popup on Android, but am on Iphone/OSX.
2) I'm not sure how to redirect the user after the connection. I have a nftables command, but I need an IP address for this. Since nginx is formwarding from port 80 to 8080 (python app) I don't know how to get this.
Here's the nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
if ($request_method !~ ^(GET|HEAD|POST)$) { return 444; }
# Handle iOS
if ($http_user_agent ~* (CaptiveNetworkSupport) ) {
return 302 http://go.portal ;
}
# Handle Android captive portal detection
location = /generate_204 {
return 302 http://go.portal ;
}
location = /gen_204 {
return 302 http://go.portal ;
}
# Default redirect for any unexpected requests to trigger captive portal
# sign in screen on device.
location / {
return 302 http://go.portal ;
}
}
server {
listen 80;
listen [::]:80;
server_name go.portal;
# Only allow GET, HEAD, POST
if ($request_method !~ ^(GET|HEAD|POST)$) { return 444; }
root /var/www;
index index.html;
location /api/ {
proxy_pass http://127.0.0.1:8080/api/ ;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
try_files $uri $uri/ =404;
}
# Redirect these errors to the home page.
error_page 401 403 404 =200 /index.html;
}
}
dnsmasq.conf
listen-address=192.168.2.1
no-hosts
# log-queries
log-facility=/var/log/dnsmasq.log
dhcp-range=192.168.2.2,192.168.2.254,72h
dhcp-option=option:router,192.168.2.1
dhcp-authoritative
dhcp-option=114,http://go.portal/index.html
# Resolve captive portal check domains to a "fake" external IP
address=/connectivitycheck.gstatic.com/10.45.12.1
address=/connectivitycheck.android.com/10.45.12.1
address=/clients3.google.com/10.45.12.1
address=/clients.l.google.com/10.45.12.1
address=/play.googleapis.com/10.45.12.1
# Resolve everything to the portal's IP address.
address=/#/192.168.2.1
Here's the bash that starts everything.
INET_NIC=$(cat /run/inet_nic 2>/dev/null) || { echo "Connect to WiFi first"; exit 1; }
AP_NIC=$(cat /run/ap_nic 2>/dev/null) || { echo "Create AP first"; exit 1; }
echo 1 > /proc/sys/net/ipv4/ip_forward
nft flush ruleset
# Set up the filter table (Mode 1)
nft add table ip filter
nft add chain ip filter input '{ type filter hook input priority 0; policy accept; }'
nft add chain ip filter forward '{ type filter hook forward priority 0; policy accept; }'
nft add chain ip filter output '{ type filter hook output priority 0; policy accept; }'
# Set up the NAT table and chain for masquerading (Mode 2)
nft add table ip nat
nft add chain ip nat postrouting '{ type nat hook postrouting priority 100; }'
kill -9 $(pidof dnsmasq) 2>/dev/null
dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $LOG_F &
kill -9 $(pidof nginx) 2>/dev/null
mkdir /var/log/nginx 2>/dev/null
nginx &
kill -9 $(pidof evil_portal) 2>/dev/null
ip link set lo up
/usr/bin/evil_portal &
And here's the command I would issue when the user accepts the terms.
nft add rule ip nat postrouting oifname wlan1 ip saddr 192.168.2.217 masquerade
I won't share the python/html stuff because that's all working fine. Basically I'm getting the users button push, and my python function is calling. But python is telling me the IP is 127.0.0.1 because nginx if forwarding the traffic from port 80 to 8080
Thanks :)
user3666672
(11 rep)
Mar 5, 2025, 07:45 PM
• Last activity: Mar 6, 2025, 01:02 AM
0
votes
0
answers
214
views
Configure hostapd with sae_password and vlanid
According [to the hostapd documentation](https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf), when you use WPA3, the hostapd AP can bind to a vlan interface based on the received passphrase. > an optional VLAN ID specification can be used to bind the station > to the specified VLAN whenever the sp...
According [to the hostapd documentation](https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf) , when you use WPA3, the hostapd AP can bind to a vlan interface based on the received passphrase.
> an optional VLAN ID specification can be used to bind the station
> to the specified VLAN whenever the specific SAE password entry is used.
> [...]
>
> #sae_password=example secret|vlanid=3|id=pw identifier
I have a minimal working hostapd configuration for WPA3 but it does not work if I try to bind to a vlan :
interface=wlan0
ssid2="Test-44"
country_code=
# Advertises the country_code and the set of allowed
# channels and transmit power levels based on the regulatory limits.
ieee80211d=1
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=1
driver=nl80211
ieee80211n=1
ieee80211ac=1
# Support for 802.11a(c|x)
hw_mode=g
# Required for 802.11n/802.11ac/802.11ax
# https://www.wi-fi.org/discover-wi-fi/wi-fi-certified-wmm-programs
wmm_enabled=1
# Enable WPA. Needed for WPA3
wpa=2
# Set of accepted key management algorithms (SAE = WPA3 / WPA-PSK = WPA2)
wpa_key_mgmt=SAE
rsn_pairwise=CCMP
# ieee80211w: Enable management frame protection (MFP)
ieee80211w=2
sae_password=password|vlanid=100
root@router ~# ip l
1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wan0: mtu 1500 qdisc mq state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: lan: mtu 1500 qdisc mq state DOWN qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
4: wlan0: mtu 1500 qdisc noqueue state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
9: vlan100@wlan0: mtu 1500 qdisc noqueue state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
Hostapd seems to correctly see the VLAN interface :
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
nl80211: Ignore interface down event since interface wlan0 is up
RTM_NEWLINK: ifi_index=9 ifname=vlan100 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
RTM_NEWLINK: ifi_index=4 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK: ifi_index=9 ifname=vlan100 operstate=3 linkmode=0 ifi_family=0 ifi_flags=0x1003 ([UP])
But when I try to connect to the hotspot with a device, hostapd refuses with this debug log:
SAE: Assign STA xx:xx:xx:xx:xx:xx to VLAN ID 100
Invalid VLAN ID 100 in sae_password
Any ideas?
Rand0mMan
(101 rep)
Oct 31, 2024, 01:01 AM
• Last activity: Oct 31, 2024, 01:15 AM
0
votes
0
answers
27
views
How to access IP and port configuration of the tablet running Linuxmint with "hostapd + DHCP"
_My task_: Configure and run Access Point (AP) on the tablet (x86) with Linux mint with access from devices connected to the created AP. ##### Background as additional information (but this is not the topic of question, *real question at the end of description*): - Some measurement devices must conn...
_My task_: Configure and run Access Point (AP) on the tablet (x86) with Linux mint with access from devices connected to the created AP.
##### Background as additional information (but this is not the topic of question, *real question at the end of description*):
- Some measurement devices must connect to this tablet via AP and send data to it throw tcp socket.
#### I have done the next parts:
---
## 1. Created the Virtual WiFi interface
- the created intefce works as isolated (not bridged, like a router)
All the scripts are provided for the physical WiFi interface
wlp1s0
I created the virtual interface with the name wlp1s0_ap
- Created a unit (service) file as /lib/systemd/system/wireless-device@.service
[Unit]
Description=Create virtual wireless interface
Requires=sys-subsystem-net-devices-wlp1s0.device
#After=network.target
After=sys-subsystem-net-devices-wlp1s0.device
[Service]
Type=oneshot
#ExecStart=/usr/sbin/iw dev wlp1s0 interface add %I type __ap addr "00:0c:e3:6f:78:ee"
ExecStart=/usr/sbin/iw dev wlp1s0 interface add %I type managed addr "00:0c:e3:6f:78:ee"
#ExecStart=/usr/bin/iw dev wlan0 interface add wlp1s0_ap type __ap addr "00:0c:e3:6f:78:ee"
[Install]
WantedBy=multi-user.target
- Then run
systemctl enable wireless-device@wlp1s0_ap.service
- Reboot the PC
---
## 2. Added the new virtual interface into ignored ones for the **NetworkManager**
**edit:**
sudo nano /etc/NetworkManager/NetworkManager.conf
by adding **wlp1s0_ap** created interface into _unmanaged-devices_ section (**NB!** append to existing ones)
[keyfile]
unmanaged-devices=interface-name:wlp1s0_ap
run
sudo nmcli general reload
---
## 3. Configured hostapd
I called the AP as EVT
with password ******
. More details are below.
- install hostapd
- sudo apt install hostapd
- edit the file sudo nano /etc/default/hostapd
- current version is below
DAEMON_CONF="/etc/hostapd/hostapd.conf"
- edit the configuration file (below is the current variant):
- sudo nano /etc/hostapd/hostapd.conf
interface=wlp1s0_ap
driver=nl80211
country_code=EE
ssid=EVT
wpa_passphrase=****
hw_mode=g
channel=10
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0
ieee80211n=1
- the daemon is started as
- sudo systemctl start hostapd
---
## 4. Configured DHCP server
Fro the DHCP server isc-dhcp-server
is selected.
### _isc-dhcp-server_ configuration
- install: sudo apt install isc-dhcp-server
- edit the file
- sudo nano /etc/dhcp/dhcpd.conf
, (below is the current variant):
# dhcpd.conf
#INTERFACES="wlp1s0_ap"
option domain-name "etv.org";
option domain-name-servers 192.168.1.2, 192.168.1.3;
default-lease-time 86400;
max-lease-time 604800;
ddns-update-style none;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
interface wlp1s0_ap;
## dhcp start and end IP range ##
range 192.168.1.100 192.168.1.200;
option subnet-mask 255.255.255.0; ## subnet
option broadcast-address 192.168.1.255; ## broadcast
option routers 192.168.1.254; ## router IP
}
The daemon is started as
service isc-dhcp-server start
---
## 5. Assigned static IP address for the created virtual interface
I modified the file to assign the IP 192.168.1.111
to the interface wlp1s0_ap
:
sudo nano /etc/network/interfaces
the content of the /etc/network/interfaces
file is
auto lo
iface lo inet loopback
auto wlp1s0_ap
iface wlp1s0_ap inet static
address 192.168.1.111
netmask 255.255.255.0
gateway 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 192.168.1.2,192.168.1.3
---
### The parts described above are working and I can connect to the AP.
### ifconfig
listing:
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 1386 bytes 149889 (149.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1386 bytes 149889 (149.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp1s0: flags=4163 mtu 1500
inet 172.20.92.22 netmask 255.255.255.0 broadcast 172.20.92.255
inet6 fe80::9ea9:58d3:aa31:b7e9 prefixlen 64 scopeid 0x20
ether 00:0c:e3:6f:78:ed txqueuelen 1000 (Ethernet)
RX packets 1111808 bytes 125498550 (125.4 MB)
RX errors 0 dropped 7507 overruns 0 frame 0
TX packets 23673 bytes 3070974 (3.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp1s0_ap: flags=4163 mtu 1500
inet 192.168.1.111 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:e3ff:fe6f:78ee prefixlen 64 scopeid 0x20
ether 00:0c:e3:6f:78:ee txqueuelen 1000 (Ethernet)
RX packets 808 bytes 124999 (124.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 893 bytes 155057 (155.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
# Problem:
**However I cannot communicate with this Tablet**
For example, ping
to the assigned IP ping 192.168.1.111
gives the next response:
PING 192.168.1.111 (192.168.1.111) 56(84) bytes of data.
From 192.168.1.101 icmp_seq=1 Destination Host Unreachable
From 192.168.1.101 icmp_seq=2 Destination Host Unreachable
From 192.168.1.101 icmp_seq=3 Destination Host Unreachable
From 192.168.1.101 icmp_seq=4 Destination Host Unreachable
^C
--- 192.168.1.111 ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4065ms
**telnet** output:
~$ telnet 192.168.1.111
Trying 192.168.1.111...
telnet: Unable to connect to remote host: No route to host
The questions:
1. What I missed?
2. How to configure the access to the Tablet on which hostapd + DHCP
are running?
Andrei Krivoshei
(101 rep)
Oct 28, 2024, 02:57 PM
1
votes
0
answers
132
views
IPv6 only hotspot using hostapd and dnsmasq
to test the IPv6 capability of our end devices, i need to set up a hotspot on a raspberry pi that only provides ipv6 adresses. I followed this guide: https://partiallydisassembled.net/posts/pi-nat64.html I verified, that i have an IPv6 Adress on my wlan0 interface: ``` wlan0: flags=4163 mtu 1500 ine...
to test the IPv6 capability of our end devices, i need to set up a hotspot on a raspberry pi that only provides ipv6 adresses.
I followed this guide: https://partiallydisassembled.net/posts/pi-nat64.html
I verified, that i have an IPv6 Adress on my wlan0 interface:
wlan0: flags=4163 mtu 1500
inet6 fe80::da3a:ddff:fe91:634 prefixlen 64 scopeid 0x20
inet6 fec0::1 prefixlen 64 scopeid 0x40
ether d8:3a:dd:91:06:34 txqueuelen 1000 (Ethernet)
RX packets 17 bytes 2780 (2.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 42 bytes 6004 (6.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
And hostapd is set up correct and running. I try to connect with my phone to the access point and i get a message, that no connection is possible.
If i check the debug output of dnsmasq, i see, that my phone sends a RTR-SOLICIT message and the router sends RTR-ADVERTs, but then nothing happens.
-dhcp: RTR-ADVERT(wlan0) fec0::
dnsmasq-dhcp: RTR-ADVERT(wlan0) fec0::
dnsmasq-dhcp: RTR-SOLICIT(wlan0) 48:bc:e1:fb:2a:ba
dnsmasq-dhcp: RTR-ADVERT(wlan0) fec0::
dnsmasq-dhcp: RTR-ADVERT(wlan0) fec0::
dnsmasq-dhcp: RTR-ADVERT(wlan0) fec0::
If switch everyhing to IPv4, everything works fine, so i think the issue is with dnsmasq configuration. My configuration file looks like this:
interface=wlan0
bind-interfaces
domain-needed
bogus-priv
server=2001:4860:4860::6464
local=/pi64/
domain=pi64
dhcp-fqdn
enable-ra
dhcp-range=::,constructor:wlan0,slaac
dhcp-option=option6:dns-server,2001:4860:4860::6464
dhcp-authoritative
Dominic
(13 rep)
Oct 9, 2024, 11:23 AM
0
votes
2
answers
628
views
Clients cannot connect to each other on WLAN. No reply on ARP requests
I have install a WLAN with an access point which connects the clients to the internet. At first all seemed to work correctly until I noticed that the clients can not communicate with each other. Here are the details: One machines is connected to the internet via eth0, and acts as an access point via...
I have install a WLAN with an access point which connects the clients to the internet.
At first all seemed to work correctly until I noticed that the clients
can not communicate with each other.
Here are the details: One machines is connected to the internet via eth0,
and acts as an access point via wlan1. It is running
hostapd
and dnsmasq
and it's using NAT to connect the other clients to the internet.
Client A Client B
192.168.1.143 192.168.1.235
\ /
\ /
\ /
Access Point, AP
wlan1: 192.168.1.1
eth0: 192.168.0.xxx
So far, the clients can connect successfully to the internet. They can connect
(eg. via ssh) to the access point. And the access point can ssh to the
clients.
Now the problem is that client A cannot connect to client B and vice
versa. Using tcpdump
on the access point I see that client A is
sending ARP requests for client B. But client B never receives these
requests and thus cannot reply. Therefore the arp table entry
for client B is incomplete (and vice versa).
For testing purpose I set the arp table entries manually for both
clients with arp -s
. And now everything is working
successfully. The clients can connect to each other and they can connect
to the intenet. But actually I don't want to set arp table entries
manually for all client machines.
Now, my question is: Where's the problem here? How are arp tables
supposed to be updated automatically? Where should I look into?
Is it a problem on the access point (routing table, hostapd, dnsmasq, ...)?
Or is it a problem on the client machines?
ps: There are no arptables rules installed on any machine:
$ arptables -L
Chain INPUT (policy ACCEPT)
Chain OUTPUT (policy ACCEPT)
**Edit:**
Finally I found the problem:
After rechecking the configuration I eventually tested it with another USB Wifi
adapter. And I was really surprised to see that everything was working then. ARP
requests were being received and answered by the clients. Ping and ssh between
arbitrary clients was working, too.
Just to be certain, I changed back to the first USB Wifi adapter. And
again ARP requests were not received (and answered) by the clients. Thus
I can confirm that it was not an issue with configuration of hostapd
or with kernel arp tables. The problem was the driver for the Wifi
adapter.
Here are the details:
1) **ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac 2T2R DB WLAN Adapter**
- Not working correctly.
- ARP requests are received by the access point, but they are not
received by the clients.
2) **ID 0bda:b812 Realtek Semiconductor Corp.**
- Working satisfactorily.
- ARP requests and ARP replies between arbitrary clients are working
correctly.
Andreas Matthias
(241 rep)
Apr 17, 2021, 02:17 AM
• Last activity: Oct 8, 2024, 04:42 PM
0
votes
0
answers
75
views
Forwarding KDEConnect UDP packets between bridged APs with firewalld/firewall-cmd
I was having an issue where KDEConnect peers on my LAN could not see each other intermittently. Because the peers are on APs that are physically connected to and bridged on my main router, I tried changing settings involving hairpin, multicast to unicast, etc, which no real improvement. Fortunately,...
I was having an issue where KDEConnect peers on my LAN could not see each other intermittently. Because the peers are on APs that are physically connected to and bridged on my main router, I tried changing settings involving hairpin, multicast to unicast, etc, which no real improvement. Fortunately, this answer by [@A.B](https://unix.stackexchange.com/users/251756/a-b ) seems to have solved the issue with bridge family forwarding/routing.
https://unix.stackexchange.com/questions/745847/nftables-doesnt-see-kde-connect-packets-between-two-machines-on-the-same-interf
Steps 1 and 2 were pretty straightforward for me to implement permanently. However, I would like to convert Step 3 of the answer, which uses nftables, into a permanent solution using firewalld/firewall-cmd instead. The rest of my firewall setup is already defined in firewalld, and I would prefer to keep it all straight in there, and not layer raw nft stuff also. I mostly understand what the nft commands are doing, but not well enough to find their exact corollary in firewall-cmd. I would have asked this in a comment on that other question, but, alas, I need more rep first.
So, how can I implement these nft commands in firewalld instead?
table bridge filter {
chain conntrack {
ct state vmap { invalid : drop, established : accept, related : accept }
}
chain kdeconnect {
udp dport 1714-1764 counter accept
tcp dport 1714-1764 counter accept
}
chain forward {
type filter hook forward priority filter; policy drop;
jump conntrack
ether type ip6 drop # just like OP did: drop any IPv6
icmp type echo-request counter accept
jump kdeconnect
ether type arp accept # mandatory for IPv4 connectivity
counter
}
}
Thanks!
D.H
(1 rep)
Sep 6, 2024, 05:47 PM
1
votes
0
answers
60
views
hostapd: slow performance unless android phone connects
I have an host computer, set up with hostapd as access point and dnsmasq for DHCP server. I'm running under ArchLinux, with Linux kernel 6.1 (as I'm on an embedded ARM board which only supports up to this kernel - all the rest is freshly up-to-date). I'm using a 802.11 Wi-Fi dongle: 0bda:8176 Realte...
I have an host computer, set up with hostapd as access point and dnsmasq for DHCP server. I'm running under ArchLinux, with Linux kernel 6.1 (as I'm on an embedded ARM board which only supports up to this kernel - all the rest is freshly up-to-date).
I'm using a 802.11 Wi-Fi dongle:
0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
This host broadcasts through the AP messages to a set of 4 devices (ESP32s controlling various hardware devices) at a 20 milliseconds interval (by sending to 192.168.1.255). The devices send a heartbeat message to the host every second.
iwconfig
reports:
wlan0 IEEE 802.11 Mode:Master Tx-Power=20 dBm
Retry short limit:7 RTS thr=2347 B Fragment thr:off
Power Management:off
My Linux cmdline has:
power_save=0 usbcore.autosuspend=-1
The behaviour I observe is: if I just have these four devices connected to the system, then there's a 8 - 10 second latency between the time the message gets sent (observed through wireshark) and the time I observe the message being received. Also, receiving is very erratic and jittery.
The mystery part is: the very moment I connect my Android phone to the host AP, then suddenly everything becomes instantaneous, no more jitter, latency or performance issues. It goes back to being bad the moment I disconnect my phone.
What could be the cause of this, and how can I make sure that my setup always perform optimally without having to let my phone in the network?
Jean-Michaël Celerier
(340 rep)
Sep 4, 2024, 03:29 PM
• Last activity: Sep 4, 2024, 04:05 PM
0
votes
0
answers
151
views
Router configuration. Unable to Connect to Hostapd WiFi Network
I have set up a wireless network using hostapd on my Banana Pi R3 router running Ubuntu 22.04. **hostapd configuration** $ sudo cat /etc/hostapd/hostapd_wlan0_gemma.conf # hostapd configuration file interface=wlan0 driver=nl80211 ctrl_interface=/var/run/hostapd ssid=GemmaNode country_code=EU channel...
I have set up a wireless network using hostapd on my Banana Pi R3 router running Ubuntu 22.04.
**hostapd configuration**
$ sudo cat /etc/hostapd/hostapd_wlan0_gemma.conf
# hostapd configuration file
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=GemmaNode
country_code=EU
channel=7
hw_mode=g
ht_capab=[LDPC][HT20][HT40-][HT40+][GF][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1]
#ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40] # Try this
ieee80211n=1
auth_algs=1
wmm_enabled=1
wpa=2
wpa_passphrase=mypassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
nas_identifier=glutamate-vlan500
**Problem**
When I try to connect to the WiFi network from another computer, the connection fails.
**Questions**
- Why is the client not acknowledging the authentication response?
- How can I resolve the connection issue to ensure successful
authentication and connection?
**hostapd Logs**
When I start hostapd, I get the following log messages indicating an issue with authentication:
wlan0: Event RX_MGMT (18) received
mgmt::auth
authentication: STA=00:e1:b0:10:2c:df auth_alg=0 auth_transaction=1 status_code=0 wep=0 seq_ctrl=0x5f90
wlan0: STA 00:e1:b0:10:2c:df IEEE 802.11: authentication OK (open system)
wlan0: STA 00:e1:b0:10:2c:df MLME: MLME-AUTHENTICATE.indication(00:e1:b0:10:2c:df, OPEN_SYSTEM)
wlan0: STA 00:e1:b0:10:2c:df MLME: MLME-DELETEKEYS.request(00:e1:b0:10:2c:df)
authentication reply: STA=00:e1:b0:10:2c:df auth_alg=0 auth_transaction=2 resp=0 (IE len=0) (dbg=handle-auth)
nl80211: send_mlme - da=00:e1:b0:10:2c:df noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 no_encrypt=0 fc=0xb0 (WLAN_FC_STYPE_AUTH) nlmode=3
nl80211: send_mlme - Use bss->freq=2442
nl80211: send_mlme -> send_frame_cmd
nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=0 offchanok=0
CMD_FRAME - hexdump(len=30): b0 00 00 00 00 e1 b0 10 2c df 00 0c 43 26 60 00 00 0c 43 26 60 00 00 00 00 00 02 00 00 00
nl80211: Frame TX command accepted; cookie 0x91
nl80211: Drop oldest pending send frame cookie 0x0
nl80211: Event message available
nl80211: Drv Event 60 (NL80211_CMD_FRAME_TX_STATUS) received for wlan0
nl80211: MLME event 60 (NL80211_CMD_FRAME_TX_STATUS) on wlan0(00:0c:43:26:60:00) A1=00:e1:b0:10:2c:df A2=00:0c:43:26:60:00
nl80211: MLME event frame - hexdump(len=30): b0 00 00 00 00 e1 b0 10 2c df 00 0c 43 26 60 00 00 0c 43 26 60 00 00 00 00 00 02 00 00 00
nl80211: Frame TX status event A1=00:e1:b0:10:2c:df stype=11 cookie=0x91 ack=0
wlan0: Event TX_STATUS (16) received
mgmt::auth cb
wlan0: STA 00:e1:b0:10:2c:df IEEE 802.11: did not acknowledge authentication response
**wlan0 configuration**
$ sudo cat /etc/systemd/network/30-wlan0.network
[Match]
Name=wlan0
[Network]
#ConfigureWithoutCarrier=true
BindCarrier=eth0
#static setup
Address=192.168.0.1/24
Gateway=192.168.0.1
DNS=192.168.0.1
IPForward=yes
#DHCPServer=yes
DHCPServer=no
UserK
(2544 rep)
Aug 7, 2024, 10:38 AM
1
votes
1
answers
318
views
Network Configuration - Hostapd Fails to Start - nl80211 Driver Initialization Failed
I would like to create a wireless network using my Banana Pi R3 router running Ubuntu 22.04 OS. This is the configuration file that I am using: userk@glutamate:~$ sudo cat /etc/hostapd/hostapd_wlan0_gemma.conf # hostapd configuration file interface=wlan0 driver=nl80211 ctrl_interface=/var/run/hostap...
I would like to create a wireless network using my Banana Pi R3 router running Ubuntu 22.04 OS.
This is the configuration file that I am using:
userk@glutamate:~$ sudo cat /etc/hostapd/hostapd_wlan0_gemma.conf
# hostapd configuration file
interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=GemmaNode
country_code=EU
channel=1
hw_mode=g
ht_capab=[LDPC][HT20][HT40-][HT40+][GF][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1]
ieee80211n=1
auth_algs=1
wmm_enabled=1
wpa=2
wpa_passphrase=mypassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
nas_identifier=glutamate-vlan500
However, when I run hostapd, I get the following error:
userk@glutamate:~$ sudo hostapd -d /etc/hostapd/hostapd_wlan0_gemma.conf
random: getrandom() support available
Configuration file: /etc/hostapd/hostapd_wlan0_gemma.conf
nl80211: TDLS supported
nl80211: TDLS external setup
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:10
nl80211: Supported cipher 00-0f-ac:8
nl80211: Supported cipher 00-0f-ac:9
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported cipher 00-0f-ac:13
nl80211: Supported cipher 00-0f-ac:11
nl80211: Supported cipher 00-0f-ac:12
nl80211: Using driver-based off-channel TX
nl80211: Driver-advertised extended capabilities (default) - hexdump(len=8): 00 00 40 00 00 00 00 40
nl80211: Driver-advertised extended capabilities mask (default) - hexdump(len=8): 00 00 40 00 00 00 00 40
nl80211: key_mgmt=0x1ff0f enc=0xfef auth=0x7 flags=0x4003d30db5bd8e0 rrm_flags=0x10 probe_resp_offloads=0x0 max_stations=0 max_remain_on_chan=5000 max_scan_ssids=4
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 11 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x5558515be0
nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0x5558515be0 match= multicast=0
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=176): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=11)
netlink: Operstate: ifindex=11 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211 driver initialization failed.
hostapd_interface_deinit_free(0x555850da00)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x555850da00)
wlan0: interface state UNINITIALIZED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: AP-DISABLED
hostapd_cleanup(hapd=0x555850f190 (wlan0))
wlan0: CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit
hostapd_interface_free(0x555850da00)
hostapd_interface_free: free hapd 0x555850f190
hostapd_cleanup_iface(0x555850da00)
hostapd_cleanup_iface_partial(0x555850da00)
hostapd_cleanup_iface: free iface=0x555850da00
**Additional Info**
Driver Compatibility: Confirmed that wlan0 supports AP mode.
**Question**
How can I resolve the nl80211: Could not configure driver mode error and successfully start hostapd on my Banana Pi R3 router?
UserK
(2544 rep)
Aug 6, 2024, 02:49 PM
• Last activity: Aug 6, 2024, 11:55 PM
1
votes
1
answers
97
views
What is the difference between `ssid` and `ssid2` in hostapd config file?
In a *hostapd* configuration file, sometimes I see the key `ssid` to specify the SSID, and sometimes I see the key `ssid2`. What is the difference between these? I'm having trouble finding documentation about `ssid2`.
In a *hostapd* configuration file, sometimes I see the key
ssid
to specify the SSID, and sometimes I see the key ssid2
. What is the difference between these? I'm having trouble finding documentation about ssid2
.
Jason C
(1585 rep)
Jul 19, 2024, 01:57 PM
• Last activity: Jul 19, 2024, 03:53 PM
1
votes
0
answers
43
views
Trouble Setting Access Point 2.4GHz Orange Pi Zero 2
I'm setting up a WiFi Access Point using bridge mode. I successfully configured the bridge mode and it's working. Then, I managed to set up the WiFi Access Point for 5GHz as well. But why did I fail when setting it up for 2.4 GHz? Trouble: 1. Visible after restart, then after 1-2 minuter, WiFi AP no...
I'm setting up a WiFi Access Point using bridge mode. I successfully configured the bridge mode and it's working. Then, I managed to set up the WiFi Access Point for 5GHz as well. But why did I fail when setting it up for 2.4 GHz?
Trouble:
1. Visible after restart, then after 1-2 minuter, WiFi AP not visible
2. After restart, i cant access my orange pi with ssh or VNC, but can access with HDMI
This my configuration:
sudo nano /etc/hostapd.conf
Script:
#
# orangepi hostapd configuration example
#
# nl80211 mode
#
ssid=HIBOBGATEWAY
interface=wlan0
hw_mode=g
channel=6 # Set to a common 2.4GHz channel (1-13)
bridge=br0
driver=nl80211
logger_syslog=0
logger_syslog_level=0
wmm_enabled=1
wpa=2
preamble=1
wpa_psk=66eb31d2b48d19ba216f2e50c6831ee11be98e2fa3a8075e30b866f4a5ccda27
wpa_passphrase=6666666666
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0
### IEEE 802.11n
ieee80211n=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
country_code=ID
ieee80211d=1
### IEEE 802.11n
### IEEE 802.11a
#hw_mode=a
### IEEE 802.11a
### IEEE 802.11ac
#ieee80211ac=1
#vht_capab=[MAX-MPDU-11454][SHORT-GI-80][TX-STBC-2BY1][RX-STBC-1][MAX-A-MPDU-LEN-EXP3]
#vht_oper_chwidth=1
#vht_oper_centr_freq_seg0_idx=42
### IEEE 802.11ac
# controlling enabled
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
For bridge setting:
sudo nano /etc/network/interfaces
Script
source /etc/network/interfaces.d/*
# Network is managed by Network manager
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
#wireless power off
auto br0
iface br0 inet static
address 192.168.6.57
netmask 255.255.255.0
gateway 192.168.6.254
bridge_ports eth0 wlan0
bridge_fd 0
bridge_stp off
Copy code
Can you help me?
Linux Kernel: Linux 4.9.170-sun50iw9
Distro: UBUNTU Bionic
Hardware: Orange-Pi Zero 2
EMAIL KERJA
(11 rep)
Jul 5, 2024, 02:14 AM
7
votes
2
answers
29249
views
Setting up hostapd with an iwlwifi device to run a hotspot
I am trying to configure my openSUSE 13.1 system to function as a hotspot (on my Dell XPS 13 computer). So I tried setting up hostapd as explained in [Set up a hotspot with Linux][1], but I get an error: hostapd /etc/hostapd.conf Configuration file: /etc/hostapd.conf nl80211: Fai...
I am trying to configure my openSUSE 13.1 system to function as a hotspot
(on my Dell XPS 13 computer).
So I tried setting up hostapd
as explained in Set up a hotspot with Linux , but I get an error:
hostapd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
nl80211: Failed to set interface wlp1s0 into AP mode
nl80211 driver initialization failed.
My hostapd.conf file:
#interface=wlan0
interface=wlp1s0
driver=nl80211
bridge=br0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
dump_file=/run/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
hw_mode=g
channel=3
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10
#
# Normal priority / AC_BE = best effort
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7
#
# High priority / AC_VI = video
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188
#
# Highest priority / AC_VO = voice
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102
# EAPOL-Key index workaround (set bit7) for WinXP Supplicant (needed only if
# only broadcast keys are used)
eapol_key_index_workaround=0
# authentication server.
eap_server=0
# The own IP address of the access point (used as NAS-IP-Address)
own_ip_addr=127.0.0.1
The problem might be with the driver. Perhaps I should indicate another one, since:
>> lspci -k | grep -A 3 -i "network"
01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)
Subsystem: Intel Corporation Centrino Advanced-N 6235 AGN
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
Some more netcard info:
>>hwinfo --netcard | grep -Ei "model|driver"
Model: "Intel WLAN controller"
Driver: "iwlwifi"
Driver Modules: "iwlwifi"
Driver Info #0:
Driver Status: iwlwifi is active
Driver Activation Cmd: "modprobe iwlwifi"
Model: "ASIX Electronics AX88x72A"
Driver: "asix"
Driver Modules: "asix"
Driver Info #0:
Driver Status: asix is active
Driver Activation Cmd: "modprobe asix"
>>modinfo iwlwifi | grep 'depend'
depends: cfg80211
--update: I checked that my card supports AP like this:
>>iw dev
phy#0
Interface wlp1s0
ifindex 2
wdev 0x1
addr c8:f7:33:da:ac:d7
type managed
>>iw phy#0 info
Wiphy phy0
Band 1:
Capabilities: 0x1072
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT TX/RX MCS rate indexes supported: 0-15, 32
Frequencies:
* 2412 MHz [1] (15.0 dBm)
* 2417 MHz (15.0 dBm)
* 2422 MHz (15.0 dBm)
* 2427 MHz (15.0 dBm)
* 2432 MHz (15.0 dBm)
* 2437 MHz (15.0 dBm)
* 2442 MHz (15.0 dBm)
* 2447 MHz (15.0 dBm)
* 2452 MHz (15.0 dBm)
* 2457 MHz (15.0 dBm)
* 2462 MHz (15.0 dBm)
* 2467 MHz (15.0 dBm) (passive scanning, no IBSS)
* 2472 MHz (15.0 dBm) (passive scanning, no IBSS)
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 11.0 Mbps (short preamble supported)
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Band 2:
Capabilities: 0x1072
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
No RX STBC
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT TX/RX MCS rate indexes supported: 0-15, 32
Frequencies:
* 5180 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5200 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5220 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5240 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5260 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5280 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5300 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5320 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5500 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5520 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5540 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5560 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5580 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5600 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5620 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5640 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5660 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5680 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5700 MHz (15.0 dBm) (passive scanning, no IBSS, radar detection)
* 5745 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5765 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5785 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5805 MHz (15.0 dBm) (passive scanning, no IBSS)
* 5825 MHz (15.0 dBm) (passive scanning, no IBSS)
Bitrates (non-HT):
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
max # scan SSIDs: 20
max scan IEs length: 195 bytes
Coverage class: 0 (up to 0m)
Supported Ciphers:
* WEP40 (00-0f-ac:1)
* WEP104 (00-0f-ac:5)
* TKIP (00-0f-ac:2)
* CCMP (00-0f-ac:4)
Available Antennas: TX 0 RX 0
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* monitor
software interface modes (can always be added):
* AP/VLAN
* monitor
valid interface combinations:
* #{ managed } /dev/null
systemctl start hostapd.service
systemctl start dnsmasq.service
My /etc/hostapd is:
interface=wlp1s0
driver=nl80211
# bridge=br0
channel=3
hw_mode=g
auth_algs=1
ssid=test
My phone sees the test network, but keeps saying "Obtaining IP address...."
dorien
(333 rep)
Apr 26, 2014, 11:57 AM
• Last activity: May 10, 2024, 07:51 PM
Showing page 1 of 20 total questions