tshark monitoring and iw wierd behaviour

asked 2021-10-15 09:39:19 +0000

Hello,

I'm trying to make some experiment with Wi-Fi monitoring. I'm only interessting with my own network.

I've got 3 pc on debian. Two of them are communicating via a WiFi network, and the third is on monitor mode to capture all the traffic. I need this monitor mode since I'm interesting in radio headers.

I'm facing a weird behavior from my network card. When I try to configure it I get a message saying my ressource is busy. I do :

ifconfig wlp5s0 down iwconfig wlp5s0 mode monitor iw dev wlp5s0 set freq 5180 80 5210

After the last command I get : root@monitor:~# iw dev wlp5s0 set freq 5180 80 5210 command failed: Device or resource busy (-16)

The weird part is that I can get this command working if I launch a tshark capture in monitor mode before my iw command. Which is not very conveniant for automatisation .... More over I would like to understant what happen. I guess tshark put the card in a certain condition where my command is valid. But I wonder how I could do this myself in command line

Thanks for your help.

edit retag flag offensive close merge delete