Thursday, November 11, 2010

Warning of HWaddr when network restarted with bonding

Following warning could be observed on /var/log/messages when the network is restarted
Nov  4 08:18:09 db1 kernel: bonding: bond0: enslaving eth1 as an active interface with an up link.
Nov  4 08:18:12 db1 kernel: bnx2: eth0 NIC Copper Link is Up, 1000 Mbps full duplex
Nov  4 08:18:12 db1 kernel: bnx2: eth1 NIC Copper Link is Up, 1000 Mbps full duplex
Nov  4 08:22:55 db1 kernel: bonding: bond0: Removing slave eth0
Nov  4 08:22:55 db1 kernel: bonding: bond0: Warning: the permanent HWaddr of eth0 - F0:4D:A2:06:BC:7B - is still in use by bond0.
Set the HWaddr of eth0 to a different address to avoid conflicts.
Nov  4 08:22:55 db1 kernel: bonding: bond0: releasing active interface eth0
Nov  4 08:22:55 db1 kernel: bonding: bond0: Removing slave eth1
Nov  4 08:22:55 db1 kernel: bonding: bond0: releasing active interface eth1
Nov  4 08:22:55 db1 kernel: ADDRCONF(NETDEV_UP): bond0: link is not ready
Nov  4 08:22:55 db1 kernel: bonding: bond0: Adding slave eth0.
According to RedHat support document DOC-37419 this is a warning only doesn't indicate an issue.

It could be avoided by adding a MACADDR to the bonding interface. If the bonding interface is bond0 then adding following line to ifcfg-bond0 will make the warning disappear.
MACADDR=AA:BB:CC:11:22:33
The MAC address must be unique to that network segment.

Root cause for this is, when a MAC address is not defined bonding interface will use one of the slaves MAC address, and when that slave interface goes down bonding interface still prefers to use the same MAC address regardless other slave is now the active slave.