Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Aug 2000 13:33:51 +0100 (BST)
From:      Andrew Gordon <arg@arg1.demon.co.uk>
To:        Chris Dillon <cdillon@wolves.k12.mo.us>
Cc:        Smith@ian.org, Dermot McNally <dermot@traveldev.com>, freebsd-stable@freebsd.org, Fred Clift <fred@clift.org>
Subject:   Re: Numbering of fxp devices
Message-ID:  <Pine.BSF.4.21.0008241325190.26768-100000@server.arg.sj.co.uk>
In-Reply-To: <Pine.BSF.4.21.0008231000500.72198-100000@mail.wolves.k12.mo.us>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0008241325190.26768-100000>