home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4676 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  2.5 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!tabatha!maf
  2. From: maf@tabatha.MAE.CWRU.EDU (Mark Fullmer)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: Determining Ethernet Addresses of Network Machines
  5. Date: 16 Sep 1992 04:46:37 GMT
  6. Organization: Case Western Reserve University
  7. Lines: 55
  8. Message-ID: <196e7dINNql1@usenet.INS.CWRU.Edu>
  9. References: <1004@cybaswan.UUCP>
  10. NNTP-Posting-Host: tabatha.mae.cwru.edu
  11. Keywords: help...
  12.  
  13. In article <1004@cybaswan.UUCP> ccpaulm@cybaswan.UUCP (Paul Matthews) writes:
  14. >Hi,
  15. >
  16. >    We've been trying to build up a database of all the
  17. >    machines on our network, such as ip number, hostname
  18. >    and the ethernet address. So far, the program I've
  19. >    come up with is very crude/slow...it takes the /etc/hosts
  20. >    file as it's list of known machines and then performs a 
  21. >    ping on each machine and then uses arp -a (via grep) to
  22.  
  23. I have a small perl script that makes a database of "tcpdump -enl arp" or
  24. "tcpdump -penl arp,"  the latter if you want to see replies at the expense
  25. of cpu time.  Then another that creates reports.   I'd like to add a ping
  26. option and proxy arp detect...then again classes start next week :)
  27.  
  28. Try anonymous ftp on curiosity.cob.ohio-state.edu /pub/arpmon in a few
  29. days.
  30.  
  31. This much works:
  32.  
  33.     print "usage: ipreport pmf:lkh\n";
  34.     print "  -m only print hosts with more than one hw address\n";
  35.     print "  -f filter. eg -f 128\.146\.109\..* for only hosts in subnet 109\n";
  36.     print "  -l only list new entries (looks at $lasttime)\n";
  37.     print "  -k Kill -HUP the arpmon process before starting\n";
  38.     print "  -n don't resolve hostnames\n";
  39.     print "  -r only print arp replies\n";
  40.     print "  -b only print arp requests (broadcasts)\n";
  41.  
  42. reports look like:
  43.  
  44. Arpmon report started 2:2:15 8/15/92 as -k
  45.  
  46. IP: 128.146.109.18  buyout.cob.ohio-state.edu
  47.      Hardware Address:         02:60:8C:0B:C7:1E (3Com IBM PC; Imagen; Valid;
  48.      Number of Arp broadcasts: 9
  49.      First Seen:               7:39:19 8/8/92
  50.      Last Seen:                15:34:57 14/8/92   Asking For 128.146.109.9
  51.  
  52.      Hardware Address:         02:60:8C:0B:C7:1E (3Com IBM PC; Imagen; Valid;
  53.      Number of Arp Replies:    12
  54.      First Seen:               7:44:18 8/8/92
  55.      Last Seen:                7:58:23 8/8/92     Replying To aa:0:4:0:cc:18
  56.  
  57. IP: 128.146.109.190 charlotte
  58.      Hardware Address:         08:00:20:00:57:D9 (Sun)
  59.      Number of Arp broadcasts: 2
  60.      First Seen:               15:34:18 14/8/92
  61.      Last Seen:                19:1:0 14/8/92     Asking For 128.146.109.24
  62.  
  63.  
  64. --
  65. mark
  66. maf+@osu.edu
  67.  
  68.