I did a quick search on the net for how to do bonding in combination with dhcpcd5 but there isnt much.
The bond interface configuration is still mostly done via ifupdown:
$ man ifup
[..]
DESCRIPTION
The ifup and ifdown commands may be used to configure (or,
respectively, deconfigure) network interfaces based on inter‐
face definitions in the file /etc/network/interfaces.
$ systemctl cat networking.service
# /lib/systemd/system/networking.service
[Unit]
Description=Raise network interfaces
Documentation=man:interfaces(5)
[..]
ExecStart=/sbin/ifup -a --read-environment
$ systemctl is-active networking.service
active
And assigning its IP through dhcpcd5 ... which is a bit of a mess.
If confident enough, you could decide to disable dhcpcd entirely (removing a dependency).
And configure everything through ifupdown with the help of below example:
Except that you want the bond0 interface to have a static IP instead of a DHCP one.
You could alter that segment like below:
# Define master
auto bond0
iface bond0 inet static
address 10.0.0.155
netmask 255.255.255.0
broadcast 10.0.0.255
gateway 10.0.0.1
bond-slaves none
bond-primary eth0
bond-mode active-backup
bond-miimon 100
EDIT: Dont forget the install in the introduction:
$ apt policy ifenslave
ifenslave:
Installed: (none)
Candidate: 2.9
Version table:
2.9 500
500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
EDIT2: Oh and you most likely need to exclude the eth0 & wlan0 interfaces from DHCP with below dnsmasq directive (one line for each interface):
$ man dnsmasq
[..]
-2, --no-dhcp-interface=<interface name>
Do not provide DHCP or TFTP on the specified interface,
but do provide DNS service.
Eg:
$ sudo nano /etc/dnsmasq.d/99-my-settings.conf
no-dhcp-interface=eth0
no-dhcp-interface=wlan0
And also run below one to reconfigure the main interface into that of the bond0 interface:
pihole -r