Problems setting up Wi-Fi with Intel AX200 according to the Handbook chapter 33.3 / 33.4 in FreeBSD 13.2-RELEASE

Hello FreeBSD community,

I wanted to describe my situation because I'm not quite sure what I did exactly wrong, and I do think that, given the relatively typical circumstances, this might be a documentation issue with the manual, so I wanted to ask if there are other resources I could consider, or which path precisely I should take.

Premise / personal background (can be skipped if not interested):

First, a description of what I wanted to do and of my general experience (as I think is necessary): I wanted to give BSD a try after over two years on Linux distros (Debian, Fedora) and since FreeBSD actually has an nvidia-driver, I thought it would be a nice choice to test various WMs etc, since I like a more documented environment, and was bitten in the recent past by the undocumented aspects of linux below the surface (systemd especially, and unexplained config files..).

I am usually quite used to doing things in the terminal, and have no qualms about config files like fstab etc, however, only when everything is properly documented / explained, since I often seem to miss some steps; but for configuring applications like shells or text editors or Xorg etc. this worked out well enough. However, one thing I never really did in a terminal was network configuration. This is because the Linux distros typically install with a graphical environment, where I set up the network, and then can forget about it, but therefore I also never had the experience of knowing in which order what has to be set up. (Also, the one time I did try to do that, I had problems because of course systemd wouldn't play nice with dhcpcd, and the wlwifi driver also had an issue so I got kernel error messages.. that was over a year ago at an attempted Arch install, and turnt me away for quite some time from these sorts of things, but since the firmware works fine in the desktop modes, this is more based on user error than enything else.)

This is now quite exasturbated by my current living situation: I live, as a Uni studenf working from Home, with my dad, also in Home office, so we need closed doors, and there are no cables in the walls, so Wifi is my only option. (At least we now have a switch in the hallway, so it only has to pass through one door / brick wall, not two..). So because of this, I am dependent on Wifi working for updates and downloading applications, even though I use a PC mother board with readily available Ethernet - a circumstance which most tutorials are not written for (most are either for specific laptops etc, or assume Ethernet can in some capacity be used), hence me writing here. The main issue for me is namely, that unless my Wifi is set up, I can't update any packages, so if it doesn't work OOTB my OS is effectivel bricked (yes, I could put in sources/packages over a USB etc, but that seems like an absurd amount of effort, if it isn't very clear that that would be the only way).

SInce my first attempt of getting everything to work failed specteculary (with "wlan0 no port" messages etc.), but I didn't quite know what the problem was, I decided to read through the longer section of the handbook regarding wifi and document my every step, since this way, it becomes more obvious what I may have left out. This includes from the installer, so there should really be nothing you can't read from this that would affect the result.

Small note: I do have other installs on the PC, namely the old Linux install and an older Windows install; both have some data on them, and I don't want to delete them, so I made a smaller partition for the new system instead (56GB; not much, but enough for a BSD + Xorg+WM+Firefox for sure, and that's what I mostly use anyway, the other partitions have more documents etc.). However, this should not affect the installation, as I boot directly into FreeBSD and not through a Grub or anything else left, as FreeBSD is the last thing installed. (Also, yes, I have FastBoot disabled in the windows install, I know of that one, and had constant networking problems before I noticed, but that shoudn't affect it anymore, I double checked it yesterday too just to be sure, since I upgraded that partition to Win11 a few months ago for some testing.)


Description:

Hardware: I am running a Ryzen 5 3600 on a ASUS TUF Gaming B550-Plus (Wi-Fi) motherboard, with 32GB 3200Mhz Ram, an Intel 1TB Nvme (which is mostly full, hence the 56GB partition for now while im cleaning up old backups) and a GT 1030 graphics card (the only thing left in stock back in 2021...). More importantly, this means that I am reliant on a AX200 Intel Wifi 6 chip; there have been some reports that this chip was not supported at all (see https://forums.freebsd.org/threads/intel-ax200-support.84003/ from Feburary 2022), but there also are newer reports of this working (see https://forums.freebsd.org/threads/wi-fi-6-ax200-iwlwifi0-siocifcreate2-wlan0.88000/ from Frburary 2023), and the chip is also mentioned as "Intel(R) Wi-Fi 6 AX200 160MHz" in iwlwifi(), which matches the name of the Windows driver, so I assume the problem has been solved in the last year in FreeBSD 13.2-RELEASE. If I got anything of this wrong. and my attempts would be sort of pointless anyway, I would like to know; otherwise I assume this is probably my user error, and I would be interested if you have an idea where that would be.

Notes:

Installation:

1. I removed the partition again (again, this should not have been necessary, but since I didn't know what exactly went wrong I decided to delete the partition from another live disk where I had more graphical confirmation of that, to have the the 56GB as unallocated space

2. I booted up FreeBSD-13.2-RELEASE-amd64-dvd1.iso from my multi-boot-usb (Ventoy), and booted into Multi-User and selected the Installation option. I selected the following options:
a) de.kbd keymap to be able to correctly enter my password
b) hostname "pc-bsd" (since its the only BSD in the household)
c) besides the preselected "kernel-dbg" and "lib32", I also selected "ports","src" and "test", in case that could be useful
d) selected the partition option "Auto (UFS)" , the "nvd0" drive, the "partition" option, creating the partions nvd0p6 46GB freebsd-ufs for / and nvd0p7 2.2GB freebsd-swap, and selecting "Finish" and "Commit"
(during copying, I got an error message about my webcam / audio devices disconnecting, I don't know what that was about, I don't think it should mean something for networking though)
e) I selected to delete the old EFI entries for FreeBSD and to create a new one
f) changed root password
g) now it asked for network configuration. It showed the option "iwlwifi0 iwlwifi". However, under my correct configuration "ETSI"/"DE" for Germany, and also for other regdomains in Germany, it did not find any networks on multiple scans (at least 3 for each regdomain, all on code DE; while I'm online on my phone mind you, there is no network outage at that time). After that failure, I selected "Cancel"
h) Since I dont know my CMOS setup, I selected No for the the UTC-CMOS question as prompted
i) selected Europe, Germany, Timezone "most of Germany", as CEST, set date and time
j) stuck to default services and security options
k) created a user with default options with my name and password, and no other options
l) exited the installer, selected no additional modifications, and reboot
I then was able to log into the system as root (because I think network setup is a phase that requires a lot of root access, and I hadnt given myself access to the wheel group yet anyway)

