Teaming (LACP) settings in CentOS 8

Why do you do it?

--I heard that it has higher functionality than the mainstream bonding driver up to CentOS6. --If you want to run Docker and k8s hosts on-premises, you want to make the NIC redundant. ――Since the cloud was in full swing and I hadn't touched the on-premise server for a while, it also served as rehabilitation. -** A new on-preserver was delivered after a long time, so I wanted to play before building the production environment **

Verification environment

HPE DL380 Gen10 Cisco Catalyst 3750X-48 Stack Configuration

Procedure (host side)

1. Install the Teamd daemon

Teamd is a network teaming daemon added from CentOS 7 series instead of bonding that was major up to CentOS 6 series. First, run the following command to install Teamd:

[root@host1 ~]# dnf -y install teamd

2. Configure NIC teaming using the nmcli tool

Since CetOS7 series and later, Network Manager is used to manage the network, so the settings are also set using the command line utility Nmcli.

First, check the status of the network interface with the following command.

[root@host1 ~]# nmcli device status
DEVICE  TYPE      STATE     CONNECTION
eno5 ethernet connected eno5
eno6 ethernet connected eno6
eno7 ethernet disconnected--
eno8 ethernet connected eno8
lo loopback No management--

Currently, the server has four physical Ethernet ports. This time I will set the teaming using eno5 and eno6.

[root@host1 ~]# nmcli connection show
NAME          UUID                                  TYPE      DEVICE
eno5          c5a9f44a-306a-4728-82e8-70d0ce3e528b  ethernet  eno5
eno6          93be4fa2-61aa-4360-b570-94bef5f56fcb  ethernet  eno6
eno7          1dfffcc1-7807-4093-bdd7-844d0ce31aec  ethernet  --
eno8          ca899a0f-ac24-4a65-a2d6-86e90bef5f56  ethernet  eno8

3. Delete the UUID of the NIC to be set

Delete the default settings of eno5 and eno6 by specifying the UUID with the following command.

[root@dns3 ~]# nmcli connection delete c5a9f44a-306a-4728-82e8-70d0ce3e528b
[root@dns3 ~]# nmcli connection delete 93be4fa2-61aa-4360-b570-94bef5f56fcb

Check if the connection is lost

[root@host1 ~]# nmcli connection show
NAME          UUID                                  TYPE      DEVICE
eno7          1dfffcc1-7807-4093-bdd7-844d0ce31aec  ethernet  --
eno8          ca899a0f-ac24-4a65-a2d6-86e90bef5f56  ethernet  eno8

[root@host1 ~]# nmcli device status
DEVICE  TYPE      STATE     CONNECTION
eno7 ethernet disconnected--
eno8 ethernet connected eno8
eno5 ethernet disconnected eno5
eno6 ethernet disconnected eno6
lo loopback No management--

4. Creating a team interface

Create a new team interface "bond0". "name" is an option setting called runner, and there are the following types.

runner motion
broadcast Data is sent on all ports
round-robin Data is sent in sequence on all ports
active-backup One port or link is used and the other is maintained as a backup)
loadbalance Use active Tx load balancing and BPF-based Tx port selector
lacp 802.Implemented 3ad link aggregation control protocol

This time, the connection partner is a Cisco switch, so let's select LACP. When you run the command, / etc / sysconfig / network-scripts / ifcfg-team-bond0 will be created automatically. It is okay to create a file directly in the above path with an editor as before, but this time I will set it with a command to get used to nmcli.

[root@host1 ~]# nmcli connection add type team con-name bond0 ifname bond0 config '{"runner": {"name": "lacp"}}'

Check if the team interface has been created with the following command.

[root@dns3 ~]# nmcli device status
DEVICE  TYPE      STATE     CONNECTION
bond0 team disconnected bond0
eno8 ethernet connected eno8
eno7 ethernet disconnected--
lo loopback No management--

[root@host1 ~]# nmcli connection show
NAME          UUID                                  TYPE      DEVICE
bond0         2a7bb890-f677-48dc-b885-1f9ff111989d  team      bond0
eno8          ca899a0f-ac24-4a65-a2d6-86e90bef5f56  ethernet  eno8
eno7          1dfffcc1-7807-4093-bdd7-844d0ce31aec  ethernet  --

[root@host1 ~]# nmcli con show bond0
connection.id:                          bond0
connection.uuid:                        2a7bb890-f677-48dc-b885-1f9ff111989d
connection.stable-id:                   --
connection.type:                        team
connection.interface-name:              bond0
connection.autoconnect:Yes
~ Omitted ~
team.config:                            {"runner": {"name": "lacp"}}

5. Specifying the main system and sub system of the interface

Recently, it seems that the terms master and slave are NG, so set the main system and sub system.

[root@host1 ~]# nmcli con add type team-slave con-name bond0-slave0 ifname eno5 master bond0
[root@host1 ~]# nmcli con add type team-slave con-name bond0-slave1 ifname eno6 master bond0

Use the following command to check if the main system and sub system can be specified.

[root@dns3 ~]# nmcli device status
DEVICE  TYPE      STATE     CONNECTION
bond0 team connected bond0
eno8 ethernet connected eno8
eno5 ethernet connected bond0-slave0
eno6 ethernet connected bond0-slave1
eno7 ethernet disconnected--
lo loopback No management--

[root@host1 ~]# nmcli connection show
NAME          UUID                                  TYPE      DEVICE
bond0         2a7bb890-f677-48dc-b885-1f9ff111989d  team      bond0
eno8          ca899a0f-ac24-4a65-a2d6-86e90bef5f56  ethernet  eno8
bond0-slave0  c5a9f44a-306a-4728-82e8-70a8c73e528b  ethernet  eno5
bond0-slave1  93be4fa2-61aa-4360-b570-94fcb8cb8f94  ethernet  eno6
eno7          1dfffcc1-7807-4093-bdd7-844d0ce31aec  ethernet  --

6. Interface IP address, DNS settings

Set the IP address and DNS in the created team interface "bond0".

[root@host1 ~]# nmcli con mod bond0  ipv4.addresses 192.168.250.1/24
[root@host1 ~]# nmcli con mod bond0  ipv4.gateway 192.168.250.254
[root@host1 ~]# nmcli con mod bond0  ipv4.dns 192.168.250.254
[root@host1 ~]# nmcli con mod bond0  ipv4.method manual
[root@host1 ~]# nmcli con mod bond0  connection.autoconnect yes

7. Reflect the settings (restart the interface)

To reflect the settings, restart the team interface "bond0" with the following command. (If it's a hassle, systemctl restart NetworkManager is probably fine too)

nmcli connection down bond0 && nmcli connection up bond0

8. Check settings

It is normal if both link summaries are UP by executing the following command

[root@host1 ~]# teamdctl bond0 state
setup:
  runner: lacp
ports:
  eno5
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
    runner:
      aggregator ID: 2, Selected
      selected: yes
      state: current
  eno6
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
    runner:
      aggregator ID: 2, Selected
      selected: yes
      state: current
runner:
  active: yes
  fast rate: no

You can check if the IP address is set with the following command.

[root@host1 ~]# ip address show dev bond0
6: bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 98:f2:b3:**:**:** brd ff:ff:ff:ff:ff:ff
    inet 192.168.250.1/24 brd 192.168.250.255 scope global noprefixroute bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::**/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

9. Switch (Catalyst 3750X) configuration example

Originally, if you describe it in Port-Channel, the setting on the interface side may be about description, but it is described just in case. LACP mode was connected with mode on in CentOS 6 bonding, but when using teamd, specify mode active. (I was addicted to this for about 5 minutes without noticing this)

interface GigabitEthernet1/0/1
 description "Host1 Port#1"
 switchport mode access


interface GigabitEthernet2/0/1
 description "Host1 Port#2"
 switchport mode access


interface Port-channel1
 description "c3750_to_Host1"
 switchport mode access

interface range GigabitEthernet1/0/1, GigabitEthernet2/0/1
 channel-group 1 mode active

Impressions

Personally, I felt it was easier than the CentOS 6 series. Redhat also recommends using tamed in the future, so I think it is better to use this.

reference

[CentOS7] Teaming (LACP) with Catalyst 3750 and CentOS7 | MSeeeeN https://mseeeen.msen.jp/teaming-lacp-with-catalyst3750-and-centos7/

How to Configure NIC Teaming on CentOS 8 / RHEL 8 Linuxtechi https://www.linuxtechi.com/configure-nic-teaming-centos-8-rhel-8/

8.3. Comparison of network teaming and bonding https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/networking_guide/sec-comparison_of_network_teaming_to_bonding

Recommended Posts

Teaming (LACP) settings in CentOS 8
Network settings and confirmation in CentOS7
CentOS 7 NW settings
Put matplotlib in Centos7.
Remote related settings in pycharm
Settings often used in Jupyter
[RHEL / CentOS 8] Network settings memo
Disable python2.6 ssl3 protocol in centos6
Various Anaconda settings in Windows 10 environment
AWS Lightsail Primer 4 Basic Settings (CentOS 7)