Hi,
From a wireless network, how do I get the IP address of the clients assiciated with an access point ? I want to do this programmatically.
The wlan I mentioned above uses both static and dynamic IP addresses. thanks,
Topic: how do i get IP addresses of clients
The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.
/proc/net/arp will show you the IPs that were active recently.
Hope this helps,
Charlie
/proc/net/arp will show you the IPs that were active recently.
Hope this helps,
Charlie
thanks for ur reply.
arp is not enough because of the following reason. Say there are one or more clients associated with the AP. if the clients or the AP do not communicate to each other (not 80211 radio comm) there will not be any entries in the ARP table.
cat /var/dhcp.leases
cat /var/dhcp.leases
dhcp.leases does not show statically assigned IP address. Also, if it is the router re-booted for any reasons, it will not show the IP addresses it assigned for the hosts just before the reboot. Because, the lease time of the IP addresses are still valid.
I am currently looking for information on a slightly related issue (in short, execute a script every time a client connects to my access point) and came across something that you might find useful: the tool wl, which has a command that prints the MAC address of the clients associated with an AP.
In my configuration:
# wl -i wl0.1 assoclist
assoclist 00:11:22:33:44:55
In my WRT54GL, I am assigning to 00:11:22:33:44:55 a static address via a lease (configured on the LUCI gui), so I suspect that with a bit of scripting you would be able to convert the MACs into IPs by using that information.
Also, please take into account that (as far as I know) wl it is a broadcom proprietary tool, but similar tools should be available for other drivers. LUCI seems to provide a unified interface for getting that list (iwinfo.assoclist, defined here), but I am not familiar with LUCI nor know how to access that inferface.
Hope it helps!
(Last edited by diego.misc on 31 Oct 2009, 16:20)
I am currently looking for information on a slightly related issue (in short, execute a script every time a client connects to my access point) and came across something that you might find useful: the tool wl, which has a command that prints the MAC address of the clients associated with an AP.
In my configuration:
# wl -i wl0.1 assoclist assoclist 00:11:22:33:44:55
In my WRT54GL, I am assigning to 00:11:22:33:44:55 a static address via a lease (configured on the LUCI gui), so I suspect that with a bit of scripting you would be able to convert the MACs into IPs by using that information.
Also, please take into account that (as far as I know) wl it is a broadcom proprietary tool, but similar tools should be available for other drivers. LUCI seems to provide a unified interface for getting that list (iwinfo.assoclist, defined here), but I am not familiar with LUCI nor know how to access that inferface.
Hope it helps!
Yes, you are right similar tool exists in madwifi too. /proc/net/madwifi/ath0/associated_sta. Here is the issue with this tool. Say, a client is associated with the access point and link is fine for some time. If the client is disconnected without sending 80211 deassoc message (due to interference or fading or watever the reason being), this entry is invalid and it will exists for some time.
You need a combination of measures. The drivers assoclist capability to find station candidates and ping or arping to check whether the stations are alive.
Will a SNMP protocol do the jb finding out the clients associated with an AP
The discussion might have continued from here.