# monitor mode for madwifi driver

## o5gmmob8

Hi all,

I recently upgraded to the newest unstable madwifi driver so that I can change my MAC address without causing hangs.  However, with that upgrade, I can no longer put my wireless card into monitor mode.  I can put it into promiscuous mode, but that just lets me see stuff on my current Access Point connection.  I tried upgrading to the latest madwifi snapshot from http://snapshots.madwifi.org/madwifi-ng-current.tar.gz, but that gives the same results as the latest unstable package in portage.  I also tried copying the wireless header /usr/src/linux/include/linux/wireless.h to /usr/include/linux/wireless.h, but that didn't change anything.

Here is the output:

```

localhost madwifi-ng-r1393-20060111 # kismet_server

Will drop privs to walterw (1000) gid 100

No specific sources given to be enabled, all will be enabled.

Enabling channel hopping.

Enabling channel splitting.

Source 0 (ath0): Enabling monitor mode for madwifi_g source interface ath0 channel 6...

FATAL: Failed to retrieve list of private ioctls 7:Argument list too long

```

I am running 2.6.14-r5 (gentoo-sources) with baselayout 1.12.0_pre13-r1.  Please let me know if you have any ideas about which driver combination lets me change the MAC address and put my card into monitor mode.

Thanks,

Walter

----------

## SuperMegaMau

Download the last kismet development version

----------

## Adrien

walterw,   :Smile: 

With the latest versions of madwifi-driver, you need to create a separate iface for each mode you want to use so if you need to use monitor mode, try this:

```
# wlanconfig ath create wlandev wifi0 wlanmode monitor
```

the output of this should be:

```
ath1
```

Now you have a brand new ath1 that you can put into monitor mode with:

```
# iwconfig ath1 mode monitor
```

And if you want this ath1 to be created on each startup, you should add this to /detc/udev/rules.d/65-madwifi.rules:

```
KERNEL=="wifi[0-9]*", DRIVER=="ath_pci", ACTION=="add", RUN+="/sbin/wlanconfig ath create wlandev %k wlanmode monitor"
```

(only works with >=udev-081)

Have fun!   :Smile: 

----------

## MKV21

Hey,

after 

wlanconfig ath create wlandev wifi0 wlanmode monitor

i have an interface with mode monitor. But it is still not possible to start kismet:

 *Quote:*   

> No specific sources given to be enabled, all will be enabled.
> 
> Enabling channel hopping.
> 
> Enabling channel splitting.
> ...

 

