Bonding/Link Aggregation on Debian?

Has anyone tried bonding/link aggregation on the engineering Debian 69? And can you give me some steps?

I saw different tutorials online. Some need bonding module in the kernel and ifenslave, but it seems the kernel in Debian 69 is not compiled with this module.

user@starfive ~> sudo modprobe bonding
modprobe: FATAL: Module bonding not found in directory /lib/modules/5.15.0-starfive

And other tutorials like this need only ifenslave but need to modify /etc/network/interfaces.

They seem reasonable but also confuse me.

The kernel that came with Debian 69 didn’t enable a lot of options in the Kernel networking. So if you really need that, you have to enable it and rebuild the kernel.

1 Like

I haven’t used it, but if I understand correctly, it doesn’t help a single connection as it only balances multiple. Eg. if I’m right, a single SSH session will not be faster, but HTTP (has lots of sessions) will. I would love to be proven wrong though.

I would recommend you have a go at:

#fetch all the vf2 docker setup and scripts
git clone https://github.com/kng/visionfive2-docker.git
cd visionfive2-docker
#build the vf2 ubuntu container with all the packages we need to build the kernel and image
time ./podman_build.sh 
sync

#build all the different vf2 specific stuff
time ./podman_shell.sh build_u-boot.sh
time ./podman_shell.sh build_opensbi.sh
time ./podman_shell.sh build_spl.sh

#build the kernel as tweaked for the vf2 by default
time ./podman_shell.sh build_kernel.sh

#now here come the kernel customization steps
./podman_shell.sh /bin/bash
###***********************IN PODMAN SHELL**********************
### similar setup steps as within the build_kernel.sh script
CORES=$(nproc)
echo $CORES
ROOTFS=/mnt/boot
cd linux
make starfive_visionfive2_defconfig CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv 

#finally now we can run menuconfig
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv menuconfig

###in menuconfig ncurses display
Cursor down to "Device Drivers  --->" and PRESS ENTER
Cursor down to "[*] Network device support  --->" and PRESS ENTER
Cursor down to "< >     Bonding driver support" and PRESS ENTER
PRESS SPACEBAR or PRESS m until it displays "<M>     Bonding driver support"
Cursor over to EXIT and PRESS ENTER
Cursor over to EXIT and PRESS ENTER
Cursor over to EXIT and PRESS ENTER
Eventually it will prompt you: "Do you wish to save your new configuration?"
Cursor over to "< Yes >" and PRESS ENTER
DONE. You have exited menuconfig and the .config file was saved.

# build the kernel with the same steps as within the build_kernel.sh script
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -j "${CORES}"
mkdir -p ${ROOTFS}
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv INSTALL_PATH=${ROOTFS} zinstall 
ls -l arch/riscv/boot/Image.gz
ls -l arch/riscv/boot/dts/starfive/*.dtb
ls -l ${ROOTFS}
ls -l ${ROOTFS}/config-5.15.0
#this last grep reassures we really did build with the bonding module enabled
grep -n -H BONDING ${ROOTFS}/config-5.15.0

exit
###EXITED PODMAN SHELL

It should be good.
Within ~/riscvplay/visionfive2-docker, there should be: mnt/linux/drivers/net/bonding/bonding.ko
which is held within the Image.gz itself.

1 Like

One thing to note is that if you plan to implement IEEE 802.3ad, your devices would need to have same speed and duplex setting.

So on the Super Early Bird boards with a 100Mbit/sec (eth1) and a 1000Mbit/sec (eth0) Ethernet port your bonded link (if you are using 802.3ad) would be at best 200 Mbit/sec which is fine for redundancy (if you are connecting to two Ethernet switches), but it is considerably slower than the single gigabit port.

3 Likes

Thanks a lot! I took a look at the repo. I don’t know whether we get a Debian image after these steps. I know Debian is a distribution of Linux, so I guess maybe we need more steps to get a Debian image with working GUI?