Who creates 'bond0' interface on my router?

I built custom image for my TL-WR741ND using the Image Builder v19.07.10:

make image PROFILE="tplink_tl-wr741nd-v4" \
PACKAGES="kmod-bonding quagga-ospfd quagga-ospf6d";

At first boot up, this is the result of ip addr show command:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether a0:f3:c1:4c:45:eb brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a2f3:c1ff:fe4c:45eb/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN qlen 1000
    link/ether a0:f3:c1:4c:45:ed brd ff:ff:ff:ff:ff:ff
5: bond0: <BROADCAST,MULTICAST400> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 66:fb:02:39:6f:c8 brd ff:ff:ff:ff:ff:ff
6: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether a0:f3:c1:4c:45:ec brd ff:ff:ff:ff:ff:ff
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether a0:f3:c1:4c:45:eb brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd8f:5362:d0ff::1/60 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::a2f3:c1ff:fe4c:45eb/64 scope link 
       valid_lft forever preferred_lft forever
8: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether a0:f3:c1:4c:45:eb brd ff:ff:ff:ff:ff:ff

TLDR, the difference from a default image is the presence of the bond0 interface. Looks like it has been created with default options, with no interfaces attached to it.

root@OpenWrt:~# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
root@OpenWrt:~# 

/etc/config/network has been left untouched, and there is no bond0 interface declared. Who creates this bond0 interface? Can it be safely deleted? Can I add slaved interfaces to it to reuse it for other purpose?

Who creates ‘bond0’ interface on my router?

You chose to install it - do you want bonding or not?

Bonding is a means of "joining" multiple channels together to get a virtual "bond" interface with an aggregate bandwidth ~equal to the multiple channels added together.

Bonding is most commonly used in wireless point to point links to get double available bandwidth and must be configured at both ends of the link. It is becoming common in mesh backhauls as well.

1 Like

I know what it is. I also want to use bonding, but I do not want that interface to appear out of nowhere without my explicit configuration.

Does the kmod-bonding package not provide any configuration files? Usually the kmod packages come with some /etc/modules.d/ file or something that sets parameters. Check that file.

It didn't come out of nowhere. It is created by default by kmod-bonding.

Exactly, you have not set up any bonding. For example you would set up two interfaces with proto bond in /etc/config/network depending on what you want to achieve.

This implies you do not want to use bonding. You would "delete" it by uninstalling kmod-bonding.

2 Likes

The simplest way of setting up bonding if you are not familiar with it is to use the luci ui.
You can then check for changes in the config files to get a better understanding of how it works.

For this, install luci-proto-bonding
In turn this will install the two packages needed for bonding, proto-bonding and kmod-bonding`

You need to have an absolute certainty of your configuration and everything else before attempting to deploy on a 4/32 device. Any experimentation should be done on a device with sufficient flash and RAM.

I don't see what bonding could accomplish on a WR741. It doesn't have the CPU or the wifi capability to outrun a single unbonded 100 Mb Ethernet port.

4 Likes