Configure Network Bonding2024/07/01 |
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. |
# 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 noprefixroute valid_lft forever preferred_lft forever 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 52:54:00:db:f8:fe brd ff:ff:ff:ff:ff:ff inet 10.0.0.232/24 metric 100 brd 10.0.0.255 scope global dynamic enp1s0 valid_lft 450sec preferred_lft 450sec inet6 fe80::5054:ff:fedb:f8fe/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:c3:d9:a2 brd ff:ff:ff:ff:ff:ff
root@dlp:~#
ls /etc/netplan 01-netcfg.yaml 50-cloud-init.yaml.org
# 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
network:
ethernets:
enp1s0:
dhcp4: false
dhcp6: false
enp7s0:
dhcp4: false
dhcp6: false
bonds:
bond0:
addresses: [10.0.0.30/24]
routes:
- to: default
via: 10.0.0.1
metric: 100
nameservers:
addresses: [10.0.0.10]
search: [srv.world]
interfaces:
- enp1s0
- enp7s0
parameters:
mode: balance-rr
mii-monitor-interval: 100
version: 2
# apply changes root@dlp:~# netplan apply
# after setting bonding, [bonding] is loaded automatically root@dlp:~# lsmod | grep bond bonding 245760 0 tls 151552 1 bondingroot@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 pfifo_fast master bond0 state UP group default qlen 1000 link/ether 52:7d:b1:ae:a2:bc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:db:f8:fe 3: enp7s0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000 link/ether 52:7d:b1:ae:a2:bc brd ff:ff:ff:ff:ff:ff permaddr 52:54:00:c3:d9:a2 4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 52:7d:b1:ae:a2:bc 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::507d:b1ff:feae:a2bc/64 scope link valid_lft forever preferred_lft foreverroot@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 |