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 [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message

Reply via email to