assignment of eth* devices

Rick Stevens rstevens at vitalstream.com
Mon Feb 7 19:59:46 UTC 2005


Sameer Kamat wrote:
> I believe the HWADDR assigns a particular MAC address to the card, if I 
> not wrong.
> I do not know an easy way for it to decide to load the device based on 
> the mac addr ?

I believe it'll force the mapping.  Here's the relevant part of the
/etc/sysconfig/network-scripts/ifup script (reformatted to fit):

# remap, if the device is bound with a MAC address and not the right
# device num.
# bail out, if the MAC does not fit
if [ -n "${HWADDR}" ]; then     FOUNDMACADDR=`get_hwaddr ${REALDEVICE}`
     if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
         curdev=`ip -o link | awk -F ':' -vIGNORECASE=1 '/$HWADDR/ { 
print $2 }'`        rename_device "${REALDEVICE}" "${HWADDR}" 
"${curdev}" || {
             echo $"Device ${DEVICE} has different MAC address than 
expected, ignoring."
             exit 1
         }
     fi
fi

----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-              Where there's a will, I want to be in it.             -
----------------------------------------------------------------------




More information about the fedora-list mailing list