How to Configure Network Teaming in CentOS/RHEL 7

Assalamualaikum,

On network servers, it is an important requirement to ensure that the network interface is available at all times. On Red Hat Enterprise Linux 7, you can create aggregated network interfaces. Use network teaming or network bonding to accomplish this goal.

On earlier versions of Red Hat Enterprise Linux, network bonding was used to accomplish the same goals. Network teaming is new in Red Hat Enterprise Linux 7. The solution consists of a small kernel driver and a daemon that is available in userspace: teamd.

Installing teamd
# yum install teamd

Create team0

Go to the /etc/sysconfig/network-scripts directory and create “ifcfg-team0” file as shown below:

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

DEVICE=team0
DEVICETYPE=Team
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
IPADDR=192.168.88.1
PREFIX=24
TEAM_CONFIG='{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}'

Note:

  • Roundrobin – This is the default that we are using, it simply sends packets to all interfaces in the team in a round robin manner, that is one at a time followed by the next interface.
  • Broadcast – All traffic is sent over all ports.
  • Activebackup – One interface is in use while the other is set aside as a backup, the link is monitored for changes and will use the failover link if needed.
  • Loadbalance – Traffic is balanced over all interfaces based on Tx traffic, equal load should be shared over available interfaces.
  • Lacp – Implements 802.3ad LACP protocol.

Modify enps03
Go to the /etc/sysconfig/network-scripts directory and create “ifcfg-enps03” file as shown below:

DEVICE=enp0s3
#HWADDR=D4:85:64:01:46:9E
DEVICETYPE=TeamPort
ONBOOT=yes
TEAM_MASTER=team0
NM_CONTROLLED=no
TEAM_PORT_CONFIG='{"prio": 100}'

Modify enps09
Go to the /etc/sysconfig/network-scripts directory and create “ifcfg-enps09” file as shown below:

DEVICE=enp0s9
#HWADDR=D4:85:64:01:46:9E
DEVICETYPE=TeamPort
ONBOOT=yes
TEAM_MASTER=team0
NM_CONTROLLED=no
TEAM_PORT_CONFIG='{"prio": 100}'

Make sure both the interface are down:

# ip link set enp0s3 down
# ip link set enp0s8 down

Now you can bring up your interface

# ifup team0

Verify the teaming configuration

# ip addr
team0:  mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 08:00:27:2e:4c:65 brd ff:ff:ff:ff:ff:ff
inet 192.168.57.101/24 brd 192.168.57.255 scope global dynamic team0
valid_lft 1178sec preferred_lft 1178sec
inet6 fe80::a00:27ff:fe2e:4c65/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
# nmcli device status
DEVICE TYPE STATE CONNECTION
enp0s8 ethernet unmanaged --
enp0s9 ethernet unmanaged --
team0 team unmanaged --
# teamdctl team0 state
setup:
runner: activebackup
ports:
enp0s8
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
enp0s9
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
runner:
active port: enp0s8

Removing a Team
To terminate, or kill, an instance of the team daemon use the below command:

# teamd -t team0 -k

thanks

 

This entry was posted in Linux and tagged , , , , , . Bookmark the permalink.