Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using linux. How do you normally go about finding machines on the local network?

share|improve this question
2  
Before you do any sort of scanning, ensure you have proper authorization first. In most organizations this is a fireable offense. –  K. Brian Kelley Oct 8 '09 at 2:26
6  
Fireably? Really? Do you work for the NSA? Reprimandable, definately. Disciplinable, maybe. But fireable? Must be the BOFH... –  Mark Henderson Oct 8 '09 at 2:32
    
yeah, fireable? Never heard of such a thing being a termination offense –  warren Oct 8 '09 at 8:12
4  
Can we please try to remember that what is and is not possible in the sense of fireable is location dependent. Just because it can't happen where I am doesn't mean it can't happen elsewhere. I would also assume we are talking about someone who hasn't been authorised to perform a scan. –  John Gardeniers Oct 8 '09 at 10:59
2  

8 Answers 8

up vote 9 down vote accepted

Sure, install nmap and then run:

nmap -sP 192.168.0.1-254

Of course you'll need to replace the IP range with the appropriate values for your network.

share|improve this answer
    
This only works is your machines are configured to not ignore pigs. An ARP based approach would be better IMHO. –  AlberT Oct 8 '09 at 9:00
    
nmap should actually use arp if it believe you're on the same network and nmap is run as root. It can be forced with the -PR option as well. –  Kjetil Joergensen Oct 8 '09 at 14:06
5  
AlberT my machines always ignore pigs, it is the cows that get them every time. Also ICMP echo. –  railmeat Oct 9 '09 at 0:20
    
railmeat LOL ... what about warthogs ? –  AlberT Dec 9 '09 at 9:45

I think the right approach would be to inspect the LAN at a level lower that IP, then ARP scanning is a better choice.

See my answer to this duplicate question, I suggested nast -m.

share|improve this answer

Many methods are possible. I would start with an nmap scan.

share|improve this answer

Use arpwatch, it lets you find other machines without scanning the network

share|improve this answer

A nice graphical tool is Auto Scan network (http://autoscan-network.com/). It shows open ports too. For Windows, I'd suggest Look@lan, which does the same thing.

share|improve this answer

I agree nmap, and arpwatch are good tools,you can use also fping.
Here I complete an existant python script from bortzmeyer that do the job for you, the script is very fast. but first you have to install ipcalc module and psyco


import os, sys, re
from threading import Thread
import psyco, ipcalc

class ping(Thread):
  def __init__(self, ip, version):
        Thread.__init__(self)
        self.ip =ip
        self.version=version
        self.tab=("No response", "Partial Response", "Alive")


  def run(self):
    try:
        if self.version==4: req=os.popen("ping -c2 -q "+self.ip, "r")
        elif self.version==6: req=os.popen("ping6 -c2 -q "+self.ip, "r")
        while 1:
            reponse=req.readline()
            if not reponse: break
            stat = re.findall(re.compile("(\d) received"), reponse)
            if stat:
                print "Status ", self.ip, " ",self.tab[int(stat[0])]

    except:
         raise sys.stderr.write("Error in ping.\n")
         sys.exit(-1)

if __name__=='__main__': psyco.full() try: address=sys.argv[1] if address.find('/') > 0: net=ipcalc.Network(address) else: net=[address] for ip in net: p=ping(str(ip), 4) p.start() except: pass

share|improve this answer

As an alternative to scanning your network, if you have access to the switch or router you can check the router directly for it's arp table which should list all connected machines and their MAC addresses. If you're just looking to map your network and see what's online, this may be a better/easier solution.

If you have a decent router/switch, you may also be able to grab this info over SNMP rather than logging into the equipment directly, which has it's own set of advantages when it comes to regularly mapping your network.

share|improve this answer

I use (will be available for download when it's ready) a tool that I wrote which handles both DNS/DHCP administration and SNMP walks of the switches. If something isn't in DHCP, I at least get a MAC address from the switch, but we've made a policy decision to put everything in DHCP, even if the machines themselves are statically IPed, just to aid in tracking address space.

If you're talking about finding something that perhaps you didn't put there, I'd agree with nmap. Or, if you're worried about legal/political issues, just a script that wraps ping...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.