Contributed by rueda on from the puffy-on-the-go dept.
In a change which is bound to be welcomed widely, -current has gained "auto-join" for Wi-Fi networks. Peter Hessler (phessler@) has been working on this for quite some time and he wrote about it in his p2k18 hackathon report. He has committed the work from the g2k18 hackathon in Ljubljana:
CVSROOT: /cvs Module name: src Changes by: phessler@cvs.openbsd.org 2018/07/11 14:18:09 Modified files: sbin/ifconfig : ifconfig.8 ifconfig.c sys/net80211 : ieee80211_ioctl.c ieee80211_ioctl.h ieee80211_node.c ieee80211_node.h ieee80211_var.h Log message: Introduce 'auto-join' to the wifi 802.11 stack. This allows a system to remember which ESSIDs it wants to connect to, any relevant security configuration, and switch to it when the network we are currently connected to is no longer available.
Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions. example hostname.if: join home wpakey password join work wpakey mekmitasdigoat join open-lounge join cafe wpakey cafe2018 join "wepnetwork" nwkey "12345" dhcp inet6 autoconf up OK stsp@ reyk@ and enthusiasm from every hackroom I've been in for the last 3 years
The usage should be clear from the commit message, but basically you 'join' all the networks you want to auto-join as you would previously use 'nwid' to connect to one specific network. Then the kernel will join the network that's actually in range and do the rest automagically for you. When you move out of range of that network you lose connectivity until you come in range of the original (where things will continue to work as you've been used to) or one of the other networks (where you will associate and then get a new lease).
Thanks to Peter for working on this feature - something many a Wi-Fi using OpenBSD user will be able to benefit from.
(Comments are closed)
By rjc (rjc) on
Is there an easy way to have a number of Wi-Fi networks specified, like in the example, and add wpa_supplicant into the mix for eduroam - as in "all in a single hostname.if" file?
Comments
By phessler (phessler) spambox@theapt.org on http://www.openbsdfoundation.org/donations.html
Yes, you can add dot1x configurations to hostname.if, and auto-join will connect to them when they are available.
However, wpa_supplicant won't automatically connect to it. I've been told 'wpa_cli reassociate' will do the right thing, but I am not in a position to test that.
Making dot1x easier to deal with is on my TODO list for a project for the future.
Comments
By rjc (rjc) on
Thanks for a prompt reply Peter.
It would be great if there was something along the lines of:
join eduroam wpaakms 802.1x exec /path/to/script
or whatever work :^)
By brynet (Brynet) on https://brynet.biz.tm/
Nice work Peter! :-)
By Renaud Allard (renaud) renaud@allard.it on
Nice work.
If 2 listed networks are available, will it connect to the first listed one or randomly?
Comments
By phessler (phessler) spambox@theapt.org on http://www.openbsdfoundation.org/donations.html
It basically uses the Apple algorithm that is used on iPhones. As long the signal strength is good enough: Strongest security, then 5GHz, then 11n vs not-n, then pure signal strength.
You can also force it to choose a different one with "nwid foo". The auto-join algorithm will take the saved security settings for "foo" and apply them when it attempts to connect.
By anexit (anexit) bannereddivpool@gmail.com on
This will be so handy! Awesome work Peter.