Jay's blog

How I Fixed Slow Wifi In Debian 12

Last time I blogged about my home server's wifi connection, I had to disable power management on the wifi adapter to avoid undesirable behavior.

This time, I was transferring a large quantity of large files from my laptop to my home server, and I noticed the transfer speed was capped at around 3 MB/s. I found that very concerning because although wifi isn't the fastest way to transfer data by a wide margin, it should still be faster than that.

After a bunch of inspection of various settings using iw list and iwlist wlp1s0, I discovered the problem. By looking at frequency and channel settings, I saw that my adapter was connecting to my router at 2.4 Ghz frequencies instead of the 5 GHz frequencies I wanted.

A bunch of googling suggested passing a freq_list property to wpa_supplicant in its config file. One problem: I'm not configuring wpa_supplication via a config file. I'm configuring it via my /etc/network/interfaces file. I was already using the wpa-ssid and wpa-psk options. Is there an equivalent option to pass in a frequency list?

Yes, but it's not very well-documented. The magic happens in the /etc/wpa_supplicant/functions.sh file. The appropriate option is wpa-freq-list.

Here's what my /etc/network/interfaces file looks like:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug wlp1s0
iface wlp1s0 inet dhcp
	wpa-ssid <ssid>
	wpa-psk <passphrase>
	wpa-freq-list <frequency list>

Using the iw list command, I was able to determine that the right list of frequencies for my hardware and desired configuration is the following:

wpa-freq-list 5180 5200 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700 5720 5745 5765 5785 5805 5825

I encourage you to check your own hardware rather than copying my list of frequencies verbatim.

After I made this change and restarted the network subsystem, transfers looked much better at around 20 MB/s to 25 MB/s on average.


November 1, 2025 Update

I replaced the old Intel 8265 wifi card in my home server machine with a new Intel BE200 Wifi 7 card. I also recently upgraded to Debian 13. I found that my new BE200 card was only connecting to 2.6 GHz wifi.

The first issue was that my regulatory domain wasn't set. When no regulatory domain is set, the allowed frequencies are very conservative, restricted to only 2.6 GHz in my case. The standard advice is to use iw set reg US (substitute your actual regulatory domain).

Hot tip: iw isn't installed by default anymore. After you install it, iw still won't be in your path. Call it at /usr/sbin/iw.

The problem with iw set reg US is that it doesn't persist beyond reboots. To do that, make sure the wireless-regdb package is installed and then add this file to /etc/modprobe.d/ieee80211_regdom.conf:

options cfg80211 ieee80211_regdom=US

Then reboot. The regulatory domain will be set on boot from now on.

I still had to use the wpa-freq-list trick I described in the original post (below) to restrict wpasupplicant to only scanning frequencies 5180 5220 5745 5805. Those are the 5 GHz 40 MHz channels that don't share frequencies with radar systems.

Unfortunately, I can't connect to 6 GHz frequencies yet. It appears my current combination of regulatory domain and driver stack results in the 6 GHz frequencies being flagged as "no IR" (no initiating radiation), making those channels useless. I'm eagerly awaiting driver updates to enable this new band. FWIW, this also affects my Framework 13 laptop running Pop!_OS, which uses the same wireless card. 🤷

I'm now averaging around 28 MB/s transfer speeds.

#home server #linux