1. HWADDR 与 MACADDR 意思十万八千里... HWADDR 是指定系统有多张网路卡时, 只有网路卡 mac addr 为指定项目时才使用该 IP 分配设定。MACADDR 是说指定这个介面配置把网路卡 MAC 调整后才套用该 IP 配置。
谢谢指正,看了一下ifcfg-eth的脚本,的确是这样:
关于HWADDR:
# 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=`get_device_by_hwaddr ${HWADDR}`
if [ -n "$curdev" ]; then
rename_device "${REALDEVICE}" "${HWADDR}" "${curdev}" || {
echo $"Device ${DEVICE} has different MAC address than expected, ignoring."
exit 1
}
fi
fi
fi
关于MACADDR:
# 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 different MAC address than it really has.
if [ -n "${MACADDR}" ]; then
ip link set dev ${DEVICE} address ${MACADDR}
fi