2

I'd like to create a monitor interface via the UCI files (I can do this fine using iw commands).

Currently, I am just defining the interface like so:

config wifi-device radio1
    option htmode 'HT20'
    #option disabled '1'
    option hwmode '11ng'
    option path 'pci0000:00/0000:00:15.0/0000:06:00.0'
    option type 'mac80211'
    option channel '11'
    list ht_capab 'SHORT-GI-40'
    list ht_capab 'TX-STBC'
    list ht_capab 'RX-STBC1'
    list ht_capab 'DSSS_CCK-40'


config wifi-iface
    option mode 'monitor'
    option device 'radio1'
    option hidden 1
    #option network 'mon1'

After a wifi reload, I can see (via 'iw wlan1 info') that radio1 has entered monitor mode.

Interface wlan1
    ifindex 66
    wdev 0x10000000f
    addr 04:f0:21:10:c1:8a
    type monitor
    wiphy 1
    channel 6 (2437 MHz), width: 20 MHz (no HT), center1: 2437 MHz

However, I have no monitor interface (because I haven't defined one in /etc/config/network). Even if I do define an mon1 interface, I have the same issue. Additionally, the channel for the monitor is not the channel defined by radio1.

Does anyone have any experience doing this? The openwrt documentation has no similar example.

mbauer14
  • 1,217
  • 2
  • 13
  • 18

1 Answers1

1

I use this UCI block:

config wifi-iface
        option mode 'monitor'
        option device 'radio0'
        option hidden 1
        option network 'lan'

Calling 'wifi up' with that block then results in an error, but the interface is created anyway:

ifconfig: SIOCSIFHWADDR: Invalid argument
command failed: Device or resource busy (-16)
Configuration file: /var/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr <mac_address> and ssid "<ssid>"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 

You can verify it is there with 'iwconfig':

wlan0-1   IEEE 802.11bgn  Mode:Monitor  Tx-Power=10 dBm   
          RTS thr:off   Fragment thr:off
          Power Management:off

wlan0     IEEE 802.11bgn  Mode:Master  Tx-Power=10 dBm   
          RTS thr:off   Fragment thr:off
          Power Management:off

And you can use it: 'tcpdump -i wlan0-1 -c 100'

NightFalcon
  • 102
  • 1
  • 9