Chapter 10. Configuring network teaming

This section describes the basics of network teaming, the differences between bonding and teaming, and how to configure a network team on Red Hat Enterprise Linux.

Important

Network teaming is deprecated in Red Hat Enterprise Linux 9. Consider using the network bonding driver as an alternative. For details, see Configuring network bonding.

You can create network teams on different types of devices, such as:

  • Physical and virtual Ethernet devices
  • Network bonds
  • Network bridges
  • VLAN devices

10.1. Migrating a network team configuration to network bond

Network teaming is deprecated in Red Hat Enterprise Linux 9. If you already have a working network team configured, for example because you upgraded from an earlier RHEL version, you can migrate the configuration to a network bond that is managed by NetworkManager.

Important

The team2bond utility only converts the network team configuration to a bond. Afterwards, you must manually configure further settings of the bond, such as IP addresses and DNS configuration.

Prerequisites

  • The team-team0 NetworkManager connection profile is configured and manages the team0 device.
  • The teamd package is installed.

Procedure

  1. Optional: Display the IP configuration of the team-team0 NetworkManager connection:

    # nmcli connection show team-team0 | egrep "^ip"
    ...
    ipv4.method:                            manual
    ipv4.dns:                               192.0.2.253
    ipv4.dns-search:                        example.com
    ipv4.addresses:                         192.0.2.1/24
    ipv4.gateway:                           192.0.2.254
    ...
    ipv6.method:                            manual
    ipv6.dns:                               2001:db8:1::fffd
    ipv6.dns-search:                        example.com
    ipv6.addresses:                         2001:db8:1::1/64
    ipv6.gateway:                           2001:db8:1::fffe
    ...
  2. Export the configuration of the team0 device to a JSON file:

    # teamdctl team0 config dump actual > /tmp/team0.json
  3. Remove the network team. For example, if you configured the team in NetworkManager, remove the team-team0 connection profile and the profiles of associated ports:

    # nmcli connection delete team-team0
    # nmcli connection delete team-team0-port1
    # nmcli connection delete team-team0-port2
  4. Run the team2bond utility in dry-run mode to display nmcli commands that set up a network bond with similar settings as the team device:

    # team2bond --config=/tmp/team0.json --rename=bond0
    nmcli con add type bond ifname bond0 bond.options "mode=active-backup,num_grat_arp=1,num_unsol_na=1,resend_igmp=1,miimon=100,miimon=100"
    nmcli con add type ethernet ifname enp7s0 master bond0
    nmcli con add type ethernet ifname enp8s0 master bond0

    The first command contains two miimon options because the team configuration file contained two link_watch entries. Note that this does not affect the creation of the bond.

    If you bound services to the device name of the team and want to avoid updating or breaking these services, omit the --rename=bond0 option. In this case, team2bond uses the same interface name for the bond as for the team.

  5. Verify that the options for the bond the team2bond utility suggested are correct.
  6. Create the bond. You can execute the suggested nmcli commands or re-run the team2bond command with the --exec-cmd option:

    # team2bond --config=/tmp/team0.json --rename=bond0 --exec-cmd
    Connection 'bond-bond0' (0241a531-0c72-4202-80df-73eadfc126b5) successfully added.
    Connection 'bond-slave-enp7s0' (38489729-b624-4606-a784-1ccf01e2f6d6) successfully added.
    Connection 'bond-slave-enp8s0' (de97ec06-7daa-4298-9a71-9d4c7909daa1) successfully added.

    You require the name of the bond connection profile (bond-bond0) in the next steps.

  7. Set the IPv4 settings that were previously configured on team-team0 to the bond-bond0 connection:

    # nmcli connection modify bond-bond0 ipv4.addresses '192.0.2.1/24'
    # nmcli connection modify bond-bond0 ipv4.gateway '192.0.2.254'
    # nmcli connection modify bond-bond0 ipv4.dns '192.0.2.253'
    # nmcli connection modify bond-bond0 ipv4.dns-search 'example.com'
    # nmcli connection modify bond-bond0 ipv4.method manual
  8. Set the IPv6 settings that were previously configured on team-team0 to the bond-bond0 connection:

    # nmcli connection modify bond-bond0 ipv6.addresses '2001:db8:1::1/64'
    # nmcli connection modify bond-bond0 ipv6.gateway '2001:db8:1::fffe'
    # nmcli connection modify bond-bond0 ipv6.dns '2001:db8:1::fffd'
    # nmcli connection modify bond-bond0 ipv6.dns-search 'example.com'
    # nmcli connection modify bond-bond0 ipv6.method manual
  9. Activate the connection:

    # nmcli connection up bond-bond0

Verification

  1. Display the IP configuration of the bond-bond0 NetworkManager connection:

    # nmcli connection show bond-bond0 | egrep "^ip"
    ...
    ipv4.method:                            manual
    ipv4.dns:                               192.0.2.253
    ipv4.dns-search:                        example.com
    ipv4.addresses:                         192.0.2.1/24
    ipv4.gateway:                           192.0.2.254
    ...
    ipv6.method:                            manual
    ipv6.dns:                               2001:db8:1::fffd
    ipv6.dns-search:                        example.com
    ipv6.addresses:                         2001:db8:1::1/64
    ipv6.gateway:                           2001:db8:1::fffe
    ...
  2. Display the status of the bond:

    # cat /proc/net/bonding/bond0
    Ethernet Channel Bonding Driver: v5.13.0-0.rc7.51.el9.x86_64
    
    Bonding Mode: fault-tolerance (active-backup)
    Primary Slave: None
    Currently Active Slave: enp7s0
    MII Status: up
    MII Polling Interval (ms): 100
    Up Delay (ms): 0
    Down Delay (ms): 0
    Peer Notification Delay (ms): 0
    
    Slave Interface: enp7s0
    MII Status: up
    Speed: Unknown
    Duplex: Unknown
    Link Failure Count: 0
    Permanent HW addr: 52:54:00:bf:b1:a9
    Slave queue ID: 0
    
    Slave Interface: enp8s0
    MII Status: up
    Speed: Unknown
    Duplex: Unknown
    Link Failure Count: 0
    Permanent HW addr: 52:54:00:04:36:0f
    Slave queue ID: 0

    In this example, both ports are up.

  3. To verify that bonding failover works:

    1. Temporarily remove the network cable from the host. Note that there is no method to properly test link failure events using the command line.
    2. Display the status of the bond:

      # cat /proc/net/bonding/bond0

10.2. Understanding network teaming

Network teaming is a feature that combines or aggregates network interfaces to provide a logical interface with higher throughput or redundancy.

Network teaming uses a kernel driver to implement fast handling of packet flows, as well as user-space libraries and services for other tasks. This way, network teaming is an easily extensible and scalable solution for load-balancing and redundancy requirements.

Important

Certain network teaming features, such as the fail-over mechanism, do not support direct cable connections without a network switch. For further details, see Is bonding supported with direct connection using crossover cables?

10.3. Understanding the default behavior of controller and port interfaces

Consider the following default behavior of, when managing or troubleshooting team or bond port interfaces using the NetworkManager service:

  • Starting the controller interface does not automatically start the port interfaces.
  • Starting a port interface always starts the controller interface.
  • Stopping the controller interface also stops the port interface.
  • A controller without ports can start static IP connections.
  • A controller without ports waits for ports when starting DHCP connections.
  • A controller with a DHCP connection waiting for ports completes when you add a port with a carrier.
  • A controller with a DHCP connection waiting for ports continues waiting when you add a port without carrier.

10.5. Installing the teamd service

To configure a network team in NetworkManager, you require the teamd service and the team plug-in for NetworkManager. Both are installed on Red Hat Enterprise Linux by default. This section describes how you install the required packages in case that you remove them.

Prerequisites

  • An active Red Hat subscription is assigned to the host.

Procedure

  • Install the teamd and NetworkManager-team packages:

    # yum install teamd NetworkManager-team

10.6. Configuring a network team using nmcli commands

This section describes how to configure a network team using nmcli utility.

Important

Network teaming is deprecated in Red Hat Enterprise Linux 9. Consider using the network bonding driver as an alternative. For details, see Configuring network bonding.

Prerequisites

Procedure

  1. Create a team interface:

    # nmcli connection add type team con-name team0 ifname team0 team.runner activebackup

    This command creates a network team named team0 that uses the activebackup runner.

  2. Optionally, set a link watcher. For example, to set the ethtool link watcher in the team0 connection profile:

    # nmcli connection modify team0 team.link-watchers "name=ethtool"

    Link watchers support different parameters. To set parameters for a link watcher, specify them space-separated in the name property. Note that the name property must be surrounded by quotes. For example, to use the ethtool link watcher and set its delay-up parameter to 2500 milliseconds (2.5 seconds):

    # nmcli connection modify team0 team.link-watchers "name=ethtool delay-up=2500"

    To set multiple link watchers and each of them with specific parameters, the link watchers must be separated by a comma. The following example sets the ethtool link watcher with the delay-up parameter and the arp_ping link watcher with the source-host and target-host parameter:

    # nmcli connection modify team0 team.link-watchers "name=ethtool delay-up=2, name=arp_ping source-host=192.0.2.1 target-host=192.0.2.2"
  3. Display the network interfaces, and note the names of the interfaces you want to add to the team:

    # nmcli device status
    DEVICE  TYPE      STATE         CONNECTION
    enp7s0  ethernet  disconnected  --
    enp8s0  ethernet  disconnected  --
    bond0   bond      connected  bond0
    bond1   bond      connected  bond1
    ...

    In this example:

    • enp7s0 and enp8s0 are not configured. To use these devices as ports, add connection profiles in the next step. Note that you can only use Ethernet interfaces in a team that are not assigned to any connection.
    • bond0 and bond1 have existing connection profiles. To use these devices as ports, modify their profiles in the next step.
  4. Assign the port interfaces to the team:

    1. If the interfaces you want to assign to the team are not configured, create new connection profiles for them:

      # nmcli connection add type ethernet slave-type team con-name team0-port1 ifname enp7s0 master team0
      # nmcli connection add type ethernet slave-type team con-name team0-port2 ifname enp8s0 master team0

      . These commands create profiles for enp7s0 and enp8s0, and add them to the team0 connection.

    2. To assign an existing connection profile to the team, set the master parameter of these connections to team0:

      # nmcli connection modify bond0 master team0
      # nmcli connection modify bond1 master team0

      These commands assign the existing connection profiles named bond0 and bond1 to the team0 connection.

  5. Configure the IP settings of the team. Skip this step if you want to use this team as a ports of other devices.

    1. Configure the IPv4 settings. For example, to set a static IPv4 address, network mask, default gateway, DNS server, and DNS search domain the team0 connection, enter:

      # nmcli connection modify team0 ipv4.addresses '192.0.2.1/24'
      # nmcli connection modify team0 ipv4.gateway '192.0.2.254'
      # nmcli connection modify team0 ipv4.dns '192.0.2.253'
      # nmcli connection modify team0 ipv4.dns-search 'example.com'
      # nmcli connection modify team0 ipv4.method manual
    2. Configure the IPv6 settings. For example, to set a static IPv6 address, network mask, default gateway, DNS server, and DNS search domain of the team0 connection, enter:

      # nmcli connection modify team0 ipv6.addresses '2001:db8:1::1/64'
      # nmcli connection modify team0 ipv6.gateway '2001:db8:1::fffe'
      # nmcli connection modify team0 ipv6.dns '2001:db8:1::fffd'
      # nmcli connection modify team0 ipv6.dns-search 'example.com'
      # nmcli connection modify team0 ipv6.method manual
  6. Activate the connection:

    # nmcli connection up team0

Verification steps

  • Display the status of the team:

    # teamdctl team0 state
    setup:
      runner: activebackup
    ports:
      enp7s0
        link watches:
          link summary: up
          instance[link_watch_0]:
            name: ethtool
            link: up
            down count: 0
      enp8s0
        link watches:
          link summary: up
          instance[link_watch_0]:
            name: ethtool
            link: up
            down count: 0
    runner:
      active port: enp7s0

    In this example, both ports are up.

Additional resources

10.7. Configuring a network team using nm-connection-editor

This section describes how you configure a network team using the nm-connection-editor application.

Note that nm-connection-editor can add only new ports to a team. To use an existing connection profile as a port, create the team using the nmcli utility as described in Configuring a network team using nmcli commands.

Important

Network teaming is deprecated in Red Hat Enterprise Linux 9. Consider using the network bonding driver as an alternative. For details, see Configuring network bonding.

Prerequisites

  • Two or more physical or virtual network devices are installed on the server.
  • To use Ethernet devices as ports of the team, the physical or virtual Ethernet devices must be installed on the server.
  • To use team, bond, or VLAN devices as ports of the team, ensure that these devices are not already configured.

Procedure

  1. Open a terminal, and enter nm-connection-editor:

    $ nm-connection-editor
  2. Click the + button to add a new connection.
  3. Select the Team connection type, and click Create.
  4. In the Team tab:

    1. Optional: Set the name of the team interface in the Interface name field.
    2. Click the Add button to add a new connection profile for a network interface and adding the profile as a port to the team.

      1. Select the connection type of the interface. For example, select Ethernet for a wired connection.
      2. Optional: Set a connection name for the port.
      3. If you create a connection profile for an Ethernet device, open the Ethernet tab, and select in the Device field the network interface you want to add as a port to the team. If you selected a different device type, configure it accordingly. Note that you can only use Ethernet interfaces in a team that are not assigned to any connection.
      4. Click Save.
    3. Repeat the previous step for each interface you want to add to the team.

      add nic to team in nm connection editor

    4. Click the Advanced button to set advanced options to the team connection.

      1. In the Runner tab, select the runner.
      2. In the Link Watcher tab, set the link watcher and its optional settings.
      3. Click OK.
  5. Configure the IP settings of the team. Skip this step if you want to use this team as a port of other devices.

    1. In the IPv4 Settings tab, configure the IPv4 settings. For example, set a static IPv4 address, network mask, default gateway, DNS server, and DNS search domain: team IPv4 settings nm connection editor
    2. In the IPv6 Settings tab, configure the IPv6 settings. For example, set a static IPv6 address, network mask, default gateway, DNS server, and DNS search domain: team IPv6 settings nm connection editor
  6. Save the team connection.
  7. Close nm-connection-editor.

Verification steps

  • Display the status of the team:

    # teamdctl team0 state
    setup:
      runner: activebackup
    ports:
      enp7s0
        link watches:
          link summary: up
          instance[link_watch_0]:
            name: ethtool
            link: up
            down count: 0
      enp8s0
        link watches:
          link summary: up
          instance[link_watch_0]:
            name: ethtool
            link: up
            down count: 0
    runner:
      active port: enp7s0