16 C
Texas
Melhttp://www.osradar.com
Guru Unix /Linux and GNU supporter

Configure Teaming in Redhat or Centos7

Link aggregationThe combining or aggregating of network links to provide a logical link with higher throughput, or to provide redundancy, is known by many names, for example channel bondingEthernet bondingport trunkingchannel teamingNIC teaming, or link aggregation. This concept as originally implemented in the Linux kernel is widely referred to as bonding. The term Network Teaming has been chosen to refer to this new implementation of the concept. The existing bonding driver is unaffected, Network Teaming is offered as an alternative and does not replace bonding in Red Hat Enterprise Linux 7.

Lets show you my example direct from my VMware Worstation:

I’am using Centos 7.4 with 3 Ethernet cards. Eth0  Eth1 Eth2

With nmcli command you can see the active devices

- Advertisement -

 Ifconfig  or Ip a  to see the assigned IP addresses.

Ip Eth0  = 192.168.65.130

Lets create an team

[root@osradar_com ~]# nmcli con add type team con-name osradar ifname team1 config '{"runner": {"name":"activebackup"}}'
Connection 'osradar' (ac5f2bbd-ac3b-407a-aab7-194cd8ccef9c) successfully added.

Check now the devices  status

[root@osradar_com ~]# nmcli dev status
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected eth0
team1 team connecting (getting IP configuration) osradar
eth1 ethernet disconnected --
eth2 ethernet disconnected --
lo loopback unmanaged --
[root@osradar_com ~]#

Now lets set  IP address to the team connection name created  (osradar), and make it as  Static Ip address and autoconnect  everytime system rebooted

[root@osradar_com ~]# nmcli con mod osradar ipv4.addresses 192.168.65.150/24
[root@osradar_com ~]# nmcli con mod osradar ipv4.method manual
[root@osradar_com ~]# nmcli con mod osradar connection.autoconnect yes

Check the created configuration:

[root@osradar_com ~]# cat /etc/sysconfig/network-scripts/ifcfg-osradar
DEVICE=team1
TEAM_CONFIG="{\"runner\": {\"name\":\"activebackup\"}}"
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=osradar
UUID=ac5f2bbd-ac3b-407a-aab7-194cd8ccef9c
ONBOOT=yes
DEVICETYPE=Team
IPADDR=192.168.65.150
PREFIX=24

Now Lets Join the Ethernet cards eth1  en eth2  to this created team (osradar),

[root@osradar_com ~]# nmcli con add type team-slave con-name osradar-slave1 ifname eth1 master osradar
Connection 'osradar-slave1' (3f26c5eb-b0af-4f1c-8041-b851ea5b8f4f) successfully added.
[root@osradar_com ~]# nmcli con add type team-slave con-name osradar-slave2 ifname eth2 master osradar
Connection 'osradar-slave2' (bbc87f5a-5654-4d85-ac35-1aedb948dfe8) successfully added.

Lets  start  the  team (osradar)

[root@osradar_com ~]# nmcli con up osradar
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
[root@osradar_com ~]#

looks like its  started successfully .

Check now the connection and device status

[root@osradar_com ~]# nmcli con show
NAME UUID TYPE DEVICE
eth0 84cad80a-0c42-4540-90c6-9209735e8ea8 802-3-ethernet eth0
osradar ac5f2bbd-ac3b-407a-aab7-194cd8ccef9c team team1
osradar-slave1 f91637e8-f053-4e1c-b3dc-88cbf5d9c927 802-3-ethernet eth1
osradar-slave2 bbc87f5a-5654-4d85-ac35-1aedb948dfe8 802-3-ethernet eth2
osradar-slave1 3f26c5eb-b0af-4f1c-8041-b851ea5b8f4f 802-3-ethernet --
[root@osradar_com ~]# nmcli dev status
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected eth0
eth1 ethernet connected osradar-slave1
eth2 ethernet connected osradar-slave2
team1 team connected osradar
lo loopback unmanaged --
[root@osradar_com ~]#

IPconfig :

[root@osradar_com ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
 inet 192.168.65.130 netmask 255.255.255.0 broadcast 192.168.65.255
 inet6 fe80::8505:a707:7a1a:65f9 prefixlen 64 scopeid 0x20<link>
 ether 00:0c:29:1e:89:e2 txqueuelen 1000 (Ethernet)
 RX packets 6835 bytes 589780 (575.9 KiB)
 RX errors 0 dropped 0 overruns 0 frame 0
 TX packets 4836 bytes 476186 (465.0 KiB)
 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
 ether 00:0c:29:1e:89:ec txqueuelen 1000 (Ethernet)
 RX packets 14 bytes 1406 (1.3 KiB)
 RX errors 0 dropped 0 overruns 0 frame 0
 TX packets 38 bytes 3358 (3.2 KiB)
 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
 ether 00:0c:29:1e:89:ec txqueuelen 1000 (Ethernet)
 RX packets 24 bytes 2094 (2.0 KiB)
 RX errors 0 dropped 0 overruns 0 frame 0
 TX packets 0 bytes 0 (0.0 B)
 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
 inet 127.0.0.1 netmask 255.0.0.0
 inet6 ::1 prefixlen 128 scopeid 0x10<host>
 loop txqueuelen 1 (Local Loopback)
 RX packets 692 bytes 55888 (54.5 KiB)
 RX errors 0 dropped 0 overruns 0 frame 0
 TX packets 692 bytes 55888 (54.5 KiB)
 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

team1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
 inet 192.168.65.150 netmask 255.255.255.0 broadcast 192.168.65.255
 inet6 fe80::b5aa:6048:2051:4f7e prefixlen 64 scopeid 0x20<link>
 ether 00:0c:29:1e:89:ec txqueuelen 1000 (Ethernet)
 RX packets 9 bytes 980 (980.0 B)
 RX errors 0 dropped 0 overruns 0 frame 0
 TX packets 25 bytes 2314 (2.2 KiB)
 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@osradar_com ~]#

Teamdctl

The teamdctl utility is available to control a running instance of teamd using D-bus. teamdctl provides a D-Bus wrapper around the teamd D-Bus API. By default, teamd listens and communicates using Unix Domain Sockets but still monitors D-Bus. This is to ensure that teamd can be used in environments where D-Bus is not present or not yet loaded. For example, when booting over teamd links, D-Bus would not yet be loaded. The teamdctlutility can be used during run time to read the configuration, the state of link-watchers, check and change the state of ports, add and remove ports, and to change ports between active and backup states.

check  the running devices   with  :

#teamdctl team1 state

Even if one device is down eth1 or eth2,  the system still be reached

Now ping the team1 IP from Local or  from the network

Thank you and enjoy the installation

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article