I think kismet wants to set the card manually in monitor mode (and doesnt't know that it is already in monitor mode), but with the new drivers a mode change is impossible (right?).

Any ideas how to fix that?

Thanks in advance,

MikeLast edited by MKV21 on Wed Feb 15, 2006 7:34 am; edited 1 time in total

----------

## SuperMegaMau

I had problem too, so I went to the madwifi divers page and got the "old code",

```
 svn checkout http://svn.madwifi.org/branches/madwifi-old madwifi-old 
```

This "old code" does not support that virtual interfaces thing but it works great with kismet. I think at some point of the project they decided to change the architecture completely and keep the old one as well, so they split it into "old code" and "ng". Dont know if this is true or not, just my understanding...

anyway, try that driver...

----------

## MKV21

Sorry i dont know how to install the old drivers. I tried the following:

- unmerged the madwifi-driver and madwifi-tools

- svn checkout http://svn.madwifi.org/branches/madwifi-old madwifi-old

- make

but its still not possible to set card to monitor mode or to start kismet.

----------

## SuperMegaMau

- remove the card from the pcmcia slot

- remove all loaded modules related to the card (ath_*)

 *MKV21 wrote:*   

> 
> 
> - unmerged the madwifi-driver and madwifi-tools
> 
> - svn checkout http://svn.madwifi.org/branches/madwifi-old madwifi-old
> ...

 

then,

- make install

- insert the pcmcia card

- load the ath_pci module

- bring the ath0 up

- run kismet with the line: "source=madwifi_g, ath0, madwifi" in the kismet.conf file

----------

## MKV21

Ok, after i did that i'm not able to load the ath_pci modul:

```
nbtux madwifi-old # modprobe ath_pci

FATAL: Error inserting ath_pci (/lib/modules/2.6.13-gentoo-r5/net/ath_pci.ko): Unknown symbol in module, or unknown parameter (see dmesg)
```

After the emerge -avC madwifi-driver the ath-modules still exist... should i have deleted them manually before proceeding?

EDIT: Ah, details are in /var/log/messages, not in dmesg:

```
Feb 15 18:46:34 nbtux ath_hal: 0.9.14.9 (AR5210, AR5211, AR5212, RF5111, RF5112,                               

 RF2413)

Feb 15 18:46:34 nbtux ath_rate_sample: 1.2

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwrate

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwap

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol if_printf

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_sysctl_register

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwencode

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_setmlme

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_setoptie

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwmode

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwsens

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_chanlist

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_getparam

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwrate

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwrts

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwname

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_setparam

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwpower

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwsens

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwfreq

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwfrag

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwap

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwfreq

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwpower

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwrange

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwretry

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwnickn

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwrts

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_iw_getstats

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_addmac

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwfrag

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwencode

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_next_scan

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_media_init

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_iwsetup

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_delmac

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_classify

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_setkey

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_iwaplist

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_delkey

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwtxpow

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwretry

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwnickn

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwscan

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwmode

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_getoptie

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwessid

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwscan

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_siwessid

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_pwrsave

Feb 15 18:46:34 nbtux ath_pci: Unknown symbol ieee80211_ioctl_giwtxpow
```

----------

## SuperMegaMau

well, with that problem I think it's an issue with your kernel sources... Are you using a kernel image from the same version of the header sources?

----------

## MKV21

mhm i use 2.6.13-gentoo-r5, mhm... from the INSTALL-doc:

```
Kernels 2.4.2x - 2.6.10 should work without problems
```

Damn..... but a downgrade to 2.6.10.... i don't know... some months ago all worked fine for me...  :Sad: 

----------

## SuperMegaMau

I'm using 2.6.15 without problems, what I said in the last post is if your kernel sources poit to the right kernel version...

```
 

ls -l /usr/src/

```

find the line with the "linux ->"

then compare the version the the one that this comand gives you:

```
uname -r
```

----------

## MKV21

it's both 2.6.13-gentoo-r5.

I also tried to set the sourcepath manually before make and make install, no change. Another idea?

----------

## SuperMegaMau

ok... did you activate the wireless support when you compiled your[/quote] kernel?

```

CONFIG_NET_WIRELESS=y

```

----------

## MKV21

yes. i have another wireless card (onboard), works well.

And some months ago the (atheros) card worked with emerged madwifi and exactly that kernel.

Mhm I tried to compile my kernel again, result:

```
  CHK     include/linux/version.h

make[1]: »arch/i386/kernel/asm-offsets.s« ist bereits aktualisiert.

  CHK     include/linux/compile.h

  CHK     usr/initramfs_list

Kernel: arch/i386/boot/bzImage is ready  (#4)

  Building modules, stage 2.

  MODPOST

  INSTALL drivers/acpi/video.ko

  INSTALL drivers/net/dummy.ko

  INSTALL drivers/net/s2io.ko

  INSTALL drivers/scsi/dpt_i2o.ko

  INSTALL drivers/scsi/ipr.ko

  INSTALL drivers/scsi/sata_sis.ko

  INSTALL drivers/scsi/sata_sx4.ko

  INSTALL drivers/usb/serial/pl2303.ko

  INSTALL drivers/usb/serial/usbserial.ko

  INSTALL lib/libcrc32c.ko

  INSTALL net/ipv4/netfilter/ipt_NOTRACK.ko

  INSTALL net/ipv4/netfilter/iptable_raw.ko

if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map  2.                                      

6.13-gentoo-r5; fi

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_ap.ko needs unknown symbol                                       

ieee80211_find_channel

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_ap.ko needs unknown symbol                                       

ieee80211_scan_dump_channels

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_ap.ko needs unknown symbol                                       

ieee80211_create_ibss

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_ap.ko needs unknown symbol                                       

ieee80211_note

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_ap.ko needs unknown symbol                                       

ieee80211_scanner_register

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_ap.ko needs unknown symbol                                       

ieee80211_scanner_unregister_all

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_find_channel

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_scan_dump_channels

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_create_ibss

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_note

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_start_scan

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_sta_join

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_note_mac

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_bg_scan

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_scanner_register

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_saveie

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_scanner_unregister_all

WARNING: /lib/modules/2.6.13-gentoo-r5/net/wlan_scan_sta.ko needs unknown symbol                                      

 ieee80211_print_essid

```

----------

## SuperMegaMau

take a look at this: https://forums.gentoo.org/viewtopic-p-1506985.html?sid=5a25f294e25d9ec1f40193e18f59bea4

----------

## MKV21

mhm but they use the emerged madwifi-driver.

The only difference in my kernel is the CONFIG_CRYPTO_HMAC=y, so i try that now. But unmerge and reemerge? Its already unmerged!

----------

## MKV21

SuperMegaMau you are great!

After I compiled the kernel and rebooted it worked. It works to modprobe ath_pci, to set ath0 in monitor mode and also to start kismet!

You are my hero  :Very Happy: 

I don't know if it was this ONE kernel option or the whole kernel compilation or something other what need a reboot... or was it really the CONFIG_CRYPTO_HMAC=y ?? crazy...

----------

## GNUtoo

wow you were able to make this work!!!

i didn't manage to do so...(that even crashed my kernel when i wanted to connect myself to a network!!!)

wirth what command did you create your NORMAL card

if i'm able to install this i'll be able to use the card as a lot of cards...that's would be great

----------

## MKV21

hi,

i don't know what you exactly mean...

my normal card (onboard) use ndiswrapper, my pcmcia card the old-self-compiled mad-wifi as you see above. To load the card (module) i use modprobe ath_pci.

But i don't think this is the answer you wanted, right?  :Wink: 

----------

## GNUtoo

 *MKV21 wrote:*   

> hi,
> 
> i don't know what you exactly mean...
> 
> my normal card (onboard) use ndiswrapper, my pcmcia card the old-self-compiled mad-wifi as you see above. To load the card (module) i use modprobe ath_pci.
> ...

 

the new driver is slightly different from the old one

you have to create your interface wiht an userspace program...

for example in the old one ath0 is created by default...

in the new one you have to create ath0...and you can also create ath1,ath2...so you can use one card as a lot of different card at once and:

*connect to multiple wifi network at once

*operate at multiple mode at once(ap,client,scanning,monitor,repeater...)

----------

## Phlogiston

So is it not possible to use the new drivers with kismet? I don't get an error but kismet does not show me any networks...

```

Will drop privs to helgc (1000) gid 100

No specific sources given to be enabled, all will be enabled.

Enabling channel hopping.

Enabling channel splitting.

Source 0 (Atheros): Enabling monitor mode for madwifi_g source interface wifi0 channel 6...

NOTICE:  Created Madwifi-NG VAP kis

WARNING: wifi0 appears to be using Madwifi-NG.  Some versions of the Madwifi-NG drivers have problems in monitor mode, especially if non-monitor VAPs are active.  If you experience problems, be sure to try the latest versions of Madwifi-NG and remove other VAPs

Source 0 (Atheros): Opening madwifi_g source interface kis...

Spawned channelc control process 3507

Dropped privs to helgc (1000) gid 100

```

```

iwconfig

wifi0     no wireless extensions.

ath0      IEEE 802.11b  ESSID:""

          Mode:Managed  Frequency:2.467 GHz  Access Point: Not-Associated

          Bit Rate:1 Mb/s   Tx-Power:8 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm

          Rx invalid nwid:121  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

kis       IEEE 802.11b  ESSID:""

          Mode:Monitor  Frequency:2.442 GHz  Access Point: Not-Associated

          Bit Rate:0 kb/s   Tx-Power:17 dBm   Sensitivity=0/3

          Retry:off   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

Any hints?

----------

## o5gmmob8

Hi,

The new drivers work fine actually, I haven't posted the update though.  Everything works fine for me although I couldn't tell you what version I am running (not in front of that box).  I am most likely running the latest stable drivers.

That looks normal what you have so far except that it didn't capture any wireless APs.

Post your /etc/kismet.conf or other configuration files.

Walter

----------

## Phlogiston

Ok, this is the only line I changed in kismet:

```
source=madwifi_g,wifi0,Atheros

```

I haven't the foggiest idea why it's not working. I read somewhere that someone had a similar problem but could it fix by updating madwifi to 0.9.2, but this didn't help in my case.

----------

## o5gmmob8

Hi guys,

I am having more and more issues with my wireless ...  I have turned on the verbosity in rc.conf and see that when my laptop makes DHCP requests, it uses the previous IP which is not always valid for that network.  I then see it sending just a plain DHCP request, but in all cases, I do not get a response from the server.  I should be able to connect as I am sporadically able to join, but by and large, the DHCP request times out.  I am using madwifi-ng, is anyone else having these issues as well.

Walter

----------

