From lsusb to Monitor Mode: Setting Up the Alfa AWUS036ACH on Arch Linux
Last updated on

From lsusb to Monitor Mode: Setting Up the Alfa AWUS036ACH on Arch Linux


I wanted the Alfa AWUS036ACH working on my Arch laptop for monitor mode and packet injection. The adapter uses the Realtek RTL8812AU chipset (USB ID 0bda:8812), and it mostly “just works” on a current kernel — but it disconnected the instant it was detected, and getting it stable meant understanding one specific quirk of how the driver negotiates USB 3. This post is the whole path, from looking at the hardware to the final NetworkManager config, with the commands I actually ran.

Authorized use only. Monitor mode and injection are for networks you own or are explicitly authorized to test. Capturing or injecting frames on networks you do not have permission to touch is illegal in most places. Everything below was done against my own equipment.

Contents

1. Survey the hardware first

Before touching drivers, find out what the machine actually has. The point is to learn the chipset, the driver bound to it, and the interface name the kernel assigned — guessing any of those wastes time later.

Start with the host and the two buses that matter for a USB Wi-Fi adapter, PCI and USB:

# What machine is this, and which kernel am I on?
hostnamectl
uname -r

# PCI devices with their kernel driver and module (-nn shows vendor:device IDs,
# -k shows the driver "in use" and the modules that could drive it).
lspci -nnk

# USB devices, then the same list as a tree showing which bus/port and the
# driver bound to each interface.
lsusb
lsusb -t

On my ThinkPad this showed the built-in wireless as a MediaTek card on PCI driven by mt7925e, and the Alfa on USB as 0bda:8812 Realtek Semiconductor Corp. RTL8812AU. The lsusb -t tree is the useful one — it prints the driver and the link speed per port, e.g. Driver=rtw88_8812au, 480M (USB 2.0) versus 5000M (USB 3.0). That speed number becomes important in a moment.

Next, the kernel modules and the network interfaces:

# Which wireless modules are loaded, and what depends on them.
lsmod | grep -E "rtw88|mt76|cfg80211|mac80211"

# Link-layer view of every interface (-br = brief, one line each).
ip -br link

# The wireless-specific view: each phy, its interfaces, type, and channel.
iw dev

# Is anything soft- or hard-blocked by rfkill?
rfkill list

lsmod confirmed the in-kernel rtw88_8812au driver and its stack (rtw88_core, rtw88_usb, mac80211, cfg80211) were present — no out-of-tree driver needed. ip -br link and iw dev give you the interface name. Mine came up with a predictable-network-interface name like wlp5s0f3u1 (the u1 encodes the USB path), not wlan1. rfkill list is the cheap check that saves embarrassment: if the adapter is soft-blocked, nothing else will work until you run sudo rfkill unblock wifi.

!!! note Since Linux 6.14 the RTL8812AU is supported in the mainline kernel through the rtw88 (mac80211) driver, with firmware from linux-firmware. The old out-of-tree aircrack-ng rtl8812au DKMS driver is deprecated in favor of it. On a current Arch linux kernel you should not need to install anything extra — check modinfo rtw88_8812au and ls /usr/lib/firmware/rtw88/rtw8812a_fw.bin*.

2. Read the kernel log

When a USB device misbehaves, the kernel ring buffer tells you exactly what happened and when. Two tools read it: dmesg (the raw buffer) and journalctl -k (the same kernel messages, but persisted across boots if you have a persistent journal).

# Everything the kernel said about USB and the rtw88 driver, newest last.
sudo dmesg | grep -iE "usb|rtw88|8812"

# Follow it live while you replug the adapter (Ctrl-C to stop).
sudo dmesg -w

# Human-readable timestamps instead of seconds-since-boot.
sudo dmesg -T

journalctl is better when the problem happened at boot or on a previous boot, because it can show earlier boots directly:

# Kernel messages from the current boot.
journalctl -k -b

# Kernel messages from the PREVIOUS boot (-b -1), filtered to the adapter.
journalctl -k -b -1 | grep -iE "rtw88|0bda|8812|usb"

# List known boots so you can pick one by index or ID.
journalctl --list-boots

# Narrow to a time window instead of a boot.
journalctl -k --since "-10min"

Filtering by the chipset ID (0bda), the driver name (rtw88), or the USB bus-port the device landed on (something like usb 8-1) is what turns a wall of log lines into the three lines that matter. In my case those three lines were the whole story:

usb 8-1: new high-speed USB device number 2 using xhci_hcd
rtw88_8812au 8-1:1.0: Firmware version 52.14.0, H2C version 0
usb 8-1: USB disconnect, device number 2
rtw88_8812au 8-1:1.0: write register 0x5 failed with -71

Firmware loaded fine, then the device disconnected a fraction of a second later and a register write failed with -71 (-EPROTO). That is not a dead adapter. It is the driver deliberately re-plugging it.

3. The USB 3 mode-switch disconnect

