From owner-freebsd-questions Tue Nov 9 20:43:32 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 5A39E1515E for ; Tue, 9 Nov 1999 20:43:25 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id WAA14761; Tue, 9 Nov 1999 22:43:17 -0600 (CST) (envelope-from dan) Date: Tue, 9 Nov 1999 22:43:17 -0600 From: Dan Nelson To: Matt Behrens Cc: questions@FreeBSD.ORG Subject: Re: Getting ARP replies on a connected network w/o having IP configured? Message-ID: <19991109224317.A14176@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from mbehrens@globaldsl.com on Tue, Nov 09, 1999 at 04:09:57PM -0500 X-OS: FreeBSD 4.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message