OpenWrt Forum Archive

Topic: hostapd_utils documentation?

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

As far as I understand the man pages, the implementation of hostapd_cli can be differerent form OS to OS.

see e.g.
manpages of netbsd -> netbsd.gw.com/cgi-bin/man-cgi?hostapd+8+NetBSD-current
or manpages of Debian -> manpages.debian.org/jessie/hostapd/hostapd_cli.1.en.html

Hence, in Debian based Linux I can do something like that:

 hostapd_cli -p /var/run/hostapd -i [Interface] -a /path/to/script -B 

which will send hostapd messages to a script for further processing.

It seems that I do not have these options e.g. in netBSD.

Where can I find information, which options are supported by hostapd_cli in hostapd_utils in the OpenWrt version?

How could I have the same fuctionality like under Debian also in OpenWrt, i.e. how can I send information sent/received by hostapd to an external script?

Thanks a lot for your support.

It seems that the "control socket" feature of hostapd never became very well debugged or useful or documented.  Reviewing the source code is probably the only way to know what it can do or attempts to do.

OpenWrt has added a ubus extension to hostapd for run-time interaction.  I would suggest that instead.  It is reasonably easy to extend it to meet your needs.   See my "drop on low signal" project:  https://github.com/mk248/lede-modhostapd

What specifically are you trying to do?

(Last edited by mk24 on 3 Oct 2017, 16:14)

Thanks a lot for your reply. I will have a look at your project. Seems I have to read a lot more about OWRT to fully understand it.

Actually I want to control the assignment of IP-addresses to users, a user should always receive the same IP address irrespective of the MAC address of the device he uses.

My basic plan is to use WPA2/EAP
- make hostapd to hand over username and MAC address to a script
- make hostapad to hand over the VLANID for this user received from a radius server
- derive an IP address from the VLANID, e.g. VLANID = XX -> IP address = 192.168.77.XX §
- assign this IP address to the device

I thought I could do steps 1 and 2 with a hostapd_cli call like that shown in the Debian example

§ see: wiki.opnsense.org/manual/how-tos/accounting.html
Sorry, it seems I can not post real links here, otherwise I could send information about the respective steps more easily ...

The discussion might have continued from here.