HI @cemzafer thank you for your answer, I have tried as suggested but the IP address remains the same, could it have anything to do with my local DHCP server?
In LXD you can have managed and unmanaged networks. If the network is unmanaged, it just means that LXD does not manage it. Hence, LXD would not know information about the IP address, etc.
You have a case of unmanaged network (br0), in addition to a managed network (lxdbr0).
You can view what LXD considers as managed and unmanaged, if you run lxc network list.
Thank you for the clarification, it seems my solution to changing the IP of the container using an unmanaged bridge would be to SSH into the container and change the network settings from within.
The very latest LXD, LXD 4.5, is able to create a managed macvlan. That is, the container is accessible from the LAN but the IP address it takes, has been provided by LXD. See more at LXD 4.4 has been released (managed macvlan).
All in all, I suggest the proxy device, possibly with the NAT option.
We are looking for a solution where the containers are in the same LAN where the host lives and we can assign them IPs from the LAN, what would be the best solution?
You can setup the DHCP server of the LAN to assign static IP addresses to the containers.
Instead of an LXD issue, it becomes a router issue and your router handles the IP addresses.
Thank you for answering. Our most important scenario is static assignement of public IPs to our containers - those IPs belong to the same network where the host lives and should be transparently available (bridged) to the containers. What would be the recommended LXD configuration for this?
I assume your host is connected to the LAN with an Ethernet card (and not a WiFi adapter).
In that case, you can use either a bridge or macvlan. Between the two, macvlan has the feature that the containers will not be able to access the host over the network. Due to this, macvlan is probably not what you would like to use.
In the given scenario, how would you manage static IPs?
I currently have a bridge that has been applied to a profile as specified and when applied to containers they get their respective LAN IPs and are working fine.
However I would also like to set a static LAN IP for certain containers. Could you give any advice on this scenario?
In our particular case it is a datacenter public network, where there is no DHCP and ranges of IPs have to be assigned statically. Can LXD manage these settings somehow?
You can create LXD profiles for each container so that they their network configuration from cloud-init instructions.
Or you can setup a DHCP server on the host to cater for the containers. This would be a separate DHCP server from the one of LXD, and would bind on the bridge.
Or, you can try managed macvlan with LXD 4.5 or newer.