Proxy Not an ip address

Good morning,

After updating LXD, I can no longer set up the proxy. It says that the virtual machine needs a static IP. When I first installed LXD, I didn’t need to configure anything; I would just add the ports and didn’t have to do anything else as shown in the following image. But now it doesn’t work.

I’ve tried it like this:

And like this:

If I use the terminal and set a static IP with the LXD command, I can do the configuration, but SSH access is very limited, and it’s not practical to do this every time I set up a machine. Is there a more practical solution?

I am using the official images available in LXD.
Also, it works fine with containers, but it’s only with virtual machines that this issue occurs.

Version: Version 5.21.4-ui-0.15.2

Thank you.

Hi,

What is the output of snap list.

VMs require NAT mode because they dont use a proxy process but rather use NAT rules to direct traffic from the host to the VM.

Because of this the listen address must be a specific IP (not the wildcard address 0.0.0.0 you’ve specified) and the connect address must be a static IP inside the VM.

In order to assign a static IP to the VM, the VM’s eth0 NIC device should have an ipv4.address setting specified, so that LXD creates a static DHCP reservation.

This behaviour isn’t new. Perhaps you were configuring a container before, as containers support more flexible options.

Hi,

Thank you for the answer. What was happening earlier is that I’m using an Nginx proxy in front of that service, and the Nginx proxy is running in a container where this configuration can be adjusted, I just forgot about that detail.

Is it possible to make the default DHCP configuration define static IPs on lease? Can I change that through the web UI, or is it only possible via CLI?

Thanks for your help!

1 Like

When you set the ipv4.address setting on a LXD bridged NIC device this creates a persistent static lease in LXD’s managed DHCP server.

This can be achieved from the CLI using:

lxc config device set <instance> <NIC name> ipv4.address=n.n.n.n

If the NIC device is coming from a profile then you will need to use:

lxc config device override <instance> <NIC name> ipv4.address=n.n.n.n

@edlerd is it possible to set IPv4 address on a bridged NIC from the UI?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.