> Hi everybody!!I need to find a way to automatically get all the IPs
> from a small LAN.?Any ideas?Thanx in advance...:)
Um . . . Just keep making DHCP requests?
--
LTP
:)
Open a socket on a well-known port on each of the hosts in your LAN. If this
is a small LAN, most likely it will be type C network, with up to 254 hosts.
So, start with the host 1, and loop over:
192.168.1.1
192.168.1.2
...
192.168.1.254
(e.g. if your network IP starts with 192.168.1), and see if the socket
throws an exception. To speed things up, you can open 254 sockets at the
same time in asynchronous threads.
Alex Molochnikov
Gestalt Corporation
> Hi everybody!!I need to find a way to automatically get all the IPs
> from a small LAN.?Any ideas?Thanx in advance...:)
Chris Uppal - 13 Dec 2005 07:12 GMT
> Open a socket on a well-known port on each of the hosts in your LAN. If
> this is a small LAN, most likely it will be type C network, with up to
[quoted text clipped - 3 lines]
> ...
> 192.168.1.254
But tell your sysadmin/security people that you are going to be running a scan
first, or you'll likely find yourself politely, but firmly, kicked off the
premises...
-- chris
>Hi everybody!!I need to find a way to automatically get all the IPs
>from a small LAN.?Any ideas?Thanx in advance...:)
You know the range of IPs typically used. See
http://mindprod.com/jglass/ip.html
You probe each machine. If you can't find a way to talk to it, it is
as if it did not exist.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.