From owner-freebsd-questions Wed Nov 10 11:35: 9 1999 Delivered-To: freebsd-questions@freebsd.org Received: from jerry.globaldsl.com (jerry.globaldsl.com [63.211.0.21]) by hub.freebsd.org (Postfix) with ESMTP id 7256014DDA for ; Wed, 10 Nov 1999 11:34:40 -0800 (PST) (envelope-from mbehrens@globaldsl.com) Received: from localhost (mbehrens@localhost) by jerry.globaldsl.com (8.9.3/8.9.3) with ESMTP id OAA02355; Wed, 10 Nov 1999 14:33:15 -0500 Date: Wed, 10 Nov 1999 14:33:15 -0500 (EST) From: Matt Behrens To: Dan Nelson Cc: questions@FreeBSD.ORG Subject: Re: Getting ARP replies on a connected network w/o having IP configured? In-Reply-To: <19991109224317.A14176@dan.emsphone.com> Message-ID: X-Plea-For-Assistance: To all intelligent life in the universe: please save us from Windows NT! MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dan, thanks for your help. I read up a little more on tcpdump and got the info I need. I think this might work pretty well; my laptop is currently sitting next to me "learning" the characteristics of this LAN by observing packets. (Actually, it's already seen all it needs to know, but it doesn't hurt to leave it) :-) Now I wonder if you or any of the other -questions folk might be able to answer another question -- is there an (easy) way to make a specific host (either by its IP or by its MAC address) put a packet on the wire indicating its IP and MAC, from an interface with no IPs? I can capture packets off the wire with tcpdump on an interface that's up but has no address; but on some of the more quiet networks it might take awhile, almost making it worthwhile to configure the interface manually :-) On Tue, 9 Nov 1999, Dan Nelson wrote: > In the last episode (Nov 09), Matt Behrens said: > > I have a laptop that frequently moves from network to network and I'd > > like it to intelligently configure itself based on MAC addresses of > > other hosts it sees on the local LAN segment; essentially > > "fingerprinting" the LAN it's on. > > So you'll have it assign itself a (hopefully predetermined) IP based on > the MAC addresses it sees? Interesting idea. > > > Obviously this gets done as root. :-) Is there some function that I > > can use, or maybe some shell command? (Just executing "arp -a" with > > an unconfigured interface either returns nothing or hangs.) > > Try the tcpdump command. You don't even need to listen for arps; all > ethernet packets have a MAC address. "tcpdump -e -n -c 10" will dump > 10 packets with ethernet headers, in a nice easy-to-parse format. > > If you want to write something in C, you can directly use the packet > capture library. Man pcap for the details. > > -- > Dan Nelson > dnelson@emsphone.com > Matt Behrens System Engineer, Global DSL Communications To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message