very short memo

change IP address range

As described in previous posts, we have some servers in lxc network now.

I would like that servers shall have static IP addresses. Say, in the range from until

And client shall have dynamically assigned address, which should not conflict with server’s ones. Let’s limit range of IP addresses, which DHCP Server, dnsmasq assigns for.

You can configure IP address range by modifying lxc file under /etc/default directory.

$ diff lxc
< LXC_DHCP_MAX="100"
> LXC_DHCP_MAX="253"

After restart, you will see that dnsmasq will set IP address range as follows:

dnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/lxc/ --conf-file= --listen-address --dhcp-range, --dhcp-lease-max=100 --dhcp-no-override --except-interface=lo --interface=lxcbr0 --dhcp-leasefile=/var/lib/misc/dnsmasq.lxcbr0.leases --dhcp-authoritative