Java simple Network IP-Adress Scanner
host, ip-address, java, network-scan, networking
Solution
- Get your LAN IP address,
- Build IP addresses starting from your LAN IP as 192.168.0.1
- Go through all 192.168.0.X (0-255) possibilities.
- Ping (Java's `isReachable`) the possible IP address and print it if it's reachable.
In code: https://github.com/syndbg/HackBulgaria/blob/master/Core-Java-1/13-Networking1/src/InternetUtils.java#L56
Problem
I want to make my own ip scanner, that scans available ips on the local network, like Angry IP Scanner would do it. I also want to get some basic device info, like the hostname. How would I solve that in Java? I don't want to use any libraries to do that. Should I just try to ping every available ip using a loop and see it it answers?