Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #972 (closed enhancement: fixed)

Opened 11 years ago

Last modified 6 years ago

Need sysfs attribute for 'adminstratively created' interfaces

Reported by: lucida@gmail.com Assigned to:
Priority: major Milestone: version 0.9.4
Component: madwifi: 802.11 stack Version: trunk
Keywords: udev persistent vap Cc:
Patch is attached: 0 Pending:

Description

Hi The card is a DLink G510, which has Atheros 5005G. It connects to a WAP router without any problem(using wpa_supplicant), but the monitor mode acts strange and cant work at all.

madwifi # wlanconfig ath1 create nounit wlandev wifi0 wlanmode monitor
ath1

 madwifi # iwconfig
lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"NetGear"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:14:6C:90:4B:F8
          Bit Rate:12 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:9C68-E5C5-140C-625C-85A7-503C-517E-43B3   Security mode:restricted
          Power Management:off
          Link Quality=7/94  Signal level=-86 dBm  Noise level=-93 dBm
          Rx invalid nwid:1139  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath135    IEEE 802.11g  ESSID:""
          Mode:Monitor  Channel:0  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=7/94  Signal level=-86 dBm  Noise level=-93 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Please notice that the result of wlanconfig shows ath1 but I actually get an ath135. The number keeps increasing each time when I add and then destroy a monitor device(even after reboot)

after "ifconfig ath135 up", I run "airodump-ng ath135", the scan interface appears but I cant get any AP shown.

If I add the module with

# modprobe ath_pci autocreate=monitor ath_debug=1
# airodump-ng ath0

this works fine and I can get the AP list, but adding a sta vap would fail

 # wlanconfig ath1 create nounit wlandev wifi0 wlanmode sta
wlanconfig: ioctl: Input/output error

The system is gentoo linux on a dual-core amd(x86), kernel 2.6.18-r1. I tried madwifi-ng 0.92 and lastest svn(r1758), same problem.

Change History

10/22/06 17:09:07 changed by mrenzmann

  • milestone deleted.

Please do not set a milestone unless you know what you're doing.

10/22/06 17:30:09 changed by Mister_X

That's not related to madwifi at all, that's an aircrack-ng issue (using airodump-ng with ath135 [ath followed by more than 1 figure] or any other interface name not beginning with ath).

As a workaround, you can always create an interface beginning with "ath" and one figure after it.

10/22/06 21:00:04 changed by lucida

I have same problem with Kismet(everything looks fine, but no AP shown).

And, I have no way to create an "interface beginning with "ath" and one figure after it." The figure just keep increasing...seems that all the integers between 1-135 have been occupied during my previous tests and kernel doesnt release them.

10/23/06 04:58:41 changed by mrenzmann

Just to be sure: you destroyed the interfaces with wlanconfig <iface> destroy? I can not remember that I had similar problems (related to not being able to reuse the name of a previously destroyed VAP) while I was working on some madwifi-related scripts lately.

Please give an exact chain of commands that allows to reproduce the interface naming issues.

10/23/06 06:07:53 changed by lucida

Thanks for the reply. I've searched alot before posting here and cant find any similar case. :( So this might be a rare problem and might not reproducible on all systems.

Here is the complete command list/output after a system boot

fancyworld ~ # iwconfig
lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"NetGear"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:14:6C:90:4B:F8
          Bit Rate:12 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:FF03-58BF-F871-EC78-9C60-DB84-6F2F-EF6B   Security mode:restricted
          Power Management:off
          Link Quality=27/94  Signal level=-69 dBm  Noise level=-96 dBm
          Rx invalid nwid:63  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

fancyworld ~ # lspci | grep Atheros
01:06.0 Ethernet controller: Atheros Communications, Inc. AR5005G 802.11abg NIC (rev 01)
fancyworld ~ # uptime
 20:49:48 up 5 min,  3 users,  load average: 0.73, 0.45, 0.21
fancyworld ~ # wlanconfig ath1 create wlandev wifi0 wlanmode monitor
ath1
fancyworld ~ # iwconfig
lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"NetGear"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:14:6C:90:4B:F8
          Bit Rate:24 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:FF03-58BF-F871-EC78-9C60-DB84-6F2F-EF6B   Security mode:restricted
          Power Management:off
          Link Quality=14/94  Signal level=-82 dBm  Noise level=-96 dBm
          Rx invalid nwid:67  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath138    IEEE 802.11g  ESSID:""
          Mode:Monitor  Channel:0  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=14/94  Signal level=-82 dBm  Noise level=-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

