Configure Network Bonding 2022/06/29 |
| Configure Network Bonding to bind multiple network interfaces into a single load balanced or fault-toleranced interface and so on. The Network Teaming feature which is the same solution of network load-balancing or fault-tolerance is also provided. ⇒ https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-comparison_of_network_teaming_to_bonding There are some modes for configuring network bonding like follows.
| ||||||||||||||||||||||||
[1] |
List of phisical network interfaces int the host: ifconfig | grep enp | awk '{print $1}' | sed 's/.$//'
Configure Network Bonding. |
# display network devices
DEVICE TYPE STATE CONNECTION enp1s0 ethernet connected enp1s0 enp7s0 ethernet disconnected -- lo loopback unmanaged --
# delete existing network connections
Connection 'enp1s0' (0c5a95c5-1c2a-351d-add2-7fee398c96ab) successfully deleted.
[root@dlp ~]# nmcli device DEVICE TYPE STATE CONNECTION enp1s0 ethernet disconnected -- enp7s0 ethernet disconnected -- lo loopback unmanaged --
# add a new bonding device [bond0] (any name you like)
Connection 'bond0' (c0c1097e-476e-4c5c-ac5a-3284fb053ce8) successfully added.
# add member devices to the bonding device
[root@dlp ~]# nmcli connection modify boond0 ipv4.method disabled
Connection 'bond-slave-enp7s0' (d4a65fb1-9a77-40bd-b8be-aa88ce64cc5f) successfully added.
[root@dlp ~]# nmcli device DEVICE TYPE STATE CONNECTION bond0 bond connected bond0 enp1s0 ethernet connected bond-slave-enp1s0 enp7s0 ethernet connected bond-slave-enp7s0 lo loopback unmanaged -- [root@dlp ~]# nmcli connection NAME UUID TYPE DEVICE bond0 c0c1097e-476e-4c5c-ac5a-3284fb053ce8 bond bond0 bond-slave-enp1s0 0e799b5a-cc8d-4062-bf0d-927c080863ff ethernet enp1s0 bond-slave-enp7s0 d4a65fb1-9a77-40bd-b8be-aa88ce64cc5f ethernet enp7s0
================== # bridge $ nmcli con add ifname br0 type bridge con-name br0 $ nmcli con add type bridge-slave ifname bond0 master br0 $ nmcli connection show # set IP address and so on to the bridge device and restart it
# gatway
# DNS - specify with space separated if set multiple DNS servers
# DNS search base - specify with space separated if set multiple domains
[root@dlp ~]# nmcli connection modify br0 ipv4.method manual
nmcli con modify bond0 master br0 slave-type bridge
nmcli con up bond0
# verify bonding state
Ethernet Channel Bonding Driver: v5.14.0-115.el9.x86_64
Bonding Mode: load balancing (round-robin) MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Peer Notification Delay (ms): 0 Slave Interface: enp1s0 MII Status: up Speed: Unknown Duplex: Unknown Link Failure Count: 0 Permanent HW addr: 52:54:00:6e:a3:17 Slave queue ID: 0
Slave Interface: enp7s0 MII Status: up Speed: Unknown Duplex: Unknown Link Failure Count: 0 Permanent HW addr: 52:54:00:fe:cd:82 Slave queue ID: 0
[root@dlp ~]# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp1s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000 link/ether 52:54:00:6e:a3:17 brd ff:ff:ff:ff:ff:ff 3: enp7s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bond0 state UP group default qlen 1000 link/ether 52:54:00:6e:a3:17 brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:fe:cd:82 5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:54:00:6e:a3:17 brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global noprefixroute bond0 valid_lft forever preferred_lft forever inet6 fe80::34ce:9e06:c339:558a/64 scope link noprefixroute valid_lft forever preferred_lft forever
# configuration files are stored under the place
ll /etc/NetworkManager/system-connections
total 12 -rw-------. 1 root root 288 Jun 29 14:27 bond0.nmconnection -rw-------. 1 root root 153 Jun 29 14:25 bond-slave-enp1s0.nmconnection -rw-------. 1 root root 153 Jun 29 14:25 bond-slave-enp7s0.nmconnection |