Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Aug 2000 09:17:41 -0500 (CDT)
From:      Chris Dillon <cdillon@wolves.k12.mo.us>
To:        Andrew Gordon <arg@arg1.demon.co.uk>
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.0008240904260.82311-100000@mail.wolves.k12.mo.us>
In-Reply-To: <Pine.BSF.4.21.0008241325190.26768-100000@server.arg.sj.co.uk>

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




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