The RTL8812AU enumerates as a USB 2.0 (“high-speed”) device first. The rtw88 USB driver then asks the chip to re-enumerate as a USB 3 device so it can run at SuperSpeed. That re-enumeration is a real USB disconnect and reconnect — which is exactly what the log shows. The register write that fails with -71 is one of the last control transfers still in flight when the chip drops off the bus; upstream has a patch whose commit message describes this precisely, noting that “the device re-enumerates, probes again and registers normally,” and that on USB-2-only ports the switch can never succeed, so the message returns on every boot.

You can see the mechanism in the driver itself. rtw88_usb exposes a module parameter:

modinfo -p rtw88_usb
# switch_usb_mode:Set to N to disable switching to USB 3 mode to avoid
# potential interference in the 2.4 GHz band (default: Y) (bool)

So the behavior is: with switch_usb_mode=Y (the default), the driver tries to move the adapter to USB 3. The trouble is that on some physical ports and through some hubs, the adapter does not come back after the disconnect — the port cannot complete the switch, or cannot deliver enough power across it, and you are left with a device that appears, loads firmware, and vanishes in a loop. This is the “USB 2.0 / power” issue people hit with the ACH: it is hungry, and the USB-3 negotiation is where a marginal port or an underpowered hub shows up.

There are three good resolutions, in rough order of preference.

Option A — move it to a different port

The cleanest fix is often physical. A port on a different USB controller completed the switch for me when the first one did not. After moving ports, confirm the result:

