Option primary/primary_reselect
The option primary defines the primary slave, meaning that it should always be active if it is available. This is useful when one slave is preferred over the others (for example, when one slave has higher throughput or should serve most of the time to one Linux system).
If the primary option is set, the
primary_reselect option can be used to specify a policy of selecting an
active slave at failover time or when the primary slave is available again. There are three possible values:
- always (0)
- The primary slave becomes the active slave whenever it is available.
The value always (0) should be chosen if the primary slave is designated to the bond and the other slaves are only considered as backup during the failover. Once the primary slave is available again, it becomes active automatically.
- better (1)
- Depending on which is better (based on speed and duplex status), either the currently active
slave remains active or the primary slave becomes active.
The value better (1) is used only if the backup slave could be better than the primary one, which should not be a normal use case.
- failure (2)
- Even if the primary slave is up again, it does not become the active slave at once until the
current active slave fails.
The value failure (2) is used to avoid flip-flopping between the primary slave and the other slaves.
Note: In order to test the setup of the primary_reselect option, it
is recommended to use the command ip link set dev
slave_device_name
down/up to simulate a link failure or recovery. It is not suitable to use a
network management tool to disenslave the active slave device and enslave it again because when
initially enslaved, the primary_reselect setting is ignored and the
primary slave is always made active.