but this seems to not have any effect.
Just for testing I also removed the entry from `/var/lib/incus/networks/incusbr0/dnsmasq.leases or modified an entry and then restarted incus.service without any change.
On the network (incus network edit foo) you should be be able to set ipv4.dhcp.ranges to a value which excludes the address(es) that you want to reserve, e.g.
ok sure - I can reduce the dynamic range and set up the ip/network in the container itself without dhcp.
What I’m more after is how could I make a specific lease (with a specifi ip from the pool) to stay forever similar to the configuration above. That way you could just copy a container, move it to another cluster and you don’t have to worry about the container’s internal network
You simply apply the address you want to the container config:
devices:
eth0:
ipv4.address: 192.0.2.9
ipv6.address: fdfd::9 # this requires ipv6.dhcp.stateful on the network
name: eth0
network: bridge0
type: nic
I suggest you choose an address which is within the managed network subnet, but outside the dynamic DHCP pool. (I am guessing incus is clever enough to exclude all container assignments from pool allocations; but if you move it to another cluster and want to keep the same IP, obviously you don’t want another container in the target cluster to have picked up that address dynamically already)
is what I currently do for that instance but what I had in mind is to have dhcp address mapping on a single incus host like we usually do in a incus unmanaged bridged network in other networks: we set the “static ip” on the dhcp server. This allows us to move a container between networks and to be sure the container will allways get the same network specific address which fits to that subnet - even months later.
Since incus uses dnsmasq on it’s managed networks I thought it should be possible to do the mac/ip config the dnmasq way (dhcp-host=<mac>,<ip>)
In Incus Version 6.8, the container dnsmasq host file has the configured ipv4.address in the container config but removing dnsmasq.leases, reloading the container and restarting incus does not seem to work. The container still has its original DHCP address.