Manage LDX (Canonical documentation)
LDX containers (Ubuntu documentation)
From: HERE.
DHCP server from LXD (not a system DHCP server).
If you have some other DHCP server on your host, it may conflict with the one by LXD.
So, show us the output of
Use lxc network create <network_name> type=macvlan parent=<host_interface> to create a macvlan network. Replace <network_name> with a name for your network and <host_interface> with the name of your host's network interface (e.g., eth0).
Add the macvlan network to the container's configuration using lxc config device add <container_name> <device_name> nic nictype=macvlan parent=<network_name>. Replace <container_name>, <device_name>, and <network_name> with the appropriate values.
The container will now be able to obtain an IP address from your DHCP server or you can assign it a static IP address using lxc config device set <container_name> <device_name> ipv4.address=<container_ip>/<subnet_mask>.
You should now be able to access the container directly using its IP address on the public network.