I have always used interfaces configured via ifupdown as LXD interfaces and now I am discovering LXD managed bridges. However, I can’t figure out how they work.
My system bridges:
pulsarr@thaumas:~$ cat /etc/network/interfaces.d/3-lxdbr0.network
# Ansible managed
iface lxdbr0 inet static
dns-nameservers 192.168.1.32 22.214.171.124 126.96.36.199
pulsarr@thaumas:~$ cat /etc/network/interfaces.d/5-lxdbr50.network
# Ansible managed
iface lxdbr50 inet manual
Is it possible to do the same thing with managed bridges? The idea is to benefit, at least on lxdbr50, from DHCP and DNSmasq.
Thank you in advance for your response.
You can’t do something like your
lxdbr0 through LXD and in general such bridges which provide host connectivity are best done through ifupdown.
However, for a bridge like your lxdbr50, that definitely can be done (and probably should be done) through LXD.
lxc network create lxdbr50 would give you a similar bridge with DHCP, DNS and IPv4/IPv6 subnets. You can turn off IPv4 or IPv6 (or both) by setting
I understand about lxdbr0, so I continue with ifupdown for him.
About lxdbr50, how can I set eth0.50 as “bridge_port” on LXD bridge ? My LXD subnet is on VLAN50.
You can set
eth0.50 however, you’ll need that interface to exist ahead of time, so will need to define it as a VLAN in your ifupdown config.
I must have missed something:
pulsarr@infra-odroidc4-neree:~$ lxc network set lxdbr50 bridge.external_interfaces=eth0.50
Error: Config key "bridge.external_interfaces" is cluster member specific
pulsarr@infra-odroidc4-neree:~$ lxc network show lxdbr50
You seem to have clustering enabled for some reason.
In this case, you’ll need
lxc network set lxdbr50 bridge.external_interfaces=eth0.50 --target neree
There’s some more info about LXD managed bridges here too: