all ip addresses of machines in the local network

Ognjen B ognjen at mailshack.com
Fri Aug 25 09:36:20 EDT 2006


Amit Khemka wrote:
> On 23 Aug 2006 21:46:21 -0700, damacy <wegein at gmail.com> wrote:
>   
>> hi, sandra.
>>
>> no, it's not as complicated as that. all i want to do is to load a
>> database onto different machines residing in the same network. i hope
>> there is a way doing it. or perhaps i have a poor understanding of how
>> networks work.
>>
>>     
>
> I expect that you would know the IP range for your network. Then you
> can simply 'ping' each IP in the range to find wether its alive.
> Moreover by your description I guess you would actually want to find
> all machines in your network that run a particular network service, to
> allow you to "distribute the database". In such case you can use
> "nmap" with -p option, to find all the machines which are listening on
> the particular port.
>
> hth,
> amit.
>   
Correct me if I am wrong, but isn't a way  of doing this to use ARP?  
(Address Resolution protocol, see 
http://en.wikipedia.org/wiki/Address_Resolution_Protocol ) send an ARP 
request, and wait for the reply. For example:

you have a network, 192.168.5.0, with a netmask of 255.255.255.0 This 
means you have 254 addresses, so with ARP, it would go somthing like this:

your program >> "Who has 192.168.5.1"

and if anyone has the IP, they go  "Hey, I (hw MAC address) have IP"

Do this with the entire range (192.168.5.1 --> 192.168.5.254) and you 
get a list of the devices IP  addresses and corresponding MAC addresses. 
This is how some network scanners I use work, to build a list of 
connected systems.

Or you can use one of the other programs out there ,like nmap or nast, 
as they will output this list and you can parse it to your hearts content.

Of course, anyone feel free to correct me if I made a mistake, its been 
a while since I last did this.




More information about the Python-list mailing list