Help troubleshooting wireless network (no connection)

Hi folks!
I was hoping to get some help troubleshooting my wireless configuration as I am not able to connect to my home network. I'm confident my wireless hardware and the driver are working properly as I'm able to connect to a mobile hotspot but this is slow and pricey, so I can't rely on it for day-to-day needs. I'm almost certain the issue is either with my /etc/wpa_supplicant.conf config or a mis-configuration on my wireless access point. I also don't think the issue is signal strength; I'm testing from about 50 feet away from the access point with only one wall between us. Other wireless devices have excellent signal strength in this same spot.

Hardware details:
I'm running FreeBSD 14.3-RELEASE on a Dell XPS 13 7390 (not the 2-in-1 model); it has a Killer(R) Wi-Fi 6 AX1650w 160MHz Wireless Network Adapter (200D2W) which is supported by iwlwifi(4). My home network has both 2.4GHz and 5GHz bands. The 2.4GHz radio supports 802.11ax/b/g/n and the 5GHz radio supports 802.11ac/ax/n. The network is secured with mixed WPA2/WPA3 PSK, SAE (CCMP) encryption. As far as I can tell, iwlwifi(4) should be able to connect, but for some reason cannot. The mobile hotspot I can connect to doesn't give me as much information, but I know it is also a mixed WPA2/WPA3 network.

Here are the relevant sections of my /etc/rc.conf:
Code:
wlans_iwlwifi0="wlan0"
ifconfig_wlan0="WPA DHCP" # I've also tried SYNCDHCP with no effect; I also don't understand the distinction

# I saw another forum post that suggested these settings resolved their issue, but for me there was no effect
# defaultrouter="192.168.1.1"
# defaultroute_delay="0"

# In the same vein, I saw someone suggest these settings, but I don't think my issue is with dhclient
# and these options had no effect
# background_dhclient="YES"
# synchronous_dhclient="YES"

I don't have links handy, but I recall seeing a couple forum posts recommending adding a couple settings to /boot/loader.conf:
Rich (BB code):
# If I understand wlan_ccmp(4) and wlan_tkip(4) correctly, these options shouldn't be required
# Regardless, there's no change in behavior if these options are present or absent
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

Finally, here's my /etc/wpa_supplicant.conf:
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2 # I tried setting to 1, but no change in behavior
ap_scan=1
fast_reauth=1
country=US

# Home network (5GHz band)
network={
    ssid="My SSID"
    bssid=DE:AD:BE:EF:01
    scan_ssid=1
    psk="my psk" # I also tried the psk generated with wpa_passphrase, no change in behavior
    priority=10
    proto=RSN
    # I've also tried setting these, but no change in behavior
    # key_mgmt=WPA-PSK
    # group=CCMP
    # pairwise=CCMP
}

# Home network (2.4GHz band)
network={
    ssid="My SSID" # The SSID for the two bands is the same; this isn't an issue for my other wireless clients
    bssid=DE:AD:BE:EF:02 # The radios have separate BSSIDs; no change in behavior with/without this option
    scan_ssid=1
    psk="my psk" # Like the SSID, the two bands use the same PSK
    priority=8 # My thought being the 5GHz band would be preferred and this could be a fallback; not sure if that's how this actually works
    proto=RSN
    # I've also tried setting these, but no change in behavior
    # key_mgmt=WPA-PSK
    # group=CCMP
    # pairwise=CCMP
}

# Mobile hotspot -- this one works
network={
    ssid="My Mobile SSID"
    scan_ssid=1
    psk="my mobile psk"
    priority=2 # My thought being this network will only be selected if neither of the previous two are available
    proto=RSN
}

While the mobile hotspot is turned off, running # service netif restart shows:
Code:
# -- snip -- #
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=0
    ether de:ad:be:ef:03
    groups: wlan
    ssid "" channel 1 (2412 MHz 11g)
    regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
    scanvalid 60 protmode CTS wme
    parent interface: iwlwifi0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

