Date created: Saturday, March 11, 2017 4:27:08 PM. Last modified: Wednesday, February 21, 2024 5:34:37 PM
Bond Interface
References:
https://www.kernel.org/doc/Documentation/networking/bonding.txt
https://www.kernel.org/doc/Documentation/networking/multiqueue.txt
iproute2 Method
ip link help bond
sudo ip link add bond0 type bond mode 802.3ad min_links 1 lacp_rate fast lacp_active on xmit_hash_policy layer2+3
sudo ip link set master bond0 dev ens1f0
sudo ip link set master bond0 dev enp11s0f1
sudo ip link set up dev ens1f0
sudo ip link set up dev enp11s0f1
sudo ip link set up dev bond0
Manual Method
Check default settings with:
$ modinfo bonding
Load bonding module:
$ modprobe --first-time bonding
$ lsmod | grep bond
Set up bond interface:
$ cat /etc/sysconfig/network-scripts/ifcfg-bond0
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
PEERDNS=no
PEERROUTES=no
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
IPV6_FAILURE_FATAL=no
NAME=bond0
DEVICE=bond0
ONBOOT=yes
NM_CONTROLLED=no
Set up slave interfaces:
$ cat /etc/sysconfig/network-scripts/ifcfg-ens2f0
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
PEERDNS=no
PEERROUTES=no
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
IPV6_FAILURE_FATAL=no
NAME=ens2f0
DEVICE=ens2f0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
$ cat /etc/sysconfig/network-scripts/ifcfg-ens2f1
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=no
PEERDNS=no
PEERROUTES=no
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
IPV6_FAILURE_FATAL=no
NAME=ens2f1
DEVICE=ens2f1
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
$ sudo modprobe bonding tx_queues=16 mode=0
$ sudo ifup bond0
See list of bond master devices:
$ cat /sys/class/net/bonding_masters
Check bond status of bond0 with:
$ cat /proc/net/bonding/bond0
Allocate TX queues for bond slaves:
$ cat /sys/class/net/bond0/bonding/queue_id
Change queues with:
$ sudo bash -c 'echo "ens2f1:1" > /sys/class/net/bond0/bonding/queue_id'
Statistics:
cat /sys/class/net/bond0/statistics/*
In bond mode 0 (balance-rr):
$ cat /sys/class/net/bond0/bonding/mode
balance-rr 0
All slave devices are active so "none" are shown:
$ cat /sys/class/net/bond0/bonding/slaves
ens2f0 ens2f1
$ cat /sys/class/net/bond0/bonding/active_slave
Previous page: 'yq' - Notes
Next page: Bridge Notes