I have two network cards on my computer. I want to create two net bridges with netplan to add this bridged networks to kernel based virtual machines (KVM). Both network cards are connected to the same router which has access to Internet.
I have the following network configuration using netplan
:
network:
version: 2
renderer: networkd
ethernets:
eth-host0:
match:
macaddress: xxx:97:02
dhcp4: false
dhcp6: false
eth-host1:
match:
macaddress: xxx:08:61
dhcp4: false
dhcp6: false
bridges:
br0:
interfaces: [eth-host0]
addresses: [192.168.0.9/24]
gateway4: 192.168.0.1
mtu: 1500
nameservers:
addresses: [8.8.8.8]
parameters:
stp: true
forward-delay: 4
dhcp4: true
dhcp6: false
br1:
interfaces: [eth-host1]
addresses: [192.168.1.9/24]
gateway4: 192.168.0.1
mtu: 1500
nameservers:
addresses: [8.8.8.8]
parameters:
stp: true
forward-delay: 4
dhcp4: true
dhcp6: false
when I issue command
sudo netplan apply
I got the following error "Problem encountered while validating default route consistency.Please set up multiple routing tables and use routing-policy
instead.
Error: Conflicting default route declarations for IPv4 (table: main, metric: default), first declared in br0 but also in br1"
If I delete default gateway, than apply passes but I do not have any networks on my virtual machine.
How do I properly configure two bridges on the same computer?