3. After this, I followed the longer form guide in the FreeBSD handbook, chapter 33.3.3, since the shorter form didn't work for me last time. The commands were:

# cat /boot/loader.conf
the file was empty
# ee /boot/loader.conf
added the lines
Code:
if_iwlwifi_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

and saved with ESC-Enter-Enter
then
# reboot
and logging in again.

# cat /etc/rc.conf
showed that the line
Code:
create_args_wlan0="country DE regdomain ETSI
was already added, hence I left out the sysrc command.

# ifconfig

showed that only the loopback was configured, so I preceded as described in 33.3.4

# ifconfig wlan0 create wlandev iwlwifi0
which resulted in the error message
Code:
ifconfig: SIOCIFCREATE2 (wlan0): Device not configured
# ifconfig wlan0 up
didn't work since wlan0 didn't exist, which is confirmed on
# ifconfig.

I then had another look at iwlwifi(). However, it stated that it would autoload on boot, and I just rebooted.

After that, I shut down the machine ( # poweroff).


So my question now is: what am I supposed to do in this situation? Is this really a driver issue, or, as I suppose, a comfiguration issue, and if so, which configuration files / utilities would I have to touch?


With regards,
Hypatia of Sva.
 
Can you post the entry of the card from pciconf -lv. It's possible it's some variant of the chipset that isn't recognized by the driver. But we need to know the vendor and device IDs to check this.
 
The entry in pciconf -lv is
Code:
iwlwifi0@pci0:5:0:0:     class=0x028000 rev=0x1a hdr=0x00 vendor=0x8086 device=0x2723 subvendor=0x8086 subdevice=0x0084
        vendor = 'Intel Corporation'
        device = 'Wi-Fi 6 AX200'
        class   = network

(Edit: sorry, didnt post it as a reply, dont know if it can be moved to be that)
 
# ee /boot/loader.conf
added the lines
Code:
if_iwlwifi_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
The handbook is often not up to date, remove all what is related to the wifi driver (all what you added) from /boot/loader.conf and reboot system.

iwlwifi(4)
Rich (BB code):
SYNOPSIS
 
     The driver    will auto-load without any user    interaction using devmatch(8)
     if    enabled    in rc.conf(5).

     Only if auto-loading is explicitly    disabled, place    the following lines in
     rc.conf(5)    to manually load the driver as a module    at boot    time:

       kld_list="${kld_list} if_iwlwifi"

     The driver    should automatically load any iwlwififw(4) firmware needed for
     the particular chipset.

     It    is discouraged to load the driver from loader(8).

devmatch(8) is enabled in /etc/defaults/rc.conf
Code:
devmatch_enable="YES"    # Demand load kernel modules based on device ids.

Check if wlan device is listed: sysctl net.wlan.devices
 
The handbook is often not up to date, remove all what is related to the wifi driver (all what you added) from /boot/loader.conf and reboot system.

iwlwifi(4)
Rich (BB code):
SYNOPSIS
 
     The driver    will auto-load without any user    interaction using devmatch(8)
     if    enabled    in rc.conf(5).

     Only if auto-loading is explicitly    disabled, place    the following lines in
     rc.conf(5)    to manually load the driver as a module    at boot    time:

       kld_list="${kld_list} if_iwlwifi"

     The driver    should automatically load any iwlwififw(4) firmware needed for
     the particular chipset.

     It    is discouraged to load the driver from loader(8).

devmatch(8) is enabled in /etc/defaults/rc.conf
Code:
devmatch_enable="YES"    # Demand load kernel modules based on device ids.

Check if wlan device is listed: sysctl net.wlan.devices
I actually got it to work now, thanks! I leave this protocol (that I also wrote for myself in case I have to repeat it) because it has at least one important implication:

I emptied /boot/loader.conf again (given that it was empty before) with ee and rebooted. Then I ran the commands:

# sysctl net.wlan.devices gave the result
Code:
net.wlan.devices: iwlwifi0
, so I guess it is listed now. So I continue with handbook chapter 33.3.4:

# ifconfig wlan0 create wlandev iwlwifi0
# ifconfig wlan0 up
# ifconfig wlan0 scan

works and gives a list of networks now.

According to the handbooks WPA section, I now have to add to /etc/rc.conf; I added the lines
Code:
wlans_iwlwifi0="wlan0"
ifconfig_wlan0="WPA DHCP"

and in /etc/wpa_supplicant.conf I added the lines
Code:
network={
  ssid="SSID"
  psk="PASS"
}
(with SSID and PASS being substitued accordingly)

then I ran # service netif start

However, I got error massages, too much to type, but including this:
Code:
WARNING !mvmvif->phx_ctxt failed at /usr/src/sys/contrib/dev/iwlwifi/mvm/mac80211.c:3158
iwlwifi0: Scan failed! ret -5
iwlwifi0: ERROR lkpi_ic_scan_start: hw_scan returned -5
and then the last two lines repeat indefinetely.
So, for some reason adding "WPA DHCP" or starting the service made it unable to scan, even though it was able to scan before...



I backed off and went back to add the lines for WEP, CCMP and TKIP back to the loader.conf, and rebooted, since I thought this might have been part of the problem.
It took very long to boot, it was stuck in sendmail_submit and sendmail_msp_queue for many seconds for some reason, witht he error massage
Code:
unable to qualify my own domain name (pc-bsd)
. However, now the Wi-Fi works as expected!

In summary: There needs to be a notice somewhere, that for iwlwifi, while in loader.conf nothing has to be there, you still have to have the wep, ccmp and tkip entries. This should probably go in the Handbook, and until then maybe as a Usage warning in iwlwifi()?

Also, is this sendmail warning important, or something I can ignore?


With regards,
Hypatia of Sva.
 
it took very long to boot, it was stuck in sendmail_submit and sendmail_msp_queue for many seconds for some reason, witht he error massage
Code:
unable to qualify my own domain name (pc-bsd)
grep(1)ing through the 13.2-RELEASE source code that warning line pops up in two files:
Code:
/usr/src-13.2/contrib/sendmail/README
   345: about ``unable to qualify my own domain name (mastodon) -- using

/usr/src-13.2/contrib/sendmail/src/daemon.c
  3473:                                   "unable to qualify my own domain name (%s) -- using short name",
  3475:                         message("WARNING: unable to qualify my own domain name (%s) -- using short name",

/usr/src-13.2/contrib/sendmail/README
Rich (BB code):
+--------------------+
| HOST NAME SERVICES |
+--------------------+

If you are using NIS or /etc/hosts, it is critical that you
list the long (fully qualified) name somewhere (preferably first) in
the /etc/hosts file used to build the NIS database.  For example, the
line should read

        128.32.149.68   mastodon.CS.Berkeley.EDU mastodon

**** NOT ****

        128.32.149.68   mastodon

If you do not include the long name, sendmail will complain loudly
about ``unable to qualify my own domain name (mastodon) -- using
short name'' and conclude that your canonical name is the short
version and use that in messages.  The name "mastodon" doesn't mean
much outside of Berkeley, and so this creates incorrect and unreplyable
messages.
 
grep(1)ing through the 13.2-RELEASE source code that warning line pops up in two files:
Code:
/usr/src-13.2/contrib/sendmail/README
   345: about ``unable to qualify my own domain name (mastodon) -- using

/usr/src-13.2/contrib/sendmail/src/daemon.c
  3473:                                   "unable to qualify my own domain name (%s) -- using short name",
  3475:                         message("WARNING: unable to qualify my own domain name (%s) -- using short name",

/usr/src-13.2/contrib/sendmail/README
Rich (BB code):
+--------------------+
| HOST NAME SERVICES |
+--------------------+

If you are using NIS or /etc/hosts, it is critical that you
list the long (fully qualified) name somewhere (preferably first) in
the /etc/hosts file used to build the NIS database.  For example, the
line should read

        128.32.149.68   mastodon.CS.Berkeley.EDU mastodon

**** NOT ****

        128.32.149.68   mastodon

If you do not include the long name, sendmail will complain loudly
about ``unable to qualify my own domain name (mastodon) -- using
short name'' and conclude that your canonical name is the short
version and use that in messages.  The name "mastodon" doesn't mean
much outside of Berkeley, and so this creates incorrect and unreplyable
messages.
The strange Thing is that I didn't set up either of it. My /etc/hosts only has the example lines for
Code:
localhost localhost.my.domain
, and /etc/nsswitch.conf is also basically empty. So I don't even know where my PC hostname (pc-bsd) is supplied from. This is definetely annoying, since I can't suspend / resume and that means I have to wait for a minute each time, and might have been a dealbreaker for daily usage when I would have to rely on it in certain situations.

My current fix for this is to just disable sendmail on boot (fix from here https://forums.freebsd.org/threads/disable-sendmail-on-boot.1804/ ), this might not be the cleanest solution but at least allows me to use the system normally
 
Back
Top