lsusb -t | grep rtw88          # want to see 5000M (USB 3.0 SuperSpeed)
cat /sys/bus/usb/devices/*/speed

If you see 5000M and the interface stays present in ip -br link, you are done — the adapter is running at full USB 3 speed and no config change is needed.

Option B — put it on a powered USB 2.0 hub

If every direct port fails the switch, a powered USB 2.0 hub sidesteps it: the adapter can only ever run at USB 2.0 through the hub, so the driver’s attempt to reach USB 3 simply never applies, and the hub supplies clean power. This is the fix reported in the morrownr USB-WiFi tracker for the exact AC → disconnect symptom: “I bought a USB 2.0 Hub and connected through it and the adapter started working.”

Option C — tell the driver to stay in USB 2.0 mode

If you would rather not depend on a hub, disable the mode switch. Set it live to test without unplugging anything:

# Live toggle (root). Takes effect on the next probe of the device.
echo N | sudo tee /sys/module/rtw88_usb/parameters/switch_usb_mode

# Re-probe the adapter in place (replace with your device's USB path from lsusb -t).
echo 6-1:1.0 | sudo tee /sys/bus/usb/drivers/rtw88_8812au/unbind
echo 6-1:1.0 | sudo tee /sys/bus/usb/drivers/rtw88_8812au/bind

Make it persistent with a one-line modprobe option. This is a driver option, not a blacklist — it changes how one module behaves and disables nothing:

sudo tee /etc/modprobe.d/rtw88_usb.conf <<'EOF'
# Keep the RTL8812AU in USB 2.0 mode so it does not disconnect trying to
# re-enumerate as USB 3 on a port/hub that cannot complete the switch.
options rtw88_usb switch_usb_mode=N
EOF

!!! warning “The trade-off” Staying in USB 2.0 caps throughput below what the adapter can do on USB 3, so prefer Option A or B if you actually want AC1200 speeds. The upside the kernel documents is the flip side of the same coin: not switching to USB 3 “avoids potential interference in the 2.4 GHz band.” For monitor-mode and injection work in 2.4 GHz, USB 2.0 mode is often perfectly fine.

4. Verify monitor mode and injection

The handoff notes I started from flagged monitor mode on this chipset as “not yet verified,” and there are real reports of the in-kernel driver hanging after extended captures (more on that below). So I tested it rather than assuming. First, confirm the phy even advertises monitor mode:

# Find the phy index for your interface, then list its supported modes.
iw dev                                  # note the wiphy/phy# for the Alfa
iw phy phy5 info | sed -n '/Supported interface modes/,/Band/p'

You want * monitor in that list. To switch the interface into monitor mode with plain iw — no extra tooling required — take it down, change its type, bring it up, and park it on a channel:

IFACE=wlp5s0f3u1
sudo ip link set "$IFACE" down
sudo iw dev "$IFACE" set type monitor
sudo ip link set "$IFACE" up
sudo iw dev "$IFACE" set channel 6         # or: set freq 2437
iw dev "$IFACE" info                        # confirm "type monitor"

Prove reception by capturing a few management frames. tcpdump on a monitor interface shows raw 802.11 with radiotap headers:

sudo tcpdump -i "$IFACE" -c 20 -nn type mgt subtype beacon

Seeing beacons from nearby APs, with per-antenna signal levels, means RX works. For injection, the standard self-test is aireplay-ng from the aircrack-ng package, which probes nearby APs and reports the percentage that answer:

sudo pacman -S --needed aircrack-ng
sudo iw dev "$IFACE" set channel 6
sudo aireplay-ng --test "$IFACE"

On my setup this returned high response rates (for example 30/30: 100%) from APs on the same channel, confirming the adapter both receives and injects. The airmon-ng / airodump-ng tools from the same package are the usual next step for channel hopping and capture.

!!! danger “Known stability caveat” Upstream bug reports for the in-kernel rtw88_8812au driver describe the RTL8812AU becoming unresponsive after extended time in monitor/promiscuous mode — spewing failed to get tx report from firmware and requiring a replug. My tests were short and clean, but if you plan long captures, watch for this. If it bites you, the fallback is the (deprecated) aircrack-ng rtl8812au DKMS driver; try it only if the mainline driver genuinely falls short.

5. NetworkManager: managed vs unmanaged

Once the adapter works, there is a workflow conflict to resolve. On most Arch desktops, NetworkManager owns your wireless devices. Check which tool is in charge:

systemctl is-active NetworkManager iwd systemd-networkd wpa_supplicant
nmcli device status

What “managed” means. When NetworkManager manages a device, it treats that interface as its own radio and acts on it without being asked: it periodically scans all channels to build a network list, it controls the link up/down state and the interface type, it auto-connects saved profiles, and it owns the device in nmcli. A managed device that has not joined a network shows as disconnected — not idle, just “mine, but not associated yet.” When a device is unmanaged, NetworkManager ignores it completely: no scans, no state changes, no profiles. (This is the state your VPN tunnels and bridges usually sit in.)

For a client adapter you want managed — it makes connecting a one-liner. For monitor mode you want it unmanaged, because NetworkManager’s periodic background scan retunes the radio and knocks it off your capture channel.

ManagedUnmanaged
Connect with nmcli/GUIYes, one commandNo, NM ignores it
Background channel scansYes (good for roaming)No (good for capture)
Auto-connect saved networksYesNo
MAC randomization appliedYes (by default)No
Good forEveryday Wi-Fi clientMonitor mode, injection, a tool that drives the device itself

Connecting while managed (nmcli)

nmcli device wifi list ifname wlp5s0f3u1                 # scan/list on this adapter
nmcli device wifi connect "MySSID" password 'secret' \
      ifname wlp5s0f3u1                                   # associate
nmcli connection show --active                            # confirm

Opt out one-time (this boot only)

To free the adapter for a capture session without persisting anything, set it unmanaged at runtime. This affects only the named device and needs no NetworkManager restart, so your other connections stay up:

sudo nmcli device set wlp5s0f3u1 managed no
nmcli -f GENERAL.NM-MANAGED device show wlp5s0f3u1       # -> no

Per Red Hat’s NetworkManager documentation, nmcli device set ... managed no persists across NetworkManager reloads but not across a reboot — which is exactly what you want for a temporary session. Re-enable it the same way with managed yes.

Opt out persistently (survives reboot)

For a permanent rule, drop a keyfile in /etc/NetworkManager/conf.d/. There are two idiomatic ways to express it; both scope to a single adapter and leave every other interface alone.

Match by driver, so the rule follows this chipset regardless of which USB port it is in or how its MAC is randomized (the built-in card uses a different driver, so it can never match):

# /etc/NetworkManager/conf.d/50-alfa-unmanaged.conf
[device-alfa]
match-device=driver:rtw88_8812au
managed=0

Or match by interface name, if you prefer pinning it to one device node:

# /etc/NetworkManager/conf.d/50-alfa-unmanaged.conf
[keyfile]
unmanaged-devices=interface-name:wlp5s0f3u1

A [device-*] section is additive, so it will not clobber an existing unmanaged-devices= line in another conf.d file (a Mullvad or similar rule, say) — a second [keyfile] unmanaged-devices= can. Valid match specs include interface-name:, mac:, driver:, and type:.

Apply the config:

sudo nmcli general reload conf

!!! note “Reload vs. restart gotcha” A plain nmcli general reload conf does not always re-evaluate a device NetworkManager is already managing — the keyfile reliably applies on a fresh start. The clean way to get immediate effect without restarting NetworkManager (which would briefly drop your other Wi-Fi) is to also run the one-time nmcli device set ... managed no now, and let the keyfile carry it across reboots. That is the belt-and-suspenders approach I used.

With the adapter unmanaged, drive it entirely with iw and the aircrack-ng tools as in section 4; NetworkManager will leave it alone.

6. Reverting everything

Each change above is independently reversible:

# Re-enable NetworkManager management (runtime).
sudo nmcli device set wlp5s0f3u1 managed yes

# Remove the persistent unmanaged rule.
sudo rm /etc/NetworkManager/conf.d/50-alfa-unmanaged.conf
sudo nmcli general reload conf

# Re-enable the USB 3 mode switch (remove the modprobe option).
sudo rm /etc/modprobe.d/rtw88_usb.conf

# Put the adapter back to normal client mode.
sudo ip link set wlp5s0f3u1 down
sudo iw dev wlp5s0f3u1 set type managed
sudo ip link set wlp5s0f3u1 up

If you want 6 GHz working on the laptop’s built-in card while you are in here, I wrote that up separately in Enabling WiFi 6GHz Band with MediaTek MT2927 on Arch Linux.

Sources