netplan yaml file apply error while setting up Bridge and Bonding port on Ubuntu server 18.04

Your yaml shows that you have interfaces indented under nameservers. The interface list is clearly not part of the nameserver configuration. It needs to be indented so that it is in line with the other top-level properties of br0.

Your bonds section also needs to be indented at the same level as ethernets and bridges.


Use this .yaml. Keep the EXACT same spacing and indentation...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp2s0f0:
      addresses: []
    enp2s0f1:
      addresses: []
  bridges:
    br0:
      addresses:
        - 10.1.1.100/24
      gateway4: 10.1.1.254
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4
        search: []
      interfaces:
        - bond0
  bonds:
    bond0:
      interfaces:
        - enp2s0f0
        - enp2s0f1
      parameters:
        mode: balance-rr

sudo netplan generate

sudo netplan apply

reboot