27

I have just successfully installed a driver (athk9_htc) for TP-Link TL-WN722N (a USB Wi-Fi adaptor) in Ubuntu 14.04.1. My goal is to capture Wi-Fi traffic with Wireshark.

I try to configure the adaptor to monitor mode by running: sudo iwconfig wlan1 mode monitor

However it gives me an error message:

Error for wireless request "Set Mode" (8B06):
    SET failed on device wlan1; Device or resource busy.

How can I set it to monitor mode?

Edited:

I do not agree this is a duplicated question. Actually I have found that thread before I asked this question. However there are two responses in that thread, but not any verified answer. If I do not ask this question again, how can I get the answer? Also the answer given by @chili555 is different to the responses in that thread, and I verified this answer is working. If the question is duplicated, shouldn't it be added as a comment in that thread to indicate that a verified answer is here, instead of indicating an answered question is a duplicated question?

eepty
  • 535

5 Answers5

35

It may work if you first bring the interface down:

sudo ifconfig wlan1 down
sudo iwconfig wlan1 mode monitor

Check:

iwconfig

Not every device and driver combination are capable of monitor mode.

chili555
  • 61,330
3

The best way to put your Wifi adapter to monitor mode is through airmon-ng.

You can install it by typing into a terminal sudo apt-get install aircrack-ng

Also, if you are using Wireshark, you have to run it as superuser to be able to put your adapter to monitor mode... :)

1

Simple first make sure that you have installed drivers for your wireless adapter. Then if you want to enable monitor mode there are 2 methods to do it.

First method is by doing:

  • ifconfig wlan0 down
  • then airmon-ng check kill
  • then type iwconfig mode monitor and then ifconfig wlan0 up
  • type service NetworkManager restart before doing ifconfig wlan0 up.

Second way is by doing:

  • ifconfig wlan0 down
  • then airmon-ng check kill
  • then type airmon-ng start wlan0
  • then type service NetworkManager restart and ifconfig up.
Lorenz Keel
  • 9,511
Mihir
  • 11
0

I was facing the same issue, I disabled the network manager 1st and then able to put in monitor mode. Network manager is changing the mode back to managed mode after a while.

service NetworkManager stop

ifconfig wlp2s0 down iwconfig wlp2s0 mode monitor ifconfig wlp2s0 up

0

Assuming your Wi-Fi interface is wlp3s0, here's how you can set it to monitor mode:

systemctl stop NetworkManager
ip link set wlp3s0 down
iw wlp3s0 set type monitor
ip link set wlp3s0 up

Execute the commands as root or using sudo.