[SOLVED] List ethernet devices/clients

Hello,
How can I get a list of the connected ethernet clients/devices?
Both DHCP clients and static ips.

ip neigh

Or

nmap

https://openwrt.org/packages/pkgdata/nmap

5 Likes

Basically, as there is no "authentication" with Ethernet as there is with 802.11, you can try to guess what is out there, but it will only be a guess, based on what has been "heard from" recently. Even with 802.11, you only get a MAC. Determining one or more of the IPs using that MAC is an inexact process.

1 Like

Oh okay, but how can the stock firmware on my TP-Link router know the ethernet devices connected? :thinking:

It guesses and makes people feel good showing something. You can get away with that for consumer software :wink:

(Note that any switch in your network will make passive discovery of wired clients close to impossible. You'll only see those that are communicating with or through the host doing the monitoring, or directly connected to it.)

2 Likes
ubus call hostapd.wlan0 get_clients
ubus call dhcp ipv4leases
ubus call dhcp ipv6leases
cat /tmp/dhcp.leases
3 Likes

Haha i love manufactures :stuck_out_tongue:

Ping them... ping them all :smiley:

1 Like

Fing for Android is a nice app for getting more details on your Local Area Network

1 Like

I remember playing with these so thanks for the reminder. Stangely, despite having IPv4 leases, trying ubus call dhcp ipv4leases on my stock 18.06.2 system returns the empty:

{
        "device": {

        }
}

The other examples you posted work as expected, so I'm curious if "ipv4leases" works for you?

It will work if you make odhcpd serve DHCPv4 instead of dnsmasq:
https://bugs.openwrt.org/index.php?do=details&task_id=2127

1 Like

ping -6 ff02::1%eth0 is a useful command, you'll get a whole bunch of link-local ipv6 addresses replying.

Thanks for heads-up. It's a shame we're missing that consistent ubus support with the baseline dnsmasq.

Yup, IPv6 multicast is a wonderful, underappreciated thing...

1 Like

install the arp-scan package, then from an SSH session, run ...

arp-scan --interface br-lan --localnet

run it a couple of times to make sure you've seen all responses

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.