Ensuring connectivity with active‑backup bonding on shared network adapters

7.1 LPAR mode z/VM guest KVM guest

With the default setting (fail_over_mac=0), an active‑backup bond uses a single MAC address for the bond and all lower interfaces, which can cause connectivity issues with shared network adapters.

If network bonding is implemented with shared network adapters, this can result in packets being forwarded to inactive lower interfaces, thus leading to loss of connectivity. Affected hardware includes OSA Express, RoCE Express and Network Express adapters.

Resolve this by setting the fail_over_mac option to active mode (fail_over_mac=1), which configures the bond to use the MAC address of the currently active lower interface while leaving the MAC addresses of lower interfaces intact.

The exact steps for setting fail_over_mac to active depend on the utility being used for network management.

Using NetworkManager

To set fail_over_mac to active for a new bond, issue a command of the following form:
# nmcli connection add type bond con-name <bond_name> ifname <bond_if_name> bond.options 'mode=active-backup,miimon=100,fail_over_mac=1' 
To set fail_over_mac to active for an existing bond, issue a command of the following form:
# nmcli connection modify <bond_name> +bond.options 'fail_over_mac=1' 
# nmcli connection up <bond_name>

Using YaST

If the bond was configured using YaST on SUSE Linux Enterprise Server, fail_over_mac can be set to active as follows:

  1. In YaST, go to System -> Network Settings.
  2. Select the bond, select Edit, and go to the Bond Ports tab.
  3. Add the string "fail_over_mac=1" to the Bond Driver Options field, separating it with a space character from any existing entry.
  4. Click Next, and then OK, which generates the configuration files to be used by wicked.

Using wicked

On SUSE Linux Enterprise Server, a network bond can be set to use active fail_over_mac by manually configuring ifcfg scripts, which are then sourced by wicked. This can be done as follows:

  1. Open the file /etc/sysconfig/network/ifcfg-<bond_name> as root in a text editor.
  2. Append the string "fail_over_mac=1" to the line starting with "BONDING_MODULE_OPTS", separating the string from the previous entries using a space.
    Example:
    BONDING_MODULE_OPTS="mode=active-backup miimon=100 fail_over_mac=1"
  3. Save the changes.
  4. Bring the bond down and up to put the changes into effect:
    # wicked ifdown <bond_name> 
    # wicked ifup <bond_name>

Using Netplan

Ubuntu Server uses Netplan as its network manager. Netplan parses YAML configuration files under /etc/netplan/ to setup the network. A bond can be set up to use active fail_over_mac as follows:

  1. Open the machine's Netplan configuration YAML file, and locate the section for the specific bond.
  2. Add fail-over-mac-policy: active under "parameters" as shown below. Use only spaces to indent the entry.
    
    network:  
      version: 2  
      renderer: networkd  
      bonds:    
       <bond_name>:      
        dhcp4: yes      
        interfaces:       
          - <iface_name>        
          - <iface_name>      
         parameters:        
          mode: active-backup        
          primary: <iface_name>        
          fail-over-mac-policy: active
  3. Run netplan apply as root to apply the changes:
    # netplan apply 

Using ip

If no network manager, such as NetworkManager or wicked, is present on the machine, the ip utility, part of the iproute2 package, can be used to configure fail_over_mac for a bond.

Note: Network configurations implemented using the ip utility are lost when the machine is shut down.
To set fail_over_mac to active for a new bond, issue a command of the following form:
# ip link add <bond_name> type bond mode active-backup miimon 100 fail_over_mac active
To set fail_over_mac to active for an existing bond, issue a command of the following form:
# ip link set <bond_name> down 
# ip link set <bond_name> type bond fail_over_mac active
# ip link set <bond_name> up

Verifying the setup

In /proc/net/bonding/<bond_name>, check if the string "(fail_over_mac active)" exists.

# cat /proc/net/bonding/<bond_name> | grep 'fail_over_mac active'

References