Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Pinging IP Address Range

by neuhru (Novice)
on Mar 22, 2013 at 23:40 UTC ( #1024992=perlquestion: print w/ replies, xml ) Need Help??
neuhru has asked for the wisdom of the Perl Monks concerning the following question:

Hello PerlMonks,

What is the best way to ping a range of IP addresses to determine if they are active? Ranges include "172.31", "192.168", and "10.254".

Please help get me started down the path to achieving this. Let me know if any additional information is required.

Thanks in advance,

Neuhru

Comment on Pinging IP Address Range
Re: Need Help Determining DHCP IP Address Range
by NetWallah (Abbot) on Mar 23, 2013 at 06:13 UTC
    You need to know the MAC address of the switch, or , at least the MAC prefix (The first three octets of a six-octet ethernet address uniquely identifies the hardware vendor - This is called the "Organizationally Unique Identifier" (OUI)) of the manufacturer.

    You can look this up for your vendor at http://standards.ieee.org/db/oui/index.html.

    If you have access to your DHCP server, you should be able to match this MAC prefix or address with the list of DHCP-distributed addresses, and determine the IP address.

    If you do not have access to DHCP, but are on the same unrouted subnet as the switch, you can ping the entire subnet range, then look at your arp table, then find the mac for the Infiniband switch, and trace back to the IP.

                 "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
            -- Dr. Cox, Scrubs

Re: Need Help Determining DHCP IP Address Range
by hdb (Parson) on Mar 23, 2013 at 10:52 UTC

    Hmm: This is not really a Perl question...

    You could run some network scanning tool such as nmap. I got the following from overclockers.com:

    nmap -O -oX test.xml 169.10.0.0/24

    which runs a very aggressive test on all machines and gives you a lot of information such as Vendor, OS, MAC, etc. On my machine you need to run this as root. Unless you own the network, this might be seen as an aggression.

    UPDATE: As always, you can probably do it within Perl as well as there is an Nmap::Scanner module in Perl which might achieve similar feats...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1024992]
Approved by Lotus1
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-01 23:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (52 votes), past polls