3 minute read

Presentation

There are several ways to configure network teaming in RHEL 7:

  • using the nmtui command and a Text User Interface,
  • using the nmcli command at the Command Line Interface,
  • using the graphical interface,
  • through direct changes in the network configuration files.

For the rest of this tutorial, it is the nmcli option that has been chosen because it’s the quickest method and arguably the least prone to errors.

Prerequisites

To put into practice this tutorial, you need two VM and access to their respective console. Each VM has been installed with a base distribution (minimal distribution should work but was not tested). Each VM’s got two network interfaces called eth0 and eth1.

Install the teamd package:

# yum install -y teamd

If a previous network configuration was set up, remove it on both VM:

# nmcli con show
NAME                UUID                                  TYPE            DEVICE
Wired connection 1  f32cfcb7-3567-4313-9cf3-bdd87010c7a2  802-3-ethernet  eth1  
System eth0         257e9416-b420-4218-b1eb-f14302f20941  802-3-ethernet  eth0  
# nmcli con del f32cfcb7-3567-4313-9cf3-bdd87010c7a2
# nmcli con del 257e9416-b420-4218-b1eb-f14302f20941

Teaming Configuration

Execute the following steps at the console of both VM.

Create the teaming interface:

# nmcli con add type team con-name myteam0 ifname team0 config '{ "runner": {"name": "loadbalance"}}'
 team0 config '{ "runner": {"name": "loadbalance"}}'
[10655.288431] IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready
[10655.306955] team0: Mode changed to "loadbalance"
Connection 'myteam0' (ab0a5f7b-2547-4d4f-8fc8-834030839fc1) successfully added.

Note1: If you don’t specify con-name myteam0, the teaming interface will be named team-team0. Note2: Examples of configuration are available in the /usr/share/doc/teamd-*/example_configs. You can also get some examples through man teamd.conf.

Now, the file/etc/sysconfig/network-scripts/ifcfg-myteam0 contains the main following lines:

DEVICE=team0
TEAM_CONFIG="{ \"runner\": {\"name\": \"loadbalance\"}}"
DEVICETYPE=Team
NAME=myteam0
ONBOOT=yes

Add an IPv4 configuration: In RHEL 7.0:

# nmcli con mod myteam0 ipv4.addresses "192.168.1.10/24 192.168.1.1"
# nmcli con mod myteam0 ipv4.method manual

From RHEL 7.1 on:

# nmcli con mod myteam0 ipv4.addresses 192.168.1.10/24
# nmcli con mod myteam0 ipv4.gateway 192.168.1.1
# nmcli con mod myteam0 ipv4.method manual

Note: If you don’t specify any IP configuration, both VM will get their ip address and gateway through DHCPby default.

Add the eth0 interface to the teaming interface:

# nmcli con add type team-slave con-name team0-slave0 ifname eth0 master team0
[10707.777803] team0: Port device eth0 added
[10707.779146] IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready
Connection 'team0-slave0' (a9a5b612-aad6-48b0-a097-88db35c898d3) successfully added.

Note1: If you don’t specify con-name team0-slave0, the teaming slave interface will be named team-slave-eth0. Note2: The file/etc/sysconfig/network-scripts/ifcfg-team0-slave0 has been created with the following main lines:

NAME=team0-slave0
DEVICE=eth0
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort

Add the eth1 interface to the teaming interface:

# nmcli con add type team-slave con-name team0-slave1 ifname eth1 master team0
[10750.419419] team0: Port device eth1 added
Connection 'team0-slave1' (e468dce3-a032-4088-8173-e7bee1bd4ad5) successfully added.

Note1: If you don’t specify con-name team0-slave1, the teaming slave interface will be named team-slave-eth1. Note2: The file/etc/sysconfig/network-scripts/ifcfg-team0-slave1 has been created with the following main lines:

NAME=team0-slave1
DEVICE=eth1
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort

Activate the teaming interface:

# nmcli con up myteam0
[10818.800169] team0: Port device eth1 removed
[10818.803399] team0: Port device eth0 removed
[10818.939884] team0: Port device eth1 added
[10818.941069] IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready
[10818.971887] team0: Port device eth0 added
[10819.932168] IPv6: team0: IPv6 duplicate address fe80::5054:ff:fe3f:860a detected!
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/32)

Check the configuration:

# nmcli con show
NAME          UUID                                  TYPE            DEVICE
team0-slave0  a9a5b612-aad6-48b0-a097-88db35c898d3  802-3-ethernet  eth0
myteam0       ab0a5f7b-2547-4d4f-8fc8-834030839fc1  team            team0
team0-slave1  e468dce3-a032-4088-8173-e7bee1bd4ad5  802-3-ethernet  eth1

You can also use the teamdctl command to check the configuration state:

# teamdctl team0 state
setup:
  runner: loadbalance
ports:
  eth0
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
  eth1
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up

Or to dump the configuration:

# teamdctl team0 config dump
{
"device": "team0",
"ports": {
"eth0": {
"link_watch": {
"name": "ethtool"
}
},
"eth1": {
"link_watch": {
"name": "ethtool"
}
}
},
"runner": {
"name": "loadbalance",
"tx_hash": [
"eth",
"ipv4",
"ipv6"
]
}
}

You can also get the ports status with the teamnl command:

# teamnl team0 ports
 2: eth0: up 0Mbit HD
 3: eth1: up 0Mbit HD

In addition, you can directly change the content of the files in the /etc/sysconfig/network-scripts directory but you need to apply the following command afterwards:

# nmcli con reload

Source: RHEL 7 Networking Guide and nmcli-examples man page.

Exam Tip

If you don’t remember all the details the day of the exam, get the information in the nmcli-examples and teamd.conf man pages or in the /usr/share/doc/teamd-*/example_ifcfgs and /usr/share/doc/teamd-*/example_ifcfgs directories.

Additional Resources

The RootUsers website’s got an interesting tutorial about Configuring Network Teaming in Linux. Venkat Nagappan provides a nice video about Setting up Network Teaming and Bridging (20min/2015).

Leave a comment