Basic lxc allows you to spin up lightweight system containers for testing. But if you're running a host firewall you may find it prevents your containers from acquiring an IP address over DHCP for networking, and from connecting to external hosts (like distro package servers).
NOTE: I don't use lxc in production, and have purged it from all my machines after some experimentation. Diving deeper into Docker seemed a better use of my time.
If running ufw on Ubuntu you should be able to fix that with the following command:
$ sudo ufw allow in on lxcbr0
$ sudo ufw route allow in on lxcbr0
$ sudo ufw route allow out on lxcbr0
Thomas Parrott. "Lxd bridge doesn't work with IPv4 and UFW with nftables". Linux Containers, 11 Sept 2023, https://discuss.linuxcontainers.org/t/lxd-bridge-doesnt-work-with-ipv4-and-ufw-with-nftables/10034/17.
Ki9 (Keith). "LXD/LXC containers not getting IP from lxdbr0". Linux Containers, 12 July 2023, https://discuss.linuxcontainers.org/t/lxd-lxc-containers-not-getting-ip-from-lxdbr0/9357/3.
"Linux Containers: Firewall considerations". ArchLinux Wiki, https://wiki.archlinux.org/title/Linux_Containers#Firewall_considerations.