Interfaces bond0, bond1 not appearing, what's wrong?

Hi. I'm running OpenWRT 23.05.2 on a Pi B.
I built the image using ImageBuilder with the following additional packages:

luci
luci-proto-bonding
proto-bonding
kmod-bonding
usbutils
joe
kmod-usb-net-asix
kmod-phy-ax88796b
kmod-usb-net-asix-ax88179

Everything is working as expected (including the USB ethernet adapters), except for bonding.

(Yes, I understand that bonding for performance is pointless on this machine.. that is not what I need to do. What I need is to have redundant links on the upstream (wan) side, for reliability. Only one link would be active at a time).

I see:
/sys/module/bonding
/sys/class/net/bonding_masters

.. as expected.. but.. according to all answers I can find, bond0 and bond1 should just be there.. but they aren't.

What am I missing?

Thanks!
Ben

Then "bond_" devices are created dynamically, when you configure them

Thanks!

Ok, so I was able to create bond0 in the shell with
ip link add type bond name bond0

But.. I'd like to do it the "OpenWRT way" so that everything shows up in luci the way that it should, and also so that any changes made via luci actually work and don't stomp all over any settings I did in the shell (eg. rc.local).

So.. I've already tried doing everything via luci, thinking that I could then see where luci wrote out the bonding configuration.. but that didn't work.. luci just hung and I had to reboot openwrt....

What I want to do is have two of my ethernet ports bonded to form 'bond0' in 'active-backup' mode, that should be aliased as 'wan' and then assign the ip from the upstream with DHCP....

Maybe the /etc/config files and luci features are just not intended to be used that way?
If so, I'll go ahead and do it in rc.local, I would just rather not if there's a more correct way to do it in openwrt.

Thanks!

Can you not, Add new Interface ?
Then pick, Link Aggregation (Channel Bonding) in the drop down?

1 Like

For those who find this thread, trying to do the same thing.. I finally gave up trying to do it totally in the openwrt config and instead took a hybrid approach:

First, I had to install the packages:
luci-proto-bonding
proto-bonding
kmod-bonding
mii-tool

Since I am using ImageBuilder I just include these in the image.

In rc.local, I have:

ip link add type bond name bond0
ip link set bond0 type bond miimon 1000 mode active-backup
ip link set eth1 master bond0
ip link set eth2 master bond0

/etc/init.d/network restart

Actually, to make it easier to test, I put that in a separate shell script, then execute that from /etc/rc.local ...

Then, in /etc/config/network:

config interface 'wan'
        option device 'bond0'
        option proto 'dhcp'
        option force_link '1'

And that's it, with both eth1 and eth2 connected to the upstream network, if one link goes down, the other one takes over.