LXC & OpenVSwitch - Vlans, DHCP, & Multiple Virtual Nics


My team and I are trying to use LXD & OVS to create 1 container with 3 vlans & 3 virtual nics for a single vm and have them pass through to our switches.

We can see the VM being tagged with the 3 vlan’s but not getting IP addresses. We have DHCP turned on on the swich and have created three networks with matching VLAN ID’s. On the switch we have enabled DHCP for each network.

We are not getting any IP’s for any of the networks once the VM is up and running.

We have created a bond with 2 of our ports and that seems to be working fine.

I have outlined below what commands we have run in order to get this going.

Any hepl would be wonderful.

Ubuntu 22.04
LXD 5.20 Snap

Network Hardware:
Unifi UDMP
Switch USW Pro


sudo apt update

sudo apt upgrade

sudo snap switch lxd --channel=5.21/stable

sudo snap refresh

curl -fsSL https://tailscale.com/install.sh | sh

sudo apt install ovn-host ovn-central net-tools

sudo ovs-vsctl add-br ovsbr1

sudo ifconfig ovsbr1 up

sudo dhclient ovsbr1 &

sudo ovs-vsctl add-bond ovsbr1 bond1 enp179s0f0 enp179s0f1

sudo ovs-vsctl set port bond1 lacp=active

sudo ovs-vsctl add-port ovsbr1 bond1

sudo ip tuntap add mode tap vport1

sudo ip tuntap add mode tap vport40

sudo ip tuntap add mode tap vport60

sudo ifconfig vport1 up

sudo ifconfig vport40 up

sudo ifconfig vport60 up

sudo ovs-vsctl add-port ovsbr1 vport1 tag=1

sudo ovs-vsctl add-port ovsbr1 vport40 tag=40

sudo ovs-vsctl add-port ovsbr1 vport60 tag=60

lxd init

lxc launch ubuntu:22.04 ourvm

lxc config device add ourvm eth0 nic nictype=bridged parent=ovsbr1 name=eth0 vlan=1

lxc config device add ourvm eth1 nic nictype=bridged parent=ovsbr1 name=eth1 vlan=40

lxc config device add ourvm eth2 nic nictype=bridged parent=ovsbr1 name=eth2 vlan=60