Configure Network Bonding2023/07/17 |
Configure Network Bonding to bind multiple network interfaces into a single load balanced or fault-toleranced interface and so on.
There are some modes for configuring network bonding like follows.
|
|||||||||||||||||||||||||
[1] | Configure Network Bonding. |
root@dlp:~#
apt -y install ifenslave ethtool # confirm network interfaces 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 valid_lft forever preferred_lft forever 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:1e:97:91 brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global enp1s0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe1e:9791/64 scope link valid_lft forever preferred_lft forever 3: enp7s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 52:54:00:54:5f:34 brd ff:ff:ff:ff:ff:ff
# change all like follows
# replace the interface name, IP address, DNS, Gateway to your environment value
# for [mode] section, set a mode you'd like to use
auto enp1s0
iface enp1s0 inet manual
bond-master bond0
bond-mode balance-rr
auto enp7s0
iface enp7s0 inet manual
bond-master bond0
bond-mode balance-rr
auto bond0
iface bond0 inet static
address 10.0.0.30
netmask 255.255.255.0
network 10.0.0.0
gateway 10.0.0.1
bond-slaves enp1s0 enp7s0
bond-mode balance-rr
bond-miimon 100
bond-downdelay 200
bond-updelay 200
root@dlp:~#
root@dlp:~# ifdown enp1s0 root@dlp:~# ifdown enp7s0 root@dlp:~# ifup bond0
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 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:1e:97:91 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:1e:97:91 brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:54:5f:34 4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:54:00:1e:97:91 brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global bond0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe1e:9791/64 scope link valid_lft forever preferred_lft forever # after setting bonding, [bonding] is loaded automatically root@dlp:~# lsmod | grep bond bonding 221184 0 tls 126976 1 bondingroot@dlp:~# ethtool bond0 Settings for bond0: Supported ports: [ ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 2000Mb/s Duplex: Full Auto-negotiation: off Port: Other PHYAD: 0 Transceiver: internal Link detected: yes |
Sponsored Link |
|