I try to setup a bridge and bonding port on Ubuntu 18.04 server, got a error message:
/etc/netplan/00-netcfg.yaml:15:33: Error in network definition: unknown key 'interfaces' interfaces: ^ Anyone can help what's wrong? the yaml file detail as:
network: bridges: br0: addresses: - 10.1.1.100/24 dhcp4: false dhcp6: false 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 ethernets: enp2s0f0: addresses: [] dhcp4: false dhcp6: false enp2s0f1: addresses: [] dhcp4: false dhcp6: false 3 2 Answers
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-rrsudo netplan generate
sudo netplan apply
reboot