LXC 4.0.6 on Debian 11.6
By default “lxd init” created lxcbr0 and veth75a9dcc3@if9 interfaces and assigned some 10.x.x.x subnet to it.
That’s not what I wanted.
I need a transparent simple bridge (no DHCP, no DNSMASQ) with all containers behind using the same subnet as the host and the rest of the LAN (192.168.x.x).
I have a single Ethernet cable plugged into the host to eno1 interface (10 Gbps).
I have created the following bridge manually to /etc/network/interfaces:
# The loopback network interface
auto lo
iface lo inet loopback
# Bridged network interface
auto br0
iface br0 inet static
bridge_ports eno1
bridge_stp off # disable Spanning Tree Protocol
bridge_waitport 0 # no delay before a port becomes available
bridge_fd 0 # no forwarding delay
address 192.168.x.x/22
gateway 192.168.x.x
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.x.x
dns-search example.com
It comes up after a reboot and seems to be working fine.
Now when I try to replace lxcbr0 with br0 I get:
lxd init
(...)
Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes
Name of the existing bridge or host interface: br0
(...)
Error: Failed to update profile "default": Device validation failed for "eth0": Cannot use "nictype" property in conjunction with "network" property
Eth0 seems wrong as I don’t seem to have any such interface on the host.
I’ve also tried “lxc profile edit default”
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:
- /1.0/instances/test
I’ve tried replacing eth0 with eno1 or br0 and lxdbr0 with br0 but for everything I’ve tried I’m getting errors:
Config parsing error: Device validation failed for "eth0": Failed loading device "eth0": Failed to load network "br0" for project "default": Network not found
or
Config parsing error: Device validation failed for "eno1": Failed loading device "eno1": Failed to load network "br0" for project "default": Network not found
or
Config parsing error: Device validation failed for "br0": Failed loading device "br0": Failed to load network "br0" for project "default": Network not found
What do I need to do to accomplish my goal and replace or modify my network bridge?