This is the contents of a /etc/netplan/config.yaml file for a 2 ethernet port bonded system using LACP (via managed switch) and DHCP to get the bonded IP configuration.
network:
version: 2
renderer: networkd
ethernets:
enp4s0:
dhcp4: false
optional: true
enp5s0:
dhcp4: false
optional: true
bonds:
bond0:
dhcp4: yes
interfaces: [enp4s0, enp5s0]
parameters:
mode: 802.3ad
lacp-rate: fast