HWADDR=, 其中 以AA:BB:CC:DD:EE:FF形式的乙太網裝置的硬體地址.在有多個網絡卡裝置的機器上,這個欄位是非常有用的,它保證裝置介面被分配了正確的裝置名 ,而不考慮每個網絡卡模組被配置的載入順序.這個欄位不能和MACADDR一起使用. MACADDR=, 其中 以AA:BB:CC:DD:EE:FF形式的乙太網裝置的硬體地址.在有多個網絡卡裝置的機器上.這個欄位用於給一個介面分配一個MAC地址,覆蓋物理分配的MAC地址 . 這個欄位不能和HWADDR一起使用.另外,還可以參考ifup指令碼中關於HWADDR和MACADDR的處理:# remap, if the device is bound with a MAC address and not the right device num# bail out, if the MAC does not fitif [ -n "${HWADDR}" ]; thenFOUNDMACADDR=`get_hwaddr ${REALDEVICE}`if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; thencurdev=`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}fifi# this isn"t the same as the MAC in the configuration filename. It is# available as a configuration option in the config file, forcing the kernel# to think an ethernet card has a differentMAC address than it really has.if [ -n "${MACADDR}" ]; thenip link set dev ${DEVICE} address ${MACADDR}fi再看下nameif的man文件:nameif looks for the interface with the given MAC address and renames it to the name given.
HWADDR=, 其中 以AA:BB:CC:DD:EE:FF形式的乙太網裝置的硬體地址.在有多個網絡卡裝置的機器上,這個欄位是非常有用的,它保證裝置介面被分配了正確的裝置名 ,而不考慮每個網絡卡模組被配置的載入順序.這個欄位不能和MACADDR一起使用. MACADDR=, 其中 以AA:BB:CC:DD:EE:FF形式的乙太網裝置的硬體地址.在有多個網絡卡裝置的機器上.這個欄位用於給一個介面分配一個MAC地址,覆蓋物理分配的MAC地址 . 這個欄位不能和HWADDR一起使用.另外,還可以參考ifup指令碼中關於HWADDR和MACADDR的處理:# remap, if the device is bound with a MAC address and not the right device num# bail out, if the MAC does not fitif [ -n "${HWADDR}" ]; thenFOUNDMACADDR=`get_hwaddr ${REALDEVICE}`if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; thencurdev=`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}fifi# this isn"t the same as the MAC in the configuration filename. It is# available as a configuration option in the config file, forcing the kernel# to think an ethernet card has a differentMAC address than it really has.if [ -n "${MACADDR}" ]; thenip link set dev ${DEVICE} address ${MACADDR}fi再看下nameif的man文件:nameif looks for the interface with the given MAC address and renames it to the name given.