Configure a LXD container to be in a specific VLAN
I run several LXD containers on server in the basement with a trunk and multiple VLANs. Previously, I configured an interface for each VLAN on the host. This was very stupid and ineffective. The host was reachable from almost all the VLANs and it caused routing problems.
I looked for a solution and didn’t really find anything documented. Then I tried this and it worked !
You can actually configure a profile with eth0 in a specific VLAN (lanprofile is the name of one of my LXD profiles). I removed the VLAN interface on the host and it works. All my “lanprofile” containers are now in VLAN 100 (tagged).