如何在 OpenWrt 10.03 中获取已连接 wifi 客户端的列表?
Fa1*_*gel 17
为了查看关联的 wifi 客户端,即使它们没有 DHCP 客户端或没有 ip,您也必须向 AP 询问关联的 wifi 设备:
# Universal (Tested with OpenWRT 14.07 and 15.05.X)
iwinfo wlan0/wl0/ath0 assoclist
# Proprietary Broadcom (wl)
wl -i wl0 assoclist
# Proprietary Atheros (madwifi)
wlanconfig ath0 list sta
# MAC80211
iw dev wlan0 station dump
Run Code Online (Sandbox Code Playgroud)
这样,您还将看到连接速度。对我来说,这看起来像这样:
# iwinfo wlan0 assoclist
12:34:56:78:9A:BC -26 dBm / -95 dBm (SNR 69) 1930 ms ago
RX: 24.0 MBit/s, MCS 0, 20MHz 3359 Pkts.
TX: 130.0 MBit/s, MCS 14, 20MHz, short GI 1209 Pkts.
Run Code Online (Sandbox Code Playgroud)
小智 16
You may use the arp-table, or DHCP-leases. Not a perfect solution, maybe it's enough?
List arp-table
arp
Run Code Online (Sandbox Code Playgroud)
List DHCP-leases
cat /tmp/dhcp.leases
Run Code Online (Sandbox Code Playgroud)
... and combined
for ip in $(arp | grep -v IP | awk '{print $1}'); do
grep $ip /tmp/dhcp.leases;
done
Run Code Online (Sandbox Code Playgroud)