0

I have (Linux-based) devices on a DHCP/ IPv4 network whose UI is via browser/ mobile app (over the LAN.) The tricky part is discovery of the device's IP address. We've been trying to use mDNS/ DNS-SD but think we're running into issues described in this post - there definitely seem to be behavior changes between wifi and wired clients on the same network.

We have tried toggling the router's IGMP snooping setting but it did not seem to help any. I am wondering if the client app needs to send some sort of IGMP membership request to signal to the router "yes please forward all mDNS multicast packets to me." (Even though from the above post it sounds like that should be happening already.

In the end I need a way for an app/ user to reliably discover the IP address of clients on a DHCP network without, say looking at the DHCP client table of a router. If not mDNS then what other options are available? The only thing I can think of is a custom UDP broadcast-based protocol but I'd like to avoid that and use something "standard" if at all possible. However we can write code for both the device and user client so have tons of flexibility.

1

I use something like this:

nmap -sP 192.168.11.0/24 | egrep 'scan report'

This does a ping scan on the 192.168.11.x subnet. Ip addresses will be returned for all hosts that are up on the subnet, with hostnames if available.

I'm not exactly sure how reliable this is. I've seen hosts drop off the list and reappear -- whether these actually became unavailable on the network at those times ... who knows, I didn't walk over and check the connectivity on the other hosts when it happened... but ICMP should at least see everything on the network, regardless of whether or not it's on the other side of a wireless connection. YMMV.

Honestly, I have an app called 'fing' on my phone, that does a pretty good job with this (as a matter of fact, I have the nmap command above wrapped in a shell function called fing(), just because it's easy to remember).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.