Date: Tue, 9 Nov 1999 22:43:17 -0600 From: Dan Nelson <dnelson@emsphone.com> To: Matt Behrens <mbehrens@globaldsl.com> 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> In-Reply-To: <Pine.LNX.4.10.9911091601470.31255-100000@jerry.globaldsl.com>; from mbehrens@globaldsl.com on Tue, Nov 09, 1999 at 04:09:57PM -0500 References: <Pine.LNX.4.10.9911091601470.31255-100000@jerry.globaldsl.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991109224317.A14176>