By contrast, when I enable my mobile hotspot I see the following after # service netif restart:
Code:
# -- snip -- #
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=0
    ether de:ad:be:ef:03
    groups: wlan
    ssid "My Mobile SSID" channel 11 (2462 MHz 11g) bssid de:ad:be:ef:04
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS wme roaming MANUAL
    media: IEEE Wireless Ethernet OFDM/36Mbps mode 11g
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Thanks in advance for any pointers/tips/tricks/suggestions folks have for diagnosing & resolving the issue!
 
Maybe we can step back for a second. At what point of your attempt to connect is there an error, and what are the details of the error?
 
Maybe we can step back for a second. At what point of your attempt to connect is there an error, and what are the details of the error?
When I run # service netif start or # service netif restart, it seems to me that the wlan0 interface is created properly, wpa_supplicant(8) is started without issue, but dhclient(8) doesn't come up after some time because the NIC is never able to associate with my wireless access point.

Here's what I'm seeing:
Code:
root@granary:~ # service netif start
Created wlan(4) interfaces: wlan0
Starting wpa_supplicant.
Sep  4 23:53:47 granary wpa_supplicant[57134]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
Starting dhclient.
wlan0: no link .............. giving up
/etc/rc.d/dhclient: WARNING: failed to start dhclient
Starting Network: lo0 wlan0.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmasx 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=0
        ether de:ad:be:ef:03
        groups: wlan
        ssid "" channel 1 (2412 MHz 11g)
        regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
        scanvalid 60 protmode CTS wme
        parent interface: iwlwifi0
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

I believe that ioctl[SIOCS80211 ...] error can be safely ignored, if I'm reading Thread 90352 and PR 283142 correctly.
 
Edit: I mis-read. Just a basic /etc/wpa_supplicant.conf file.

Code:
network={
ssid="nobodyownnnetwork"
proto=RSN
key_mgmt=WPA-EAP
eap=TLS
identity="loader"
ca_cert="/etc/certs/cacert.pem"
private:key="/etc/certs/clientkey.pem"
private:key_passwd="verysceredpassword"
}
 
I tried manually configuring things with wpa_cli(8) and got some interesting results.
Namely, it seems that my network isn't showing up in a scan:
Code:
% ifconfig wlan0 create wlandev iwlwifi0
% wpa_supplicant -B -c /etc/wpa_supplicant.conf -iwlan0
% wpa_cli
# -- snip -- #
> add_network
0
<3>CTRL-EVENT-NETWORK-ADDED 0
> set_network 0 ssid "My SSID"
OK
> set_network 0 scan_ssid 1
OK
> set_network 0 proto WPA2
OK
> set_network 0 psk "My PSK"
OK
> enable_network 0
OK
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND

With that error message, I was able to find Thread 71412 which suggests that there's some sort of issue connecting to OpenWrt routers (which is the router firmware I'm using). Unfortunately the thread doesn't say what the issue is, but hopefully I can dig that up soon.

If I use a Linux live CD, I can connect to the network just fine; I was also able to connect using the Windows 10 installation that was previously installed, so I'm pretty certain at this point whatever the unnamed issue with OpenWrt router firmwares is is the source of my problem.
 
Could you try this for both 2.4 and 5 GHz channels that the AP uses for My SSID:

ifconfig wlan0 destroy
ifconfig wlan0 create wlandev iwlwifi0 wlanmode monitor channel <channel for My SSID>
ifconfig wlan0 up
tcpdump -ni wlan0 -y IEEE802_11_RADIO -v -l -w monitor.pcap


Do any packets get captured?
You can view them by opening monitor.pcap with wireshark or tshark (comes with wireshark).
 
Could you try this for both 2.4 and 5 GHz channels that the AP uses for My SSID:

