WiFi on FreeBSD - this works for me

Back in FreeBSD 12 - the wpa_supplicant.conf method of configuring wifi worked for me. I had accumulated a set of wpa_supplicant.conf files - one for each location - that just works. I could log in, copy the file on top of wpa_supplicant.conf and run "service netif restart". Done. Once I had figured out the correct bits to put into the file, this just worked.

Since upgrading to FreeBSD 13 (now on 13.2), my wpa_supplicant.conf files no longer worked. This is what now works for me.

1. ifconfig wlan0 scan
2. pick out the channel, ssid, and bssid of the access point.
3. create a tiny Bourne shell script to configure wlan with the bits above.
4. run the script to connect.

I used to have ifconfig statements in /etc/rc.conf. Those are now commented out.

The tiny script looks something like this:

ifconfig wlan0 down ssid 'SSID' channel 6 bssid a5:a5:a5:a5:a5:a5 up
dhclient wlan0

I don't understand why my wpa_supplicant.conf files stopped working. I'm just glad I had an alternate means for wifi.
 
Instead of copying set files over (which probably have an outdated syntax or something), you could have a script which you run, specify as a parameter or derive somehow the location, and then execute a command, something like wpa_passphrase <ssid> <passphrase> >> /etc/wpa_supplicant/wpa_supplicant.conf ?
 
Roughly half the APs do not have a password so I'm not sure if the 'wpa_passphrase' is relevant.

Prior to resorting to one-line ifconfig scripts to connect - I saw two behaviors. One is the laptop refused to connect. The other is the laptop connected sequentially to several APs, pausing at each one for a few seconds, before landing on an AP that had a completely different SSID. Making the SSID and BSSID and channel explicit seems to fix that.
 
Back
Top