Madwifi

The madwifi driver allows creation of multiple virtual access points (VAPs). In particular, it allows creation of a monitor mode VAP in addition to station or access point VAPs. Note that you need to be root to issue these commands.


I find it easiest to remove existing VAPs to create the monitor mode VAP.

First we take down existing interfaces. Obviously, if your interface is called something else (e.g. ath1) substitute that.

ifconfig ath0 down

wlanconfig ath0 destroy

wlanconfig ath0 create wlandev wifi0 wlanmode monitor

The following indicates that we want radiotap headers for the monitor

sysctl -w net.ath0.dev_type=803

I think for newer versions of the madwifi-ng drivers, this is the default.

ifconfig ath0 up

I have personally used Wireshark and custom programs utilizing the pcap library to read timestamps from the monitor.

Creation of multiple interfaces:

wlanconfig ath0 create wlandev wifi0 wlanmode ap

wlanconfig ath1 create wlandev wifi0 wlanmode ap

sysctl -w net.ath1.dev_type=803

ifconfig ath0 up

ifconfig ath1 up

Especially when using multiple interfaces, I find that switching channels often doesn't function quite as expected. I find it necessary to take down the interfaces, switch channels, and bring the interfaces back up.

ifconfig ath0 down

ifconfig ath1 down

iwconfig ath0 channel 11

iwconfig ath1 channel 11

ifconfig ath0 up

ifconfig ath1 up