Configure Network Bonding2025/06/19 |
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] | Configure Network Bonding. |
# display network devices [root@dlp ~]# nmcli device DEVICE TYPE STATE CONNECTION enp1s0 ethernet connected enp1s0 lo loopback connected (externally) lo enp7s0 ethernet disconnected -- # delete existing network connections [root@dlp ~]# nmcli connection delete enp1s0 Connection 'enp1s0' (ea1de913-e066-3c01-878b-70ee45629772) successfully deleted.[root@dlp ~]# nmcli device DEVICE TYPE STATE CONNECTION lo loopback connected (externally) lo enp1s0 ethernet disconnected -- enp7s0 ethernet disconnected -- # add a new bonding device [bond0] (any name you like) # refer to the description above for each mode (OK to specify with mode number for [mode=*]) [root@dlp ~]# nmcli connection add type bond ifname bond0 con-name bond0 bond.options "mode=balance-rr" Connection 'bond0' (f39d3fa3-318a-4426-81e1-fd18b75a8b42) successfully added. # add member devices to the bonding device [root@dlp ~]# nmcli connection add type ethernet ifname enp1s0 master bond0 Connection 'bond-slave-enp1s0' (e5e4c996-e64f-4152-a904-8ae4f305c3bd) successfully added. [root@dlp ~]# nmcli connection add type ethernet ifname enp7s0 master bond0 Connection 'bond-slave-enp7s0' (38652cb2-c315-40d4-9262-5653aeb45ada) 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 connected (externally) lo[root@dlp ~]# nmcli connection NAME UUID TYPE DEVICE bond0 f39d3fa3-318a-4426-81e1-fd18b75a8b42 bond bond0 bond-slave-enp1s0 e5e4c996-e64f-4152-a904-8ae4f305c3bd ethernet enp1s0 bond-slave-enp7s0 38652cb2-c315-40d4-9262-5653aeb45ada ethernet enp7s0 lo 1323f4a3-1d01-44c1-afb5-fc259f1e4455 loopback lo # set IP address and so on to the bonding device and restart it # IP address [root@dlp ~]# nmcli connection modify bond0 ipv4.addresses 10.0.0.30/24
# gatway [root@dlp ~]# nmcli connection modify bond0 ipv4.gateway 10.0.0.1
# DNS - specify with space separated if set multiple DNS servers [root@dlp ~]# nmcli connection modify bond0 ipv4.dns "10.0.0.10 10.0.0.11"
# DNS search base - specify with space separated if set multiple domains [root@dlp ~]# nmcli connection modify bond0 ipv4.dns-search "srv.world"
[root@dlp ~]#
nmcli connection modify bond0 ipv4.method manual
[root@dlp ~]#
reboot # verify bonding state [root@dlp ~]# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v6.12.0-55.16.1.el10_0.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:26:01:6a Slave queue ID: 0 Slave Interface: enp7s0 MII Status: up Speed: Unknown Duplex: Unknown Link Failure Count: 0 Permanent HW addr: 52:54:00:3c:03:51 Slave queue ID: 0[root@dlp ~]# ip address show 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 noprefixroute 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:26:01:6a brd ff:ff:ff:ff:ff:ff altname enx52540026016a 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:26:01:6a brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:3c:03:51 altname enx5254003c0351 4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:54:00:26:01:6a 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::6fd7:8f2c:cf09:43f6/64 scope link noprefixroute valid_lft forever preferred_lft forever # configuration files are stored under the place [root@dlp ~]# ll /etc/NetworkManager/system-connections total 12 -rw-------. 1 root root 299 Jun 19 10:23 bond0.nmconnection -rw-------. 1 root root 169 Jun 19 10:21 bond-slave-enp1s0.nmconnection -rw-------. 1 root root 169 Jun 19 10:22 bond-slave-enp7s0.nmconnection |
|