Ethernet Bonding

Note this refers to Centos / Red Hat systems. See Ubuntu Network Config and Ubuntu 18.04 Netplan for Ubuntu related info.

Linux Network

Ethernet Bonding

The bonding driver needs to be passed some parameters in modprobe.conf.

[root@gy-asp-db03 network-scripts]# cat /etc/modprobe.conf
alias eth0 bnx2
alias eth2 bnx2
alias bond0 bonding
options bond0 mode=1 miimon=100 max_bonds=2
alias bond1 bonding
options bond1 mode=1 miimon=100

The mode=1 tells it to use active/passive, miimon sets the interval to check the mii interface to detect a failed link, and max_bonds sets the required number of bonding interfaces, default is 1.

[root@gy-asp-db03 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@gy-asp-db03 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
IPADDR=172.27.206.93
NETMASK=255.255.255.0
NETWORK=172.27.206.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

[root@gy-asp-db03 network-scripts]# cat ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
HWADDR=1C:C1:DE:07:BB:F0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

[root@gy-asp-db03 network-scripts]# cat ifcfg-eth2
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth2
HWADDR=D4:85:64:68:AA:32
BOOTPROTO=none
ONBOOT=yes
HOTPLUG=no
MASTER=bond0
SLAVE=yes
USERCTL=no

IP routing

Persistent routes can be set in /etc/sysconfig/network-scripts with a separate file for each interface:-

[root@gy-asp-db03 network-scripts]# cat route-bond0 
GATEWAY0=172.27.206.1
NETMASK0=255.255.255.0
ADDRESS0=172.27.205.0

#.207 network not currently in use (was for ringo)
#GATEWAY1=172.27.206.1
#NETMASK1=255.255.255.0
#ADDRESS1=172.27.207.0

This gives the following (edited) output:-

[root@gy-asp-db03 network-scripts]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
.....
172.27.205.0    172.27.206.1    255.255.255.0   UG    0      0        0 bond0
.....
default         172.27.201.1    0.0.0.0         UG    0      0        0 bond1
[root@gy-asp-db03 network-scripts]#
 
linux/ethernetbonding.txt · Last modified: 14/01/2022 15:55 by andrew