Linux Networking Teaming

Types and Configuration with Examples

What is Network Teaming?

Network teaming is a method of combining multiple network interfaces into a single logical interface to provide redundancy and increased throughput. It is commonly used in Linux systems for high availability and load balancing.

Types of Network Teaming

Configuration Example

Below is an example of configuring network teaming in Linux:

Step 1: Install the Teaming Tools

sudo yum install teamd
            

Step 2: Create a Teaming Configuration File

sudo vim /etc/sysconfig/network-scripts/ifcfg-team0
            

Example content for ifcfg-team0:

DEVICE=team0
DEVICETYPE=Team
ONBOOT=yes
BOOTPROTO=none
TEAM_CONFIG='{
    "runner": {"name": "activebackup"},
    "link_watch": {"name": "ethtool"}
}'
            

Step 3: Add Ports to the Team

Create configuration files for the ports:

sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
            

Example content for ifcfg-eth0:

DEVICE=eth0
ONBOOT=yes
MASTER=team0
SLAVE=yes
            

Repeat for other interfaces (e.g., eth1).

Step 4: Restart the Network Service

sudo systemctl restart network
            

Checking Teaming Status

To check the status of the teaming configuration, use:

teamdctl team0 state
            

This command will display the current state of the team, including active ports and their statuses.

Teaming configuration using by command

Network teaming can also be configured using the teamd command. Below is an example of how to create a team using the command line:

Step 1: Create a Team


sudo nmcli connection add type team con-name myteam ifname team0 config '{"runner": {"name": "activebackup"}}'

Step 2: Add Ports to the Team


sudo nmcli connection add type team-slave con-name myteam-slave1 ifname eth0 master team0
sudo nmcli connection add type team-slave con-name myteam-slave2 ifname eth1 master team0

            

Step 3: Assign a IPaddress to Team bond


nmcli connection modify team1 ipv4.addresses 192.168.0.100/24 gw4 192.168.0.1 ipv4.dns 8.8.8.8 ipv4.method manual
            

Step 4: Bring Up the Team


sudo nmcli connection up myteam
            

This will create a team named myteam with eth0 and eth1 as its members.

Step 5: Verify the Teaming Configuration


nmcli connection show
            

This command will display the current network connections, including the team and its members.

Step 6: To check Team information


teamdctl team0 state
            

This command will display the current state of the team, including active ports and their statuses.