From owner-freebsd-hackers Fri Aug 25 11:24:52 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id LAA22598 for hackers-outgoing; Fri, 25 Aug 1995 11:24:52 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id LAA22588 for ; Fri, 25 Aug 1995 11:24:48 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.11/8.6.9) id LAA02693; Fri, 25 Aug 1995 11:24:37 -0700 From: "Rodney W. Grimes" Message-Id: <199508251824.LAA02693@gndrsh.aac.dev.com> Subject: Re: ARP'ing (Discovery of IP Interfaces on a subnet) To: SimsS@Infi.Net Date: Fri, 25 Aug 1995 11:24:37 -0700 (PDT) Cc: hackers@freebsd.org In-Reply-To: <199508251319.GAA02117@freefall.FreeBSD.org> from "Pavlov's Cat" at Aug 25, 95 09:19:20 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1994 Sender: hackers-owner@freebsd.org Precedence: bulk > > Greetings, hack-folks. (Sorry for being a little off-topic, but I'm coming > straight to the experts) > > My shop has a problem managing IP addresses. This is only being compounded > by the roll-out of Win-95, since now *everybody's a Net-Expert ;-). > > Problem is: Users are configuring their boxes with arbitrary IP addresses. > By this I mean, they'll go over to the next cubicle, snoop at the IP address > and then go back and configure a "similar" address in order to get IP running > on their box. Something like: "Gee, Joe Blow is 192.168.69.69, huh? Well, > it's 1:30 right now, so I'll make my box 192.168.69.130." > > You can probably imagine that this is *not* a "Good Thing(tm)". :-(. > I've looked at a DHCP implementation to help solve this problem, but until I can > round up a Non-NT DHCP server (is there a "Free" one?) I'm in a jam. Bootp > isn't an option because most of the boxes we're running don't have a bootp > client capability. > > I figured that I could cobble up a little hack that works kind of like the > following nugget of meta-code: > for ( i=0 ; i<256 ; i++ ) { // look for every IP in the subnet > MacAddress = arp("192.168.69", i ); // anybody out there? > if (MacAddress) // If I got a MAC address from IP address > printf("192.168.69.i\t",MacAddress); // show it > } Real fast way that will get you a bunch of them in a very short time is ``ping -c 2 192.168.69.255'' if your netmask is 0xffffff00. Then just look at the arp cache. Note the count needs to be 2 or the ping stops after the first packet comes back instead of waiting for a bit. This can cause a bit of a storm as all host try to reply to you at once, but it is usable. Then a quick arp -a will show you which IP addresses responded that DNS can not look up as they won't have a hostname :-). -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Reliable computers for FreeBSD