VLAN tagging from within containers?


I am running LXD 5.9 on Ubuntu 22.04 LTS. My host is connected to a trunk port with all frames tagged currently. I have the host vlan setup on the management vlan. All is working as expected.

Just had a quick question pertaining to tagging frames from within containers. I have tested using a netplan config to tag packets on the host interface, and that is working fine. I was curious if there is a method to tag the frames using the interface config inside the container? I have tested using macvlan using a lxd network and profile, all of that seems to work fine. Not sure if I will have issues live migrating instances with macvlan yet, but the tagged frames seem to work fine.

Is it possible to configure the NIC device (in the container) with a vlan ID to tag frames, and pass it to the physical interface on the host? Or would this just add unnecessary complexity? I can configure the NICs with cloud-init, but thought I would ask before setting this all up and breaking something. I looked into OVS but that seems like just another added layer I don’t need just yet.

Thank you

While I wasn’t able to tag frames from the container/VM, I was able to setup tagging from the network config, with: lxc network create -t macvlan parent=enp2s0 vlan=

Big Thanks to the LXD team for such a stable and agile container and VM management system as LXD.