Search code examples
ipmac-addressdhcpsubnet

How to get all IP Address and device details which is connected with that IP Address from different subnet?


I want extract all IP Address and device details(Mac address,Device Name,DNS whatever possible) which is connected with that IP Address for different subnet not only for local subnet. So, is there any command, library for JAVA or Open source API?

Other solution than nmap


Solution

  • "Connected" as in with a socket to the local system?

    • IP addresses: system or application connection table (netstat et al)
    • DNS name: reverse DNS (PTR)
    • Device name: there's no standard for querying, device names are dependent on application protocol
    • MAC address:
    • for local segment IPs: local ARP table
    • for remote IPs: need to ask the router, there's no local way

    If you mean "connected to the network" you'll need an ARP scan for the local segment (try to resolve each IP address and see if a MAC is returned) and for the remote segment, there's just a ping sweep (where you won't see device not answering to ICMP echo requests or where the response is filtered in between).