Is there a way to retrieve IP and MAC address of devices connected to a Wi-Fi hotspot/access point using NetworkManager (nmcli
or even better via C API)?
I had a similar question, but for me it was enough to display that info on terminal. I didn't find anything in documentation, but the apt package (apt info network-manager
) on Ubuntu has a dependency on dnsmasq-base. So opening htop
I saw that NetworkManager (in my case) uses dnsmasq for dhcp server.
With htop(or similar, you can press t
to sort by parent processes) you can look for /usr/sbin/dnsmasq
running. there you will be able to see all the arguments it is given.
One of them is --dhcp-leasefile
. You can use that as a starting pointer.
In my case it wasleasefile=/var/lib/NetworkManager/dnsmasq-wlo1.leases
There also was argument --dir=/etc/NetworkManager/dnsmasq-shared.d
that may help you to configure dnsmasq if that's required
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With