These steps are my understanding of LXC/LXD containers at the time they were created. I am still learning. (Here there be dragons.)
This will be the host (server) for the containers.
Note:
UFW is a simplified interface to iptables.
After installation enable it, if it isn't already.
Note: I don't know which ports "lxc launch" (and other steps) require open so I temporarily open them all.
At the time of these steps, 22.04 is the latest ubuntu LTS distribution. If there is a newer one use it.
You should see the HTML for the home page. This verifies the server is working and is available from the host.
This allows access to ports 80 and 443.
I'm working on it. It is complicated.
Since ufw 0.34 ufw supports forward rules.
You also need to make sure you have the sysctl net.ipv4.ip_forward enabled. For most distributions, that's done by editing /etc/sysctl.conf and running sysctl -p or rebooting.
ufw doesn't support NAT through it's easy interface, though.
From serverfault.com/questions/238563/can-i-use-ufw-to-setup-a-port-forward
ifconfig (Wikipedia)
In a Linux system, "eno1" is a naming convention for the first onboard Ethernet network interface card (NIC). It signifies that the network adapter is integrated directly into the computer's motherboard and is the first such device recognized by the system.Note: eth0, eth1, ... were traditionally the names used for Ethernet interfaces, but modern systems often use predictable naming schemes like "eno1" for better consistency.
An LXC bridge network allows Linux containers (LXC) to communicate with each other and with the host machine as if they were on the same physical network segment. It effectively creates a virtual switch, enabling direct communication between containers and the host, similar to how virtual machines or physical devices on a network interact.
container instance host ip address.
container instance (webserver) ip address.
How to Configure Bridge Networking in LXD
How to configure LXD network to host bridge?
LXC Container on same network as host with internet access
Apache HTTP Server (Wikipedia)
iptables (Wikipedia)
LXC - Guide to building a LXC Lab
How to configure ufw to forward port 80/443 to internal server hosted on LAN
lxc container assigned ip address by external dhcp server
UFW (Ubuntu - Community Help Wiki)