airport icon indicating copy to clipboard operation
airport copied to clipboard

Some notes on configuring the airport directly via hostap

Open krackers opened this issue 2 years ago • 1 comments

Since I didn't find anything online about this, I thought I'd leave some quick notes on how to do this. (It wasn't obvious to me at first, although it's possible that this is common sense for those with bsd networking experience)

  • ifconfig works as you'd expect. Be aware that ifconfig has some AP specific suboptions that you may not have used before, e.g. ifconfig wlan0 list sta

  • The airports use hostapd to handle the access points creation. At boot there's an rc script that starts hostapd (see the invocation in ps auxww). The corresponding files are in /etc/, e.g. hostap_wlan1.conf.

  • Let's say you want to change the ssid currently broadcast on wlan2. You'd do ifconfig wlan2 down followed by killing the corresponding hostapd process (check output of ps). Then change the ssid in hostap_wlan2.conf (since there's no vi, you can use sed to rewrite). Update the wpa psk in hostap_wlan2.wpa_psk as well (same as you would for wpa supplicant). Then relaunch hostap with the same invocation you saw before (add a nohup so it's not killed when you logout), and your changes should be live.

  • The specific version of hostapd used seems to be non-standard since I couldn't find the specific config options documented anywhere, but most should be self explanatory. You can download and disassemble the hostapd binary to see a list of all possible config options.

krackers avatar Apr 27 '22 06:04 krackers

Actually seems like any modifications made to hostap conf are somehow undone in a few hours even without a reboot. Looks like something is restoring the original hostap config, and as a consequence ifconfig shows the old (manually configured) ssid no longer having access to the underlying hardware (which has been reclaimed by hostap).

I couldn't find any cron job that controls this, nor could I find how hostapd launch in an y of the rc files. So I assume it ends up being launched by one of the commands in crunchprog, maybe ACPd?

Also of note is that the airport also has standard broadcom wl so you can control the radios at a lower level.

krackers avatar Apr 27 '22 23:04 krackers