Network Teaming / Configuring Link Aggregation

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Network Teaming

Network teaming is a method of linking one or more NICs to to a virtual interface. This is in use for failover and higher throughput.

Teaming is a new method which comes from Centos7. It does not effect the older bonding driver in the Linux kernel.

The daemon used for teaming is teamd. The kernel handles network packets efficiently and teamd handles logic and interface processing.

Types of Mode/behavior/runner in teaming

Basically there are three types of runner in use broadly in 5 that mention in bold.

  1. Active Backup
  2. Round Robin
  3. Loadbalancer
  4. Broadcast
  5. lacp

Active Backup

In active backup one device will be in active mode and other will be in spare.

For example: If we have two interface as ens160 and ens224. If my all requests are going to ens160 and unfortunately if ens160 get down or crash then all requests will get forward to ens224. This process is known as fault-tolerance.

Round Robin

In case of Round robin both ens160 and ens224 port will be in active mode. One request is going to ens160 and second request will going to ens224.

If any one port get down then all the requests goes to another port.

Load Balancer

Both ports will be active at the same time. In this we define the packet size for each port. Because every ethernet port has its capturing power (1mbps or 2mbps). On the behalf of this if one ethernet port gets overflow then it will forward the requests to another port.

In industries point of view we use active backup and round robin. Company use load-balancer on application level.

Broadcast

A simple runner which transmits each packet from all ports.

Lacp

It implements the 802.3ad Link Aggregation Control Protocol. Can use the same transmit port selection possibilities as the load-balancer runner.

Important

All network interaction is going through a team interface, composed of multiple network port interfaces. When controlling teamed port interfaces using NetworkManager, and especially when fault finding, keep the following in mind:

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

Teaming Configuration

First we will check the available devices and active connections.

The nmcli command ca n be used to create and manage team and port interfaces. The following four steps a re used to create and activate a network team interface:

  1. Create the team interface.
  2. Determine the IPv4 and/or IPv6 attributes of the team interface.
  3. Assign the port interfaces.
  4. Bring the team and port interfaces up/down.

# nmcli device

# nmcli con show --active

active ports

Now we will create a team interface with active backup.

# nmcli con add type team con-name team0 ifname team0 autoconnect yes config '{ "runner": { "name": "activebackup" }}'

Network teaming

#nmcli con show

Network teaming
Here team0 is showing with its device name team0.
Now we will add slave for team(physical interface).

# nmcli connection add type team-slave con-name team0-ens160 ifname ens160 master team0

# nmcli connection add type team-slave con-name team0-ens224 ifname ens224 master team0

Network teaming

if we use DHCP networking then we only need to make connection up of both team slaves.

# nmcli con up team0-ens160

# nmcli con up team0-ens224

Network teaming

With DHCP team0 automatically take ip. And ens160 and ens224 device doesn’t have any ip.

Network teaming

Now you try by putting down any one interface you are able to ping this machine by another interface. Command to put down the interface.

# nmcli con down ens160

In case if you don’t have DHCP configuration of network in that case you need to assign manual ip to team0.

# nmcli connection modify team0 ipv4.method manual ipv4.addresses '192.168.0.100/24' ipv4.gateway '192.168.0.1'

Now make both slave connections up. As we did above.

How to check which runner is in use?

# teamdctl team0 state

Network teaming

If you want to change the runner of exiting team the use the below command.

# nmcli.config '{ "runner" : { "name" : "roundrobin" } }'

# nmcli con up team0

Managing Network Teaming

NetworkManager creates configuration files for network teaming in the /etc/sysconfig/network-scripts the same way it does for other interfaces. A
configuration file is created for each of the interfaces: for the team, and each of the ports.

The configuration file for the team interface defines the IP settings for the interface. The DEVICETYPE variable informs the initialization scripts this is a network team interface. Parameters for teamd configuration a redefined in the TEAM_CONFIG variable. Note that the contents of TEAM_CONFIG uses JSON syntax.

team interface file

The following is an example configuration file for a team port interface.

The DEVICETYPE variable informs the initialization scripts this is a team port interface. The TEAM_MASTER variable defines which team device it is a port for.

Slave interface file

In case of active backup if you want to set a specific port active then first you need to run below command. This command will show you the id of active port.

# teamnl team0 ports

Next command will show the active port. here it is showing activeport 3. Its for ens224.

# teamnl team0 getoption activeport

Now you will active the specific port by portid. use portid 2 for ens160.

# teamnl team0 setoption activeport 2

# nmcli con up team0

Network teaming

To take the dump of team device configuration.

# teamdctl team0 config dump > /tmp

Please comment and suggestions below. Thank you.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Mel
Melhttps://unixcop.com
Unix/Linux Guru and FOSS supporter

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook