From owner-freebsd-stable Thu Aug 24 7:18:11 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.wolves.k12.mo.us (mail.wolves.k12.mo.us [207.160.214.1]) by hub.freebsd.org (Postfix) with ESMTP id 0DAEB37B42C for ; Thu, 24 Aug 2000 07:18:07 -0700 (PDT) Received: from mail.wolves.k12.mo.us (cdillon@mail.wolves.k12.mo.us [207.160.214.1]) by mail.wolves.k12.mo.us (8.9.3/8.9.3) with ESMTP id JAA82470; Thu, 24 Aug 2000 09:17:41 -0500 (CDT) (envelope-from cdillon@wolves.k12.mo.us) Date: Thu, 24 Aug 2000 09:17:41 -0500 (CDT) From: Chris Dillon To: Andrew Gordon Cc: Smith@ian.org, Dermot McNally , freebsd-stable@freebsd.org, Fred Clift Subject: Re: Numbering of fxp devices In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 24 Aug 2000, Andrew Gordon wrote: > On Wed, 23 Aug 2000, Chris Dillon & others wrote: > > > > > I also wonder if there woudl be a way to map cards based on their > > > MAC addresses, or is the MAC address discovery done way too late? > > > > Way too late, I think, since the driver would have to attach before it > > could even query the card for its MAC address. If it were able to get > > the MAC, detach, re-attach, etc. until the right order was reached, > > that might work. > > > > > Hmm.. maybe some sort of aliasing? A conf file could list device > > > numbers and MAC addresses, so once the kernel finished finding > > > everything, it could look through the cards and asign /dev/ether0 > > > to one, /dev/ether1 to another, ect. > > > > Thats an idea, too... > > I think you're making this way harder than it needs to be. I use the > following in /etc/rc.conf: > > ether=$(ifconfig ed1 |grep ether |cut -c 8-24) > echo Ethernet address is ${ether} > case ${ether} in > 00:e0:29:32:67:7c) > hostname="rig1.vnltest" > ifconfig_ed1="inet 10.5.0.101 netmask 0xffffff00" > ;; > 00:e0:29:32:67:7f) > hostname="rig2.vnltest" > ifconfig_ed1="inet 10.5.0.102 netmask 0xffffff00" > ;; > 00:e0:29:32:6f:0d) > hostname="rig3.vnltest" > ifconfig_ed1="inet 10.5.0.103 netmask 0xffffff00" > ;; > *) > echo "Unexpected ethernet address $ether - assuming rig4" > hostname="rig4.vnltest" > ifconfig_ed1="inet 10.5.0.104 netmask 0xffffff00" > ;; > esac > > > This particular example is for a single interface - I use it on a > bootable CD, so that I can just duplicate a single CD image for a > bunch of machines, and have each of them come up with their > individual configuration. For the multiple interface situation > you've been talking about, a similar trivial piece of shellscript > would let you assign ifconfig_xxx variables according to the MAC > address. That works fine in the case of attaching an IP address to a given MAC address, but it still doesn't attach a specific device number to a given MAC. Being able to do so goes beyond just assigning IP addresses the old way, it also keeps things intuitive when dealing with lots if interfaces, as well as with any utility that takes an interface name instead of an IP address (tcpdump, etc.). -- Chris Dillon - cdillon@wolves.k12.mo.us - cdillon@inter-linc.net FreeBSD: The fastest and most stable server OS on the planet. For Intel x86 and Alpha architectures. ( http://www.freebsd.org ) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message