Solved WiFi puzzle

The tl;dr version: For a specific WiFi AP, I can connect directly from the command line but not via wpa_supplicant.conf. That's the puzzle, why won't wpa_supplicant.conf work?

The full version:

This particular AP does not require a passphrase.

Here's the two commands to connect to the WiFi.

ifconfig wlan0 down ssid 'BRpublic' channel 1 bssid f8:d9:b8:2a:a0:88 up
dhclient wlan0


For this to work, I have to comment this line in rc.conf:

#ifconfig_wlan0="WPA DHCP"

As said, above works. Here's proof:

Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=0
        ether 58:91:cf:7d:1c:7a
        inet 10.228.183.130 netmask 0xfffffc00 broadcast 10.228.183.255
        groups: wlan
        ssid BRpublic channel 1 (2412 MHz 11g) bssid f8:d9:b8:2a:a0:88
        regdomain FCC country US authmode OPEN privacy OFF txpower 30
        bmiss 10 scanvalid 60 protmode CTS wme
        parent interface: iwm0
        media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11g
        status: associated
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Here are two wpa_supplicant.conf files that I tried:

Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
        ssid="BRpublic"
}

... and also ...

Code:
network={
        ssid="BRpublic"
}

I'd prefer to use wpa_supplicant.conf here but don't see how.

Question: what is missing from wpa_supplicant.conf to make it work with this AP?

Bonus question: is there a way to specify a psk through the ifconfig command?
 
uname -a, please.

What's the underlying hardware?

Can you post wpa_supplicant messages and any other relevant messages from /var/log/messages, please?

Probably best to open a PR.
 
Thanks cy. I can gathering logs tonight after work.

uname -a:
FreeBSD thinkpad 14.0-RELEASE FreeBSD 14.0-RELEASE #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

This is a Haswell i5 Thinkpad T440p with 8GB.

/boot/loader.conf:
if_iwm_load="YES"
iwm7260fw_load="YES"
 
"man wpa_supplicant.conf". Look at the examples at the bottom of "/usr/share/examples/wpa_supplicant.conf".
 
From the wpa_supplicant.conf manpage (note the default):
Code:
     key_mgmt
             List of acceptable key management protocols; one or more of:
             WPA-PSK (WPA pre-shared key), WPA-EAP (WPA using EAP
             authentication), IEEE8021X (IEEE 802.1x using EAP authentication
             and, optionally, dynamically generated WEP keys), NONE (plaintext
             or static WEP keys).  If not set this defaults to "WPA-PSK
             WPA-EAP".

[edit:] Unfortunately, as things get more complicated, one needs to read available documentation *more* carefully. This is why I ask people to read manpages! Why one needs to pay attention to details.
 
if it's public with nothing wpa related, you shouldn't need a supplicant,
Code:
ifconfig_wlan0="ssid BRpublic DHCP"
in your rc.conf


never mind i misread your original post as *not* wanting to use wpa_supplicant.
 
WPA requires some supplicant since it isn't built into the kernel, and as far as I know the default wpa_supplicant does not provide command line arguments that allow for passing the psk through rc.conf (see the man page for wpa_supplicant, you can provide flags in rc.conf through the wpa_supplicant_flags variable)
 
Back
Top