ifconfig wlan0 destroy
ifconfig wlan0 create wlandev iwlwifi0 wlanmode monitor channel <channel for My SSID>
ifconfig wlan0 up
tcpdump -ni wlan0 -y IEEE802_11_RADIO -v -l -w monitor.pcap


Do any packets get captured?
You can view them by opening monitor.pcap with wireshark or tshark (comes with wireshark).
It seems as though this driver may not support monitor mode:
Code:
% ifconfig wlan0 create wlandev iwlwifi0 wlanmode monitor channel 1
% ifconfig wlan0 up
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
% ifconfig
# shows the same output as I've documented earlier, wlan0 does show UP
% tcpdump -ni wlan0 -y IEEE802_11_RADIO -v -l -w monitor.pcap
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
tcpdump: data link type IEEE802_11_RADIO
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
tcpdump: listening on wlan0, link-type IEEE802_11_RADIO (802.11 plus radiotap header), snapshot length 262144 bytes
Got 0
^C0 packets captured
0 packets received by filter
0 packets dropped by kernel
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
iwlwifi0: lkpi_iv_newstate: only station mode currently supported: cap 0xfffffe00c63ca010 iv_opmode 5
% wc -l monitor.pcap
0
% tshark -r monitor.pcap
%

Edit: I did also try this on the 5GHz band (channel 36) and got the same results.
 
When I run # service netif start or # service netif restart, it seems to me that the wlan0 interface is created properly, wpa_supplicant(8) is started without issue, but dhclient(8) doesn't come up after some time because the NIC is never able to associate with my wireless access point.
DHCP isn't done through netif. service dhclient restart wlan0

The difference between DHCP and SYNCDHCP is that the later will wait until it receives a response (or the request times out) before continuing the boot process.
 
wlan0: no link .............. giving up

wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=0 ether de:ad:be:ef:03 groups: wlan ssid "" channel 1 (2412 MHz 11g) regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7 scanvalid 60 protmode CTS wme parent interface: iwlwifi0 media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) status: no carrier nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Do these two items imply the while wlan0 may be up it does not have a link (apologies on the formatting in the second quote, it's the output of ifconfig)?

If wlan0 never has link/associates dhclient is never going to complete, no?
Maybe a closer look at physical layer, wpa_supplicant et al?
 
Do these two items imply the while wlan0 may be up it does not have a link (apologies on the formatting in the second quote, it's the output of ifconfig)?

If wlan0 never has link/associates dhclient is never going to complete, no?
Maybe a closer look at physical layer, wpa_supplicant et al?
Yes, as you say wlan0 is up but does not have a link.

It only exhibits this behavior on my home network (a WPA2/WPA3 mixed-mode network from a router with OpenWrt firmware).
When I use a mobile hotspot (also a WPA2/WPA3 mixed-mode network, from my smartphone over my cellular service) it connects just fine. I've triple-checked the SSID and PSK, so I'm confident they're correct.

Starting from a clean slate, here's how I create the wlan0 interface and set it to UP:
Code:
root@granary:~ # ifconfig
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@granary:~ # ifconfig wlan0 create wlandev iwlwifi0
root@granary:~ # ifconfig
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=0
    ether de:ad:be:ef:03
    groups: wlan
    ssid "" channel 6 (2437 MHz 11g ht/40+)
    regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
    scanvalid 60 protmode CTS -ampdutx ampdurx ampdulimit 8k
    -amsdutx amsdurx shortgi -ldpctx ldpcrx -uapsd wme bintval 0
    parent interface: iwlwifi0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
root@granary:~ # ifconfig wlan0 up
root@granary:~ # ifconfig
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=0
    ether de:ad:be:ef:03
    groups: wlan
    ssid "" channel 1 (2412 MHz 11g)
    regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7
    scanvalid 60 protmode CTS wme bintval 0
    parent interface: iwlwifi0
    media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Now, here's how I manually try to connect to my network. I have a minimal /etc/wpa_supplicant.conf so only what I configure with wpa_cli(8) is affecting things:
Code:
root@granary:~ # cat /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1
country=US

root@granary:~ # wpa_supplicant -B -c /etc/wpa_supplicant.conf -iwlan0
Successfully initialized wpa_supplicant
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument # I've discussed this earlier in this thread; I think this is safe to ignore
ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Invalid argument
root@granary:~ # wpa_cli
wpa_cli v2.11
Copyright (c) 2004-2024, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'wlan0'

Interactive mode

> add_network
0
> set_network 0 ssid "My SSID"
OK
> set_network 0 scan_ssid 1
OK
> set_network 0 proto WPA2
OK
> set_network 0 psk "My PSK"
OK
> enable_network 0
OK
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-NETWORK-NOT-FOUND
> disable_network 0
OK
This is the behavior I always see. I've discussed various options I've tried in /etc/wpa_supplicant.conf, /etc/rc.conf, and even /boot/loader.conf elsewhere in this thread.

Here, I demonstrate that with the exact same setup I can connect to my mobile hotspot. This network has always worked. Not sure why this works but my actual home network doesn't.
Code:
> add_network
1
<3>CTRL-EVENT-NETWORK-ADDED 1
> set_network 1 ssid "My Mobile SSID"
OK
> set_network 1 scan_ssid 1
OK
> set_network 1 proto WPA2
OK
> set_network 1 psk "My Mobile PSK"
OK
> enable_network 1
OK
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>Trying to associate with de:ad:be:ef:04 (SSID='My Mobile SSID' freq=2437 MHz)
<3>Associated with de:ad:be:ef:04
<3>WPA: Key negotiation completed with de:ad:be:ef:04 [PTK=CCMP GTK=CCMP]
<3>CTRL-EVENT-CONNECTED - Connection to de:ad:be:ef:04 completed [id=1 id_str=]
>^D
root@granary:~ # ifconfig
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=0
    ether de:ad:be:ef:03
    inet 10.26.48.195 netmask 0xffffff00 broadcast 10.26.48.255
    groups: wlan
    ssid "My Mobile SSID" channel 6 (2437 MHz 11g ht/20) bssid de:ad:be:ef:04
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS -ampdutx ampdurx ampdulimit 64k ampdudensity 2
    -amsdutx amsdurx shortgi -ldpctx ldpcrx -uapsd wme roaming MANUAL
    parent interface: iwlwifi0
    media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
    status: associated
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
root@granary:~ # ping -c3 freebsd.org
PING freebsd.org (96.47.72.84): 56 data bytes
64 bytes from 96.47.72.84: icmp_seq=0 ttl=48 time=115.815 ms
64 bytes from 96.47.72.84: icmp_seq=1 ttl=48 time=103.811 ms
64 bytes from 96.47.72.84: icmp_seq=2 ttl=48 time=121.889 ms

--- freebsd.org ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 103.811/113.838/121.889/7.512 ms
root@granary:~ # ^D
 
  • Like
Reactions: mer
It only exhibits this behavior on my home network (a WPA2/WPA3 mixed-mode network from a router with OpenWrt firmware).
When I use a mobile hotspot (also a WPA2/WPA3 mixed-mode network, from my smartphone over my cellular service) it connects just fine. I've triple-checked the SSID and PSK, so I'm confident they're correct.
So something is wrong with the setup of your wifi router.
Nothing is wrong with the setup of you wlan0 interface on FreeBSD (unless ssid or PSK is incorrect).
 
So something is wrong with the setup of your wifi router.
Nothing is wrong with the setup of you wlan0 interface on FreeBSD (unless ssid or PSK is incorrect).
That does appear to be the case.
It's really strange because Windows, Linux, iOS, and Android devices can all connect to it just fine.
FreeBSD doesn't like something about my wireless configuration but I can't tell what.

Reading Thread 71412 it seems as though this might be something that's known?
I haven't been able to dig up any further details on the forums, though.
 
Back
Top