Best way to configure Bonding in OpenWrt?

In the use case of an office, hotel, cafe etc. with many users, load balancing can be very effective. Mwan3 will bring all the lines to full usage.

2 Likes

Would it be possible for you to post an exact step by step instruction how you did it including prerequisites?
I'd like to use bonding with a WRT32x (eth0 and eth1 interfaces), that acts as a heavily used ap, and a smart switch, that supports link aggregation.

1 Like

I think there are guys that allready figured out how to completely do it. Could those please give a step by step explanation? :wave:

1 Like

The situation where you have two ports into one of these switch chips is different from the kind of thing I have done, where I have two ethernet devices on an x86 hooked by cat6 into a LAG group on ports of a managed switch product.

I don't know how much you can really accomplish given that your WRT32x is hard wired directly into a sort of pseudo-managed switch. you can't exactly tell the wrt32x switch chip to treat the two CPU ports as a single LAG port.

you can of course bond eth0 and eth1, and use round robin mode, but it may confuse the heck out of the switch chip and there's no guarantee what will happen in the receive direction.

2 Likes

I was able to get this going using your tip, slightly different usage though. I used it to bond 3 nics to LAN

in /etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

modprobe bonding mode=802.3ad miimon=100
ifconfig bond0 192.168.2.1 netmask 255.255.255.0 up
ip link set eth1 master bond0
ip link set eth2 master bond0
ip link set eth3 master bond0

exit 0

in /etc/config/network


config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd9e:4b25:870b::/48'

config interface 'bond0'
        option ifname 'bond0.1'
        option ifname 'bond0.2'
        option ifname 'bond0.3'

config interface 'lan'
        option type 'bridge'
        option ifname 'bond0'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        list dns '208.67.222.222'
        list dns '208.67.220.220'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'

Testing the different modes ATM. Any tuning tips or a means of testing? FYI I have a 2.5gb WAN port to a 2.5gb modem. The LAN interface is 3 2.5gb NICs @ 1gb each to a managed 1gb/10gb switch. Reason being the switch will not do 2.5gb on a single interface and I'm trying to get the bottleneck minimized.

Testing should be easy - attach 3 devices to your managed switch and let them download files from a 1Gbps-connected internet server. You should get somewhat 600-700 Mbps on each device.
But keep in mind that no single stream can be faster than 1Gbps, they only sum up to a bonded 3 Gbps.

Hi,I have a question I'd like to ask you.I want to configure Bonding's mode in OpenWrt. There is a problem that my bonding is compiled in kernel.So,I can't use modprobe to configure bonding's mode.Can you give me some advices? Thank u in advance for your answwers and time.