Ethernet Interfaces Bonding


Recently i did bond interface on my Ubuntu server machine (2 NICs) and find out that my Hassio 0.95.4 (running in Docker) getting double events on Xiaomi wireless switches (connected via Xiaomi gateway).

Any ideas how to fix this one? Maybe some specific bond interface settings required?

I’ll try to help if I can…what does your ifconfig show?
And what about the other end of the wires? I presume are connected to a switch
but is the switch’s two ports setup up to be be Link Aggregated?

ifconfig was showing (already turned off bonding) same IP, same MAC for both NICs and Bond. Also Multicast were enabled on both NICs according to ifconfig. Other end of wires were connected to Unifi 24 port switch. Aggregation (on switch) were not enabled as bonding were in mode = 2 (balance-xor) and as far as i can understand Aggregation needed to be turned on if mode = 4 (802.3ad) used.

Perhaps the confusion is whether link aggregation (aka bonding) is running in static or dynamic mode.
When you are aggregating links at one end (server), you also have to aggregate links at the other end regardless of either static or dynamic mode. I think the confusion is mode = 4. Mode = 4 means to run in dynamic mode which requires LACP protocol to be run at both ends. LACP is used to created the aggregated links by protocol and not from static configuration. When LACP is not used, the aggregated links run in a static mode. Mode =2 is just a mode for how to load balance traffic amongst the aggregated links. This mode is still aggregating (i.e. bonding) ports together statically and therefore the Unifi switch has to also aggregate its ports so that it (Unifi) treats those two ports as a single link.

If you don’t aggregate the Unifi ports, then when Unifi gets broadcast or multicast packets from some other port, it will flood broadcast/multicast (and unknown unicast) packets to both NICs on the server. If the Unifi ports are aggregated, it will choose one of those ports and thus only flood to one of the NICs.

ah…i see…so basically i need to setup link aggregation n my switch and turn on bonding on server. correct?

Yes :slight_smile: