WLAN-Pi / wlanpi-profiler

Wi-Fi client capabilities analyzer tool built for the WLAN Pi
BSD 3-Clause "New" or "Revised" License
25 stars 8 forks source link

iwlwifi interface preparation #56

Closed joshschmelzle closed 2 years ago

joshschmelzle commented 3 years ago

Today the commands we use to stage the NIC in monitor mode look like this:

ip link set wlan0 down
iw dev wlan0 set type monitor
ip link set wlan0 up
iw wlan0 set channel 1

This works fine for Mediatek and Realtek adapters, but does not for iwlwifi.

One way to get the iwlwifi adapter in monitor mode is to add a monitor interface like this:

sudo iw phy phy0 interface add wlan0mon type monitor
sudo iw dev wlan0 del
sudo ip link set wlan0mon up

Tasks are to investigate and reproduce. If profiler adds a monitor interface, it should also remove it at close.

joshschmelzle commented 3 years ago

In testing this is fixed in 811166a78fc6fc3aa5c36d344d628d1fbebcd509.

The solution is not to manage a second monitor interface, but to run wpa_cli -i <iface> terminate before staging the NIC.

joshschmelzle commented 3 years ago

More improvements on bfc5d2d24a188dea88989267cd04c2948c156374

joshschmelzle commented 3 years ago

The current behavior with iwlwifi appears require a scan performed before certain channels are enabled. 6 GHz channels for example. We haven't figured out injection on 6 GHz yet, but this commit in the dev branch starts to work on what that might look like. 9b1e9dc0a4ae12eb0624aa79e0a30b28e09b59ab

In addition, we need to figure out how to reliably use iwlwifi for packet injection in the 5 GHz band with the AX200 and AX210. Then we need to make sure our documentation is updated to reflect the steps required.

joshschmelzle commented 2 years ago

Addressed in 8dc0b03cc7ed080dbcf12e74e5cd22e4cef29c13 and documented here https://github.com/WLAN-Pi/wlanpi-profiler/blob/main/INTERFACE_STAGING.md.