Config device add nic

lxc config device add vm-pOg7EM6Xk1 test1 nic nictype=ovn network=test-ovn ipv4.address= name=test-nic

I added a second network card to connect to the OVN network to a virtual machine using the above command, but the specified IPv4 address cannot be connected. How can I make IPv4 effective when mounting a device?

ipv4.address sets up a DHCP record in OVN, your instance still needs to run a DHCP client on the interface to get configured.