List all connected devices

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
Malmgren
DD-WRT Novice


Joined: 21 Aug 2017
Posts: 13

PostPosted: Fri Oct 30, 2020 8:19    Post subject: List all connected devices Reply with quote
Hi.
I'm trying to find a way to list all devices connected to my router. I've googled around all morning and can't seem to find a really good way.

The closest I have come is "wl assoclist", but it doesn't list all devices, just some of them. Also I see people recommending "wl_atheros", which doesn't even exist (probably because I'm on Broadcom, right?).

I thought maybe I need to tell wl which adapter to look at, but everything I've tried to send to the -a and -i arguments gives me "wl driver adapter not found".

One suggested option is relying of arp, but that's no good, I want all connected devices, not only those in arp.

Suggestions?

I'm on a D-Link DIR-868L, running r44627.

/Daniel
Sponsor
Malmgren
DD-WRT Novice


Joined: 21 Aug 2017
Posts: 13

PostPosted: Fri Oct 30, 2020 9:30    Post subject: Reply with quote
Replying myself here, I think I actually solved it.

It seems "wl assoclist" actually returns a list just of the devices on the first interface, which is "eth1". So I have to do a "wl -i eth2 assoclist" to get the rest of them. Combined those commands seem to get me the full list!

/Daniel
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 151

PostPosted: Fri Oct 30, 2020 11:13    Post subject: Reply with quote
Hi

login with shh to your router and use arp command:

Code:
#arp -a
Malmgren
DD-WRT Novice


Joined: 21 Aug 2017
Posts: 13

PostPosted: Fri Oct 30, 2020 11:19    Post subject: Reply with quote
arssant wrote:
Hi

login with shh to your router and use arp command:

Code:
#arp -a


Thanks for your answer. Not really useful though as I stated in my first post specifically that i do NOT want the devices from arp (which is not the same thing as the connected devices) and as I mentioned in my second post I've already solved the problem.

I ended up doing the following to get the list I need:
Code:
devices="$(wl -i eth1 assoclist) $(wl -i eth2 assoclist)"
HalfBit
DD-WRT Guru


Joined: 04 Sep 2009
Posts: 766
Location: AR, USA

PostPosted: Fri Oct 30, 2020 12:07    Post subject: Reply with quote
I'm in search of an accurate list of wired clients, so I might be able to help you in your search here even though it looks like you found what you need.

Take a look at the script at:
Code:
cat /user/sbin/clients


I have an R7000 so I use eth1, eth2, and also wl0.1, and wl1.1 for the virtual APs (VAPs) that make up my guest wireless to get counts of connected wireless devices. If your router is a tri-band, then there might be eth3 and wl2.1--not sure though as mine is dual-band.

If you find a way to accurately obtain a wired client count, let me know.

_________________
R7000 Nighthawk - DD-WRT v3.0-r40270M kongac (07/11/19)
R7000 Nighthawk - DD-WRT v3.0-r40270M kongac (07/11/19)
~~~~~~~~~~Dismantled for learning opportunities~~~~~~~~~~
WRT54Gv2
WRT54Gv8.2
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum