Working With Network Interface Teaming

Network interface teaming is similar to network interface bonding and provides a way of implementing link aggregation that's relatively maintenance-free, easier to reconfigure, expand, and debug, compared to bonding.

A lightweight kernel driver implements teaming and the teamd daemon implements load-balancing and failover schemes termed runners.

The following standard runners are defined:

activebackup

Monitors the link for changes and selects the active port that's used to send packets.

broadcast

Sends packets on all member ports.

lacp

Provides load balancing by implementing the Link Aggregation Control Protocol 802.3ad on the member ports.

loadbalance

In passive mode, uses the Berkeley Packet Filter (BPF) hash function to select the port that's used to send packets.

In active mode, uses a balancing algorithm to distribute outgoing packets over the available ports.

random

Selects a port at random to send each outgoing packet.

roundrobin

Sends packets over the available ports in a round-robin fashion.

For specialized applications, you can create customized runners that teamd can interpret. Use the teamdctl command to control the operation of teamd.

For more information, see the teamd.conf(5) manual page.

Configuring Network Interface Teaming

You can configure a teamed interface by creating JSON-format definitions that specify the properties of the team and each of its component interfaces. The teamd daemon then interprets these definitions. You can use the JSON-format definitions to create a team interface by starting the teamd daemon manually, by editing interface definition files in /etc/sysconfig/network-scripts, by using the nmcli command, or by using the Network Configuration editor (nm-connection-editor). The following task describes the first of these methods.

  1. Create a JSON-format definition file for the team and its component ports. For sample configurations, see the files under /usr/share/doc/teamd/example_configs/.

    The following example from activebackup_ethtool_1.conf defines an active-backup configuration where eth1 is configured as the primary port and eth2 as the backup port and these ports are monitored by ethtool.

    {
            "device":       "team0",
            "runner":       {"name": "activebackup"},
            "link_watch":   {"name": "ethtool"},
            "ports":        {
                    "eth1": {
                            "prio": -10,
                            "sticky": true
                    },
                    "eth2": {
                            "prio": 100
                    }
            }
    }
  2. Bring down the component ports.

    sudo ip link set eth1 down
    sudo ip link set eth2 down

    Note:

    Active interfaces can't be added to a team.

  3. Start an instance of the teamd daemon and have it create the teamed interface by reading the configuration file.

    In the following example, /root/team_config/team0.conf is used.

    sudo teamd -g -f /root/team_config/team0.conf -d
    Using team device "team0".
    Using PID file "/var/run/teamd/team0.pid"
    Using config file "/root/team_config/team0.conf"

    where the -g option displays debugging messages and can be omitted.

  4. Set the IP address and network mask prefix length of the teamed interface.

    sudo ip addr add 10.0.0.5/24 dev team0

For more information, see the teamd(8) manual page.

Adding Ports to and Removing Ports from a Team

To add a port to a team, use the teamdctl command:

sudo teamdctl team0 port add eth3 

To remove a port from a team:

sudo teamdctl team0 port remove eth3 

For more information, see the teamdctl(8) manual page.

Changing the Configuration of a Port in a Team

Use the teamdctl command to update the configuration of a constituent port of a team, for example:

sudo teamdctl team0 port config update eth1 '{"prio": -10, "sticky": false}'

Enclose the JSON-format definition in single quotes and don't split it over several lines.

For more information, see the teamdctl(8) manual page.

Removing a Team

Use the following command to halt the teamd daemon:

sudo teamd -t team0 -k

For more information, see the teamd(8) manual page.

Displaying Information About Teams

Display the network state of the teamed interface as follows:

sudo ip addr show dev team0
7: team0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 08:00:27:15:7a:f1 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.5/24 scope global team0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe15:7af1/64 scope link 
       valid_lft forever preferred_lft forever

Use the teamnl command to display information about the component ports of the team:

sudo teamnl team0 ports
 5: eth2: up 1000Mbit FD 
 4: eth1: up 1000Mbit FD 

To display the current state of the team, use the teamdctl command:

sudo teamdctl team0 state
setup:
  runner: activebackup
ports:
  eth1
    link watches:
      link summary: down
      instance[link_watch_0]:
        name: ethtool
        link: down
  eth2
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
runner:
  active port: em4

You can also use the teamdctl command to display the JSON configuration of the team and each of its constituent ports:

sudo teamdctl team0 config dump
{
    "device": "team0",
    "link_watch": {
        "name": "ethtool"
    },
    "mcast_rejoin": {
        "count": 1
    },
    "notify_peers": {
        "count": 1
    },
    "ports": {
        "eth1": {
            "prio": -10,
            "sticky": true
        },
        "eth2": {
            "prio": 100
        }
    },
    "runner": {
        "name": "activebackup"
    }
}

For more information, see the teamdctl(8) and teamnl(8) manual pages.