fancyworld ~ # wlanconfig ath1 destroy
wlanconfig: ioctl: No such device
fancyworld ~ # wlanconfig ath138 destroy
fancyworld ~ # iwconfig
lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"NetGear"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:14:6C:90:4B:F8
          Bit Rate:24 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:FF03-58BF-F871-EC78-9C60-DB84-6F2F-EF6B   Security mode:restricted
          Power Management:off
          Link Quality=29/94  Signal level=-67 dBm  Noise level=-96 dBm
          Rx invalid nwid:75  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

fancyworld ~ # wlanconfig ath1 create wlandev wifi0 wlanmode monitor
ath1
fancyworld ~ # iwconfig
lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"NetGear"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:14:6C:90:4B:F8
          Bit Rate:24 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:FF03-58BF-F871-EC78-9C60-DB84-6F2F-EF6B   Security mode:restricted
          Power Management:off
          Link Quality=14/94  Signal level=-82 dBm  Noise level=-96 dBm
          Rx invalid nwid:75  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ath139    IEEE 802.11g  ESSID:""
          Mode:Monitor  Channel:0  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=14/94  Signal level=-82 dBm  Noise level=-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

fancyworld ~ # wlanconfig ath139 destroy
fancyworld ~ # iwconfig
lo        no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11g  ESSID:"NetGear"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:14:6C:90:4B:F8
          Bit Rate:18 Mb/s   Tx-Power:18 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:FF03-58BF-F871-EC78-9C60-DB84-6F2F-EF6B   Security mode:restricted
          Power Management:off
          Link Quality=29/94  Signal level=-67 dBm  Noise level=-96 dBm
          Rx invalid nwid:78  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

fancyworld ~ # dmesg | grep wifi
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
wifi0: mac 7.8 phy 4.5 radio 5.6
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 5212: mem=0xfdfe0000, irq=21

fancyworld ~ # lsmod
Module                  Size  Used by
wlan_tkip              11456  2
fuse                   38868  8
it87                   18468  0
hwmon_vid               2752  1 it87
i2c_isa                 3648  1 it87
wlan_scan_sta          12288  1
joydev                  8128  0
nvidia               4707060  22
ath_pci                89376  0
ath_rate_sample        13440  1 ath_pci
wlan                  191292  5 wlan_tkip,wlan_scan_sta,ath_pci,ath_rate_sample
snd_intel8x0           28508  1
ath_hal               189968  3 ath_pci,ath_rate_sample
snd_ac97_codec         91808  1 snd_intel8x0
i2c_nforce2             6272  0
snd_ac97_bus            2048  1 snd_ac97_codec
i2c_core               17472  4 it87,i2c_isa,nvidia,i2c_nforce2
usb_storage            79488  0

I'm using wpa_supplicant and the conf. file is

fancyworld ~ # cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=10
update_config=1

network={
        ssid="NetGear"
        psk="password"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
}

The kernel is compiled with SMP, big ram and preempt enabled, does this matter? Below is the configuration file for reference.

hxxp://lucida.googlepages.com/2.6.18-r1.config.gz

Thanks!

10/23/06 13:09:45 changed by lucida

Hi
The number increasing thing is caused by udev, after hacking gentoo's default udev rule, problem solved.

For the monitor mode, it seems that airodump-ng/kismet are having problem with wpa_supplicant, I still cant capture any packets even after stop wpa_supplicant. But when I use iwconfig, everything just works as expected.

madwifi-ng doesnt support iwconfig+WPA-PSK, so I switch to iwconfig+WEP as a workaround atm. Will this be added in the future release?

10/23/06 15:59:45 changed by mrenzmann

Do you have a link regarding "iwconfig+WPA-PSK"? Personally, I didn't know that iwconfig allowed to configure WPA-PSK out of the box in any version.

10/23/06 17:17:53 changed by lucida

The only driver supports this is ralink, just search "iwconfig wpa ralink". It use iwpriv to set the WPA things. I tried the lastest wireless-tools(29_pre10) with madwifi-ng, "iwpriv ath0 wpa 1" seems to work and put the card into wpa mode but there is no way to specified key and encryption mode.

10/24/06 12:08:44 changed by lucida

And, can I get sta and monitor modes work at the same time, I mean, keep internet connection while sniffing. My sta interface always gets deassociated when I start airodump/kismet and will reconnect automatically after program exits.

10/26/06 09:12:40 changed by anonymous

Hi The number increasing thing is caused by udev, after hacking gentoo's default udev rule, problem solved.


How did you exactly solve the increasing thing???

11/02/06 13:18:19 changed by domae87@domae.ch

I have the same problem with the increasing... but on debian... how can i solve this problem?

thx

11/06/06 02:07:10 changed by lucida

Got a new ASUS MB w/builtin WiFi(RTL8187), so I might not use madwifi anymore, anyway, let me finish this thread :)

1. number increasing
Caused by udev, goto /etc/udev/rules.d/(gentoo) and find 75-persistent-net-generator.rules
Find line

KERNEL=="eth*|ath*|wlan*|ra*|sta*", IMPORT{program}="write_net_rules $attr{address}"

change to

KERNEL=="eth*|Ath*|wlan*|ra*|sta*", IMPORT{program}="write_net_rules $attr{address}"

and then delete 70-persistent-net.rules in same directory


2. Monitor while surfing
This is quite simple but takes me sometime to figure it out. Just disable hop fuction in kismet/airodump-ng and set my own AP to the same channel of the target AP.

(follow-up: ↓ 14 ) 12/26/06 16:11:36 changed by rantapplan

I still have the problem with increasing ond debian /etc

How can i solve this problem?

(in reply to: ↑ 13 ) 04/28/07 06:29:30 changed by Nethox

Replying to rantapplan:

I still have the problem with increasing ond debian /etc How can i solve this problem?


Debian:
- Delete ath* related entries in /etc/udev/rules.d/z25_persistent-net.rules
- Edit /etc/udev/persistent-net-generator.rules:

13c13
< KERNEL=="ath*", ATTRS{type}=="802", GOTO="persistent_net_generator_end"
---
> KERNEL=="ath*", GOTO="persistent_net_generator_end"

- Execute # /etc/init.d/udev reload

The problem in default config is that ATTRS{TYPE}=="802" doesn't match every link type of madwifi-ng's VAPs. Link types can be shown with $ ip link show

05/04/07 00:42:05 changed by anonymous

I still have the problem with increasing on Ubuntu (Feisty 7.04) too. Any ideas how can i solve it?

05/05/07 17:59:42 changed by mentor

  • component changed from madwifi: driver to madwifi: 802.11 stack.
  • summary changed from Monitor mode acts strange and doesnt work to Need sysfs attribute for 'adminstratively created' interfaces.
  • owner changed.
  • milestone set to version 0.9.4.
  • keywords changed from monitor to udev persistent vap.
  • type changed from defect to enhancement.

Please see: UserDocs/Distro/Debian/TroubleshootingInstallation for information about disabling udev persistent naming rules for Madwifi devices. At the moment this is only a workaround; there needs to be some flag somewhere to show administratively created interfaces.

Also, there are restrictions on how and the number of VAPs that one may create. Please see UserDocs/MultipleInterfaces for information on this.

I am going to leave this open as an enhancement, but nothing will change until someone gets around to writing the appropriate code, so please only add relevant information.

06/29/08 06:35:09 changed by mentor

  • status changed from new to closed.
  • resolution set to fixed.

(in reply to: ↑ description ) 02/12/12 12:09:51 changed by anonymous

Replying to lucida@gmail.com:

Hi The card is a DLink G510, which has Atheros 5005G. It connects to a WAP router without any problem(using wpa_supplicant), but the monitor mode acts strange and cant work at all. {{{ madwifi # wlanconfig ath1 create nounit wlandev wifi0 wlanmode monitor ath1 madwifi # iwconfig lo no wireless extensions. wifi0 no wireless extensions. ath0 IEEE 802.11g ESSID:"NetGear" Mode:Managed Frequency:2.422 GHz Access Point: 00:14:6C:90:4B:F8 Bit Rate:12 Mb/s Tx-Power:18 dBm Sensitivity=0/3 Retry:off RTS thr:off Fragment thr:off Encryption key:9C68-E5C5-140C-625C-85A7-503C-517E-43B3 Security mode:restricted Power Management:off Link Quality=7/94 Signal level=-86 dBm Noise level=-93 dBm Rx invalid nwid:1139 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 ath135 IEEE 802.11g ESSID:"" Mode:Monitor Channel:0 Access Point: Not-Associated Bit Rate:0 kb/s Tx-Power:18 dBm Sensitivity=0/3 Retry:off RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality=7/94 Signal level=-86 dBm Noise level=-93 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 }}} Please notice that the result of wlanconfig shows ath1 but I actually get an ath135. The number keeps increasing each time when I add and then destroy a monitor device(even after reboot) after "ifconfig ath135 up", I run "airodump-ng ath135", the scan interface appears but I cant get any AP shown. If I add the module with {{{ # modprobe ath_pci autocreate=monitor ath_debug=1 # airodump-ng ath0 }}} this works fine and I can get the AP list, but adding a sta vap would fail {{{ # wlanconfig ath1 create nounit wlandev wifi0 wlanmode sta wlanconfig: ioctl: Input/output error }}} The system is gentoo linux on a dual-core amd(x86), kernel 2.6.18-r1. I tried madwifi-ng 0.92 and lastest svn(r1758), same problem.