Troubleshooting
After setting up the bonding interface, all of the configuration options are recorded in the sysfs file system, under the directory /sys/class/net/bond<N>/bonding/. It is possible to change the configuration on the command line (as shown in Figure 1) without reloading the bonding module, and the changes will be in effect immediately. However, these manipulations are not consistent, and after reboot all the changes will disappear.
# echo 1000 > /sys/class/net/bond0/bonding/miimon # echo 2 > /sys/class/net/bond0/bonding/primary_reselect or # echo failure > /sys/class/net/bond0/bonding/primary_reselect
It is always important to check the status of the bonding interface after configuration. The file /proc/net/bonding/bondName, as shown in Figure 2, records the current status of the bonding interface, including all the options given in the configuration files.
#cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active) Primary Slave: eth1 Currently Active Slave: eth1 MII Status: up MII Polling Interval (ms): 1000 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth1 MII Status: up Speed: 10000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 02:00:00:0a:6c:4b Slave queue ID: 0 Slave Interface: eth2 MII Status: up Speed: 10000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 02:0b:0c:0d:0e:02 Slave queue ID: 0
This example shows a bonding interface with active-backup mode, two slaves with different MAC address, and the MII status of up.
Using command ip link, as shown in Figure 3, you can see more details about the
packet transmission through the bonding interface. This example shows a bonding interface with
active-backup mode. Slaves eth1 and
eth2 have different MAC addresses, indicating that the option
fail_over_mac is set to active. The bond master has the
same MAC address as eth1, showing that eth1 is the current
active slave. (An increasing number of dropped packets would indicate that there might be some issue
with the bonding interface that will require more investigation.)
# ip -s link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode
DEFAULT group default qlen 1000
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DEFAULT group default qlen 1000
link/ether 02:00:00:0A:6C:4B brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
391234 4592 0 0 0 3561
TX: bytes packets errors dropped carrier collsns
78126 279 0 0 0 0
3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DEFAULT group default qlen 1000
link/ether 02:0B:0C:0D:0E:02 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
166321 3147 0 0 0 2931
TX: bytes packets errors dropped carrier collsns
39968 176 0 0 0 0
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue
state UP mode DEFAULT group default qlen 1000
link/ether 02:00:00:0A:6C:4B brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
4664 15 0 0 0 0
TX: bytes packets errors dropped carrier collsns
586 7 0 0 0 0