Well LXD can only help with getting the public IP into your container if the public IP is already routed to your LXD host. If you only have a single IP and it is bound on your externally facing router then you cannot have it also inside your container.
Perhaps what you’re looking for instead is to have one or more ports on your external router (and thus your public IP) forwarded into your container?
What is it that you’re trying to achieve, beyond getting the public IP into the container that is?
I want for example my containers to have IPs like , for example , a new device which has connected to my home wlan. Meaning an IP like 192.168.2.X . I want the containers to be servers. In fact it doesn’t bother me to ping google for example . I want if for example i have a desktopA with 192.168.2.20 and desktopB with 192.168.2.15 , the i want to create at desktopB a container with name ImageSvc and ip 192.168.2.X so i can directly communicate with desktopA with anything else ( i have used proxy device which matches the ports and forwards the request).
Ah, so you don’t want your public IP in your container, but you want to bridge your containers onto your internal LAN.
(192.168.2.0/24 is a non-routable private IP range, not a public range, hence the confusion).
In that case you could either use the routed NIC type as per the link you originally sent, or you could setup a new bridge on your LXD host and use that as the parent device with the bridged NIC type.
Note: You said you were on wifi, I am not certain, but there may be issues with bridging onto a wifi network due to the way wifi uses additional MAC addresses. If that doesn’t work then try using the routed network as per the guide you originally linked to.
lxc config device add <container> eth0 nic nictype=routed parent=<lan interface> ipv4.address=<static lan address>
Then ensure that inside your container you remove the netplan config file in /etc/netplan to prevent eth0 from being reconfigured for DHCP, and restart your container.
If your solution doesn’t work with WiFi i am going to use routed from simos guide.
I understand everything simos has at his blog except from what changes i should make to the routed profile.
========================================================
You can create an empty profile, then edit it and replace the existing content with the following (lxc profile create routed, lxc profile edit routed).