NIC Active/Passive bonding with priority

I will configure a bond of three NIC's. I want to define which one will be first used and which NIC will be used as the second and third NIC when failover is done. Is this possible?

Thanks


Solution 1:

The bonding mode for the is active-backup mode and to specify a preferred interface you use the primary keyword specifying the preferred interface:

BONDING_OPTS="mode=1 miimon=100 primary=eth0"

So in this example you want it to always be eth0 if it is available.

primary
A string (eth0, eth2, etc) specifying which slave is the primary device. The specified device will always be the active slave while it is available. Only when the primary is off-line will alternate devices be used. This is useful when one slave is preferred over another, e.g., when one slave has higher throughput than another. The primary option is only valid for active-backup mode.

The documentation for Linux bonding is actually quite thorough. I highly recommend reading at least the more relevant parts.