How to: Ath9k in monitor mode
I recently went through a (hard) struggle to put an ath9k (Atheros AR7161 NIC, dual-band) driver into monitor mode. I wanted to put one interface into both monitor and infrastructure mode at the same time. To summarize, it is not possible, at least with the 188.8.131.52+2011-02-07-1 version of the ath9k driver.
You can’t put it in “Master” and “Monitor” mode at the same time. As stated here, your device can’t work as a 802.11 infrastructure Access Point if you’re running monitor mode. I mean, it won’t even broadcast beacons at all, although iwconfig stated otherwise.
However (I learned that) it’s possible to put it in both “Ad-Hoc mode” and “Monitor mode”. I know, it’s not the same, but since I’m working with wireless mesh networks right now, it’s an “alrighty then”, can live with it. Oh, BTW! The ath9k driver may also operate in 802.11s mode (mesh point), however, it looks like it’s currently having a serious “beacon broadcasting” bug. So again, I’ll stick to the adhoc mode until the bug’s fixed.
So here’s how to put it in monitor+adhoc mode, assuming that you’ve got another interface running (wlan0, for instance):
iw phy phy0 interface add moni0 type monitor
ifconfig moni0 up
ifconfig moni0 10.0.0.1 netmask 255.255.255.0
Run tcpdump -i moni0 and look how the device will stil broadcast beacons and respond to pings… and all that.