User Tools

Site Tools


interface_teaming

This is an old revision of the document!


Interface Teaming

Apr 2021


Overview


Interface teaming is the grouping of interfaces, that share a single IP Address, the OS controls which interface responds to the physical address.

There are two technologies around, Bonding and Teaming. Bonding seems to mainly be more about aggregating links, so if you have 2 x 1GB interfaces, you can in theory bond them to create a 2GB link, this does provide redundancy if one of the links goes down.

It seems that Teaming is becoming the more widely used technology for pure redundancy though, and teaming is just that, taking a couple of interfaces and making them a 'team' where either can respond (in the case that one fails).


Requirements


In this example, we are going to team two interfaces, eth0 and eth1. eth0 is already configured with a static IP Address configuration, so some editing will be required.

In short, to test teaming you will need two interfaces on your server, you can re-purpose the interface(s) being used for management, or use two free ones on another subnet.

You can either plug both interfaces in to the same vlan on a switch, or use two switches that have a link between them.


File Structure


In this example I am using CentOS, this this procedure may differ for other Linux Distros. Firstly navigate to the following directory.

  /etc/sysconfig/network-scripts/



If you list the files in this directory (ls) you will see the following:

-rw-r--r--. 1 root root   259 Apr  8 21:32 ifcfg-eth0
-rw-r--r--. 1 root root   177 Apr  8 21:31 ifcfg-eth1
-rw-r--r--. 1 root root   254 Aug 24  2018 ifcfg-lo


(I have only listed the ifcfg files, not all of the files in this directory) So this server only has two physical interfaces, eth0 and eth1.

In the ifcfg-eth0 we see the following configuration:

NAME="eth0"
DEVICE="eth0"
ONBOOT=yes
NETBOOT=yes
BOOTPROTO=static
TYPE=Ethernet
# HWADDR key is mandatory to use custom interface name: do not delete it
HWADDR=0c:c4:7a:d9:0b:0c
IPADDR=192.168.1.150
PREFIX=24
GATEWAY=192.168.1.1
DNS1=192.168.1.4
DNS2=8.8.8.8



In the eth1 file we see the following configuration:

NAME="eth1"
DEVICE="eth1"
ONBOOT=yes
NETBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
# HWADDR key is mandatory to use custom interface name: do not delete it
HWADDR=0c:c4:7a:d9:0b:0d


We are going to have to modify the ifcfg-eth0 and ifcfg-eth1 files, but before this we need to create a 'team' file. This file can have almost anyname you like, but mostly we see team files that have names like team0 or mngt etc.


Create Team File


The team file is going to have all the information regarding the network settings, so most of the settings that are currently in the ifcfg-eth0 in this example.

To create the team file, use the following: (use your own IP / MAC details of course)

vi /etc/sysconfig/network-scripts/ifcfg-mngt
DEVICE=mngt
DEVICETYPE=Team
ONBOOT=yes
BOOTPROTO=static
NM_CONTROLLED=yes
IPADDR=192.168.1.150
PREFIX=24
GATEWAY=192.168.1.1
DNS1=192.168.1.4
DNS2=8.8.8.8
TEAM_CONFIG='{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}'


interface_teaming.1617915849.txt.gz · Last modified: 2023/03/09 22:35 (external edit)