====== Network Teaming / bonding ======
https://www.certdepot.net/rhel7-configure-network-teaming-between-two-rhel-systems/
There are some differences between teaming and bonding (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Comparison_of_Network_Teaming_to_Bonding.html)
We will use **teaming** instead of bonding, which is the most complete and performant:
Software, called runners, enables load balancing
The following runners modes can be used:
**broadcast:** transmits each packet from all ports.\\
**roundrobin:** transmits each packets in a round-robin way from each of its ports.\\
**activebackup:** failover runner which watches for link changes and select an active port for data transfer.\\
**loadbalance:** monitor traffic and uses a hash function to try to reach a perfect balance when selecting ports for packet transmission.\\
**lacp:** Implement the 802.3ad Link Aggregation Control Protocol. It can use the same transmit port selection possibilities as the loadbalance runner.
===== Install teamd package =====
We need to load team driver and install teamd package:
[root@rh73 ~]# yum -y install teamd
===== Creating Team Interface =====
[root@rh73 ~]# nmcli con add type team con-name team0 ifname team0 config '{ "runner": {"name": "lacp", "fast_rate": true}}'
Connection 'team0' (e519a6d9-4bf6-438e-a193-d3d3c799c388) successfully added.
[root@rh73 ~]# teamdctl team0 state
setup:
runner: lacp
runner:
active: yes
fast rate: yes
[root@rh73 ~]# nmcli con show
NAME UUID TYPE DEVICE
team0 e519a6d9-4bf6-438e-a193-d3d3c799c388 team team0
enP7p128s0f1 c0e9b8ed-2c91-49c7-9991-34d7fabc1556 802-3-ethernet --
enP7p128s0f3 a38fe38d-32b5-4148-b5e7-a881179517d1 802-3-ethernet --
enP7p128s0f0 848defb7-6922-40b9-a70c-a7458a991453 802-3-ethernet enP7p128s0f0
enP2p96s0f2 d267c5e8-3c5f-4c56-970c-74d823a74fe1 802-3-ethernet --
enP7p128s0f2 197de45a-0b6d-48f8-9a77-39fce3d932d8 802-3-ethernet --
enP2p96s0f0 9b50ac73-6b82-0a4a-0c2b-45f213d99656 802-3-ethernet --
enP2p96s0f1 d3c3d721-ce8d-45c2-aa8a-6cb434a7b59f 802-3-ethernet --
enP2p96s0f3 f2792d73-6ec1-4688-8a52-ad0d1c89903c 802-3-ethernet --
===== Adding Slave Devices =====
[root@rh73 ~]# nmcli con add type team-slave con-name team0-enP4p1s0f0 ifname enP4p1s0f0 master team0
Connection 'team0-enP4p1s0f0' (eec115e5-ba9c-4a35-a05b-d39699a6363b) successfully added.
[root@rh73 ~]# nmcli con add type team-slave con-name team0-enP4p1s0f1 ifname enP4p1s0f1 master team0
Connection 'team0-enP4p1s0f1' (0b53b68e-e89e-4fad-96c1-0023f414b4e) successfully added.
===== Assigning IP Address =====
[root@rh73 ~]# nmcli con mod team0 ipv4.addresses 192.168.1.22/16
[root@rh73 ~]# nmcli con mod team0 ipv4.gateway 192.168.1.2 ipv4.dns 8.8.8.8 connection.autoconnect yes
[root@rh73 ~]# nmcli con mod team0 ipv4.method manual
[root@rh73 ~]# nmcli con mod team0 ipv6.method ignore
[root@rh73 ~]# nmcli con up team0
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
===== Verifying the Teaming =====
[root@rh73 ~]# ip add show team0
2: team0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 54:ee:75:46:5e:86 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.22/16 brd 192.168.1.255 scope global team0
valid_lft 80643sec preferred_lft 80643sec
[root@rh73 ~]# nmcli con show
NAME UUID TYPE DEVICE
team0 e519a6d9-4bf6-438e-a193-d3d3c799c388 team team0
enP7p128s0f1 c0e9b8ed-2c91-49c7-9991-34d7fabc1556 802-3-ethernet --
enP7p128s0f3 a38fe38d-32b5-4148-b5e7-a881179517d1 802-3-ethernet --
enP7p128s0f0 848defb7-6922-40b9-a70c-a7458a991453 802-3-ethernet enP7p128s0f0
enP2p96s0f2 d267c5e8-3c5f-4c56-970c-74d823a74fe1 802-3-ethernet --
enP7p128s0f2 197de45a-0b6d-48f8-9a77-39fce3d932d8 802-3-ethernet --
enP2p96s0f0 9b50ac73-6b82-0a4a-0c2b-45f213d99656 802-3-ethernet --
enP2p96s0f1 d3c3d721-ce8d-45c2-aa8a-6cb434a7b59f 802-3-ethernet --
enP2p96s0f3 f2792d73-6ec1-4688-8a52-ad0d1c89903c 802-3-ethernet --
team0-enP4p1s0f1 0b53b68e-e89e-4fad-96c1-0023f414b4e5 802-3-ethernet enP4p1s0f1
team0-enP4p1s0f0 eec115e5-ba9c-4a35-a05b-d39699a6363b 802-3-ethernet enP4p1s0f0
[root@rh73 ~]# teamdctl team0 state
setup:
runner: lacp
ports:
enP4p1s0f0
link watches:
link summary: down
instance[link_watch_0]:
name: ethtool
link: down
down count: 0
runner:
aggregator ID: 0
selected: no
state: disabled
enP4p1s0f1
link watches:
link summary: down
instance[link_watch_0]:
name: ethtool
link: down
down count: 0
runner:
aggregator ID: 0
selected: no
state: disabled
runner:
active: yes
fast rate: yes
[root@rh73 ~]# teamnl team0 ports
11: enP4p1s0f1: down 0Mbit HD
10: enP4p1s0f0: down 0Mbit HD
[root@rh73 ~]# nmcli con reload
[root@rh73 ~]# nmcli con show
NAME UUID TYPE DEVICE
team0 e519a6d9-4bf6-438e-a193-d3d3c799c388 team team0
enP7p128s0f1 c0e9b8ed-2c91-49c7-9991-34d7fabc1556 802-3-ethernet --
enP7p128s0f3 a38fe38d-32b5-4148-b5e7-a881179517d1 802-3-ethernet --
enP7p128s0f0 848defb7-6922-40b9-a70c-a7458a991453 802-3-ethernet enP7p128s0f0
enP2p96s0f2 d267c5e8-3c5f-4c56-970c-74d823a74fe1 802-3-ethernet --
enP7p128s0f2 197de45a-0b6d-48f8-9a77-39fce3d932d8 802-3-ethernet --
enP2p96s0f0 9b50ac73-6b82-0a4a-0c2b-45f213d99656 802-3-ethernet --
enP2p96s0f1 d3c3d721-ce8d-45c2-aa8a-6cb434a7b59f 802-3-ethernet --
enP2p96s0f3 f2792d73-6ec1-4688-8a52-ad0d1c89903c 802-3-ethernet --
team0-enP4p1s0f1 0b53b68e-e89e-4fad-96c1-0023f414b4e5 802-3-ethernet enP4p1s0f1
team0-enP4p1s0f0 eec115e5-ba9c-4a35-a05b-d39699a6363b 802-3-ethernet enP4p1s0f0
[root@rh73 ~]# nmcli con show team0
connection.id: team0
connection.uuid: e519a6d9-4bf6-438e-a193-d3d3c799c399
connection.interface-name: team0
connection.type: team
connection.autoconnect: yes
connection.autoconnect-priority: 0
connection.timestamp: 1488286549
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries:
connection.gateway-ping-timeout: 0
connection.metered: unknown
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: yes
802-3-ethernet.mac-address: --
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options:
802-3-ethernet.wake-on-lan: 1 (default)
802-3-ethernet.wake-on-lan-password: --
ipv4.method: manual
ipv4.dns:
ipv4.dns-search:
ipv4.addresses: 192.168.1.22/16
ipv4.gateway: 192.168.1.250
ipv4.routes:
ipv4.route-metric: -1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv6.method: ignore
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
ipv6.gateway: --
ipv6.routes:
ipv6.route-metric: -1
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.ip6-privacy: -1 (unknown)
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
team.config: { "runner": {"name": "lacp"}}
GENERAL.NAME: team0
GENERAL.UUID: e519a6d9-4bf6-438e-a193-d3d3c799c388
GENERAL.DEVICES: team0
GENERAL.STATE: activated
GENERAL.DEFAULT: no
GENERAL.DEFAULT6: no
GENERAL.VPN: no
GENERAL.ZONE: --
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/5
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/9
GENERAL.SPEC-OBJECT: /
GENERAL.MASTER-PATH: --
IP4.ADDRESS[1]: 192.168.1.22/16
IP4.GATEWAY:
Dump the configuration to change some parameters, or change in the files /etc/sysconfig/network-scripts/ifcfg-*
[root@rh73 ~]# teamdctl team0 config dump
{
"device": "team0",
"ports": {
"enP4p1s0f0": {
"link_watch": {
"name": "ethtool"
}
},
"enP4p1s0f1": {
"link_watch": {
"name": "ethtool"
}
}
},
"runner": {
"name": "lacp",
"tx_hash": [
"eth",
"ipv4",
"ipv6"
]
}
}
===== Delete a network connection from NetworkManager =====
**nmcli con del **
[root@rh73 ~]# nmcli con show
NAME UUID TYPE DEVICE
team0 e519a6d9-4bf6-438e-a193-d3d3c799c388 team team0
enP7p128s0f1 c0e9b8ed-2c91-49c7-9991-34d7fabc1556 802-3-ethernet --
enP7p128s0f3 a38fe38d-32b5-4148-b5e7-a881179517d1 802-3-ethernet --
enP7p128s0f0 848defb7-6922-40b9-a70c-a7458a991453 802-3-ethernet enP7p128s0f0
enP2p96s0f2 d267c5e8-3c5f-4c56-970c-74d823a74fe1 802-3-ethernet --
enP7p128s0f2 197de45a-0b6d-48f8-9a77-39fce3d932d8 802-3-ethernet --
enP2p96s0f0 9b50ac73-6b82-0a4a-0c2b-45f213d99656 802-3-ethernet --
enP2p96s0f1 d3c3d721-ce8d-45c2-aa8a-6cb434a7b59f 802-3-ethernet --
enP2p96s0f3 f2792d73-6ec1-4688-8a52-ad0d1c89903c 802-3-ethernet --
team0-enP4p1s0f1 0b53b68e-e89e-4fad-96c1-0023f414b4e5 802-3-ethernet enP4p1s0f1
team0-enP4p1s0f0 eec115e5-ba9c-4a35-a05b-d39699a6363b 802-3-ethernet enP4p1s0f0
[root@rh73 ~]# nmcli con del e519a6d9-4bf6-438e-a193-d3d3c799c388