Is there a way to get all reachable IP addresses within a private network. I know that we can get all active devices' IP addresses within same subnet using arp. I was wondering if something similar exists for entire private network
1 Answer
There's no really reliable way.
Generally, you'd need a request-response type protocol that is implemented (or mandatory) on all hosts. While ARP is a protocol that must work for IPv4 to function, there's nothing mandatory for IPv4 itself. ARP isn't routable, and for routed subnets you need something routable.
- ICMP echo (
ping
) is often suppressed by the host firewall, or ICMP generally in a network (bad idea but common) - relying on ICMP Destination unreachable messages from the connecting router/gateway (due to failing ARP) may not work when those messages are rate-limited or suppressed completely, obstructing rapid sweeps
-
Thanks a lot for your reply @Zac67 !! My use case is that I want to know all the machines which are running my spring application, I want to hit an endpoint on all those machines and reply with a small response. Do you think there is some way to achieve this ? Sep 8 at 11:50
-
If it's your application, you can add a discovery method, e.g. a UDP listener that replies with some (indiscriminate) identification. Note that applications and protocols above the transport layer are explicitly off-topic here, see the help center.– Zac67 ♦Sep 8 at 12:01
-
Hey @Zac67 I understand that that this question is off topic for this stackexchange do you know a forum where I can get some help for this Sep 8 at 12:18
-
-