What's new

How to get a list of all devices currently connected to the router in the terminal?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

_BLACK_BuLLeT_

New Around Here
I have an ASUS TUF-AX5400 router with the latest Merlin (gnutone) firmware. How can I get a list of all devices currently connected to the router in the terminal when connecting to the router via SSH? The ping method is not convenient for me and takes a long time. Moreover, the router already knows all the devices connected to it, but how can I get them in the terminal?
 
I have an ASUS TUF-AX5400 router with the latest Merlin (gnutone) firmware. How can I get a list of all devices currently connected to the router in the terminal when connecting to the router via SSH? The ping method is not convenient for me and takes a long time. Moreover, the router already knows all the devices connected to it, but how can I get them in the terminal?

Captura de ecrã 2024-09-01, às 11.25.39.png
 
What constitutes being "connected"?

Years ago in the days of analog telephones, being connected was clearly understood; you literally had a completed electrical circuit between the endpoints. But on a packet switched network, the terms "connected" and "active" are dubious.

Consider ARP. All arp tells you is if traffic from/to a device has been seen "lately", which might be as little as 10 minutes ago. Once clients go "quiet", the arp entries will disappear until activity resumes. Yet, the client may still be "connected", as in their laptop is connected over ethernet or wireless, they have an active DHCP lease and IP assignment, etc.

Given the above, and depending on what YOU mean by connected, it might make more sense to actually ping around the network, just in case some devices have gone silent, if only temporarily.

That's why when routers attempt to create any sort of connected/active list of devices, you have to take it w/ a heavy grain of salt. By design, packet switched networks strive to be stateless, which is what makes them so powerful and flexible. But it also makes it that much more difficult to define what exactly is a connected/active device. And not everyone will agree w/ the definition.
 
As @eibgrad said so well, any scanning for devices is an approximation. I have tried all sorts of methods...

If you are running Entware, you could install nmap. This has given me the closest "approximation" ;-)

The typical command to ping all addresses on a network and report them is:

Code:
nmap -sn 192.168.1.0/24

The above assumes your network is 192.168.1.X with a 255.255.255.0 netmask. The command often takes quite some time and I usually run it a few times.
I just did a few runs now. The first one reported 74 clients, the next run reported 81.
 
Latest RTRMON beta also shows these recent ARP clients, but sorted into their individual LAN/WiFi/Guest WiFi/VLAN buckets:

 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top