problems with FAILOVER link aggregation

Hyffer

Cadet
Joined
Feb 9, 2023
Messages
1
I tried to create a failover link aggregation network interface, but encountered some problems. The "MII Polling Interval" is always 0, so that it cannot detect a slave failure and switch to another card. (No matter using TrueNAS CLI or Web UI to create link aggregation, it is the same result.)

Code:
root@truenas[~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v5.15.79+truenas

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: enp1s0 (primary_reselect always)
Currently Active Slave: enp1s0
MII Status: up
MII Polling Interval (ms): 0                   <----- HERE
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

Slave Interface: eno1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: [...]
Slave queue ID: 0

Slave Interface: enp1s0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: [...]
Slave queue ID: 0


If I unplug an ethernet cable, a device down event raises (shows in dmesg), but still "MII Status: up".

My temporary workaround

Change the content of file /sys/class/net/bond0/bonding/miimon from 0 to 100 can solve this problem. (It is definitely not recommended)

System Info​

TrueNAS-SCALE-22.12.0
two network card: Intel I219-V and Realtek RTL8125b

I found this related to my problem: Add the mii monitoring during bond creation. It shows this issue has been fixed. But in my case, it seems not.

---
And by the way, web ui suggests "The order is important because the FAILOVER lagg protocol will mark the first interface as the "primary" interface."
But I tried that the order doesn't matter. In this situation, it just chooses Realtek RTL8125b as primary.

Are these bugs, or am I missing something?
 

lawlest

Cadet
Joined
Mar 30, 2023
Messages
1
I have been using a Pre-Init script that just does "echo 100 > /sys/class/net/bond0/bonding/miimon" and it seems to be good enough until the problem gets fixed.
 

Constantin

Vampire Pig
Joined
May 19, 2017
Messages
1,829
I never got Failover LAGG to work on my first FreeNAS (Mini XL) so I'm not surprised it took additional work to get fixed. Congrats on finding the source of the issue and a solution.
 

Gustav

Dabbler
Joined
Jul 2, 2023
Messages
11
Hi. i have same issues with this
Do somebody find a Solution ? it is reported to TrueNas Support ?
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Hi. i have same issues with this
Do somebody find a Solution ? it is reported to TrueNas Support ?
Please report details of software/hardware and did you use the pr-init script above?
 

etherion

Cadet
Joined
Jul 13, 2023
Messages
6
I have the same problem. Truenas scale does not switch between the adapters when we have it set as an active backup.

it is because MII Polling Interva is 0
cat /proc/net/bonding/bond0
MII Polling Interval (ms): 0

so I created a script as suggested that runs on reboot that will set miimon

Create a Script (e.g., /root/set_miimon.sh):
#!/bin/bash
echo 100 > /sys/class/net/bond0/bonding/miimon

Make the script executable:
chmod +x /root/set_miimon.sh


Add the Script to Root's Crontab:
Edit the root user's crontab:
sudo crontab -e

Add the line:
@Reboot /root/set_miimon.sh
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Add the Script to Root's Crontab:
Edit the root user's crontab:
sudo crontab -e
Well that's not going to survive long...

You need to do that in the GUI, System Settings | Advanced | Cron Jobs if you want it to stay there.
 

Gustav

Dabbler
Joined
Jul 2, 2023
Messages
11
Well that's not going to survive long...

You need to do that in the GUI, System Settings | Advanced | Cron Jobs if you want it to stay there.
yes..temporary. but TrueNas guys have to fix it. i hope it.
 
Top