LXD supports using
macvlan NIC type with
vlan setting (see Instance configuration - LXD documentation). What this does is to create a vlan interface ontop of the specified
parent interface (if it doesn’t already exist), and then setup a
macvlan interface ontop of that.
In this way it allows multiple instance NICs to connect to the same parent vlan interface.
In LXC you could achieve the same solution by manually creating the vlan interfaces on the parent interface, and then using the
macvlan device type to connect to the vlan interface as the link for your instances.
Alternatively you can setup a manual bridge and connect your physical interface to it, and then use bridge type devices in your LXC config using the
lxc.net.[i].veth.vlan.id setting to specify which VLAN the container should use on the bridge.