RHEL/CentOS 7: Creating a Teamed Interface (Interface Bonding)

0
49

Interface teaming, interface bonding, and link aggregation are all the same. It was already implemented in the kernel by way of the bonding driver. The team driver provides a different mechanism (from bonding) to team multiple network interfaces into a single logical one.

To set up a teamed interface, we’ll need more than one network interface.

For the sake of ease, our physical network interfaces are called eth1 and eth2. The IPv4 address for the team interface is 10.0.0.2, with a subnet mask of 255.0.0.0 and a default gateway of 10.0.0.1.

Creating the teamed interface using nmcli

Using this approach, we’ll need to create the team connection and two team slaves and activate the connection, as follows:

  1. Use the following command line to create the team connection:
    ~]# nmcli connection add type team ip4 10.0.0.2/8 gw4 10.0.0.1
    Connection 'team' (cfa46865-deb0-49f2-9156-4ca5461971b4) successfully added.
    ~]#
    
  2. Add eth1 to the team by executing the following:
    ~]# nmcli connection add type team-slave ifname eth1 master team
    Connection 'team-slave-eth1' (01880e55-f9a5-477b-b194-73278ef3dce5) successfully added.
    ~]#
    
  3. Now, add eth2 to the team by running the following command:
    ~]# nmcli connection add type team-slave ifname eth2 master team
    Connection 'team-slave-eth2' (f9efd19a-905f-4538-939c-3ea7516c3567) successfully added.
    ~]#
    
  4. Bring the team up, as follows:
    ~]# nmcli connection up team
    Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)
    ~]#
    
  5. Finally, check your network connections through the following commands:
    ~]# nmcli connection show
    ~]# nmcli device status
    ~]# nmcli device show nm-team
    

    Here’s an example output of the preceding commands:

creating-teamed-interface-1

Creating the teamed interface using nmtui

Let’s fire up nmtui and add a connection through the following steps:

  1. First, create a team connection by selecting <Add>:

creating-teamed-interface-2

     2. Enter the requested information in the following form and click on <Add> for every interface to add:

creating-teamed-interface-3

     3. Next, select <Add> within team slaves to add an interface by filling out the form and selecting <OK>. Repeat this for every physical interface

creating-teamed-interface-4

     4. Now, select <OK> to create the team interface:

creating-teamed-interface-5

Your new team interface will now be listed in the connections list, as shown in the following screenshot:

creating-teamed-interface-6

Creating the teamed interface with kickstart

Open your kickstart file with your favorite editor and perform the following steps:

  1. Look for the network configuration parameters within your kickstart file by running the following command:
    ...
    network --device=eth0
    ...
  2. Next, add the following configuration parameters:
    network --device=team0 --teamslaves="eth1,eth2" --bootproto=static --ip=10.0.0.2 --netmask=255.0.0.0 --gateway=10.0.0.1

Teaming comes with runners—a way of load-sharing backup methods that you can assign to your team:

  • active-backup: In this, one physical interface is used, while the others are kept as backup
  • broadcast: In this, data is transmitted over all physical interfaces’ selectors
  • LACP: This implements 802.3ad Link Aggregation Control Protocol
  • loadbalance: This performs active Tx load balancing and uses a BPF-based Tx port
  • round-robin: The data is transmitted over all physical interfaces in turn

These can also be defined upon creation using either of the presented options here:

nmcli

Add team.config "{\"runner\":{\"name\": \"activebackup\"}}" to your command to create your team interface, and substitute activebackup with the runner that you wish to use.

nmtui

Fill out the JSON configuration field for the team interface with {"runner": {"name": "activebackup"}}, and substitute activebackup with the runner that you wish to use.

creating-teamed-interface-7

kickstart

Add --teamconfig="{\"runner\":{\"name\": \"activebackup\"}}" to your team device line, and substitute activebackup with the runner that you wish to use.

The options provided to create the team interface are bare bones using nmcli. If you wish to add a connection and interface name, use con-name and ifname, respectively, in this way:

~]# nmcli connection add type team con-name team0 ifname team0 ip4 10.0.0.2/8 gw4 10.0.0.1
Connection 'team0' (e1856313-ecd4-420e-96d5-c76bc00794aa) successfully added.
~]#

The same is true for adding the team slaves, except for ifname, which is required to specify the correct interface:

~# nmcli connection add type team-slave con-name team0-slave0 ifname eth1 master team0
Connection 'team0-slave0' (3cb2f603-1f73-41a0-b476-7a356d4b6274) successfully added.
~# nmcli connection add type team-slave con-name team0-slave1 ifname eth2 master team0
Connection 'team0-slave1' (074e4dd3-8a3a-4997-b444-a781114c58c9) successfully added.
~#

LEAVE A REPLY

Please enter your comment!
Please enter your name here