From owner-freebsd-stable Thu Aug 24 5:35:16 2000 Delivered-To: freebsd-stable@freebsd.org Received: from arg1.demon.co.uk (arg1.demon.co.uk [194.222.34.166]) by hub.freebsd.org (Postfix) with ESMTP id 955CF37B423 for ; Thu, 24 Aug 2000 05:35:10 -0700 (PDT) Received: from localhost (arg@localhost) by arg1.demon.co.uk (8.8.8/8.8.8) with ESMTP id NAA26823; Thu, 24 Aug 2000 13:33:51 +0100 (BST) (envelope-from arg@arg1.demon.co.uk) Date: Thu, 24 Aug 2000 13:33:51 +0100 (BST) From: Andrew Gordon X-Sender: arg@server.arg.sj.co.uk To: Chris Dillon 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 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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message