Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If someone starts to use the wifi, i can see that with logread:

Jan 23 21:04:47 router daemon.info hostapd: wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: authenticated

But how can i see, that he/she's disconnecting? Theres no "bla-bla deauthenticated bla" line in logread, or even a thing that points to that someone get's disconnected..

I tried to google:
http://wiki.openwrt.org/doc/uci/system
But it doesn't writes about loglevel.

Can anyone help me find out, how to find out that someone disconnects it's wifi from the router? The logread doesn't even writes a line when someone disconnects.

Please help!! It's important!
Thank you!:\

share|improve this question

1 Answer 1

You can poll the list of associated clients from one of the following commands:

  • iw dev wlan0 station dump --> for nl80211/mac80211 compatible drivers

  • wlc assoclist --> for proprietary broadcom-wl driver

  • iwinfo wlan0 assoclist --> for libiwinfo abstraction available in OpenWrt trunk

Judging by hostapd in your logs the first one should work. Example output:

   root@OpenWrt ~ # iw dev wlan0 station dump
   Station 00:13:02:xx:xx:xx (on wlan0)
      inactive time:    0 ms
      rx bytes: 21835
      rx packets:   152
      tx bytes: 19772
      tx packets:   100
      tx retries:   6
      tx failed:    0
      signal:   -43 dBm
      signal avg:   -44 dBm
      tx bitrate:   36.0 MBit/s

Also hostapd reports disconnections (eg if run from commandline - surely there's a way to get this into logs):

root@OpenWrt ~ # hostapd -P /var/run/wifi-phy0.pid /var/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr 94:0c:6d:xx:xx:xx and ssid 'marvin'
wlan0: STA 00:13:02:xx:xx:xx IEEE 802.11: authenticated
wlan0: STA 00:13:02:xx:xx:xx IEEE 802.11: associated (aid 1)
AP-STA-CONNECTED 00:13:02:xx:xx:xx
wlan0: STA 00:13:02:xx:xx:xx WPA: pairwise key handshake completed (RSN)
(...)
AP-STA-DISCONNECTED 00:13:02:xx:xx:xx

Alternatively you can connect to hostapd via its control socket using wpa-cli:

root@OpenWrt ~ # wpa_cli -p /var/run/hostapd-phy0       
wpa_cli v0.8.x
Copyright (c) 2004-2010, Jouni Malinen <j@w1.fi> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.


Selected interface 'wlan0'

Interactive mode
>
(...here client connects...)
<3>AP-STA-CONNECTED 00:13:02:xx:xx:xx
(...and here disconnects...)
<3>AP-STA-DISCONNECTED 00:13:02:xx:xx:xx
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.