Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Also note as of LXD 2.3 there may be networking tools that take care of this. Not looking into 2.3 details yet as Ubuntu Server 16.04.2 LTS is packaged with 2.0.9.

You may also set these some of the range setting when the network is being setup when on running of the lxd init command.

Modify /etc/default/lxd-bridge to reference an external dnsmasq.conf,

Code Block
languagebash
sudo cp /etc/default/lxd-bridge /etc/default/lxd-bridge.ori
sudo sed -i 's/LXD_CONFILE=""/LXD_CONFILE=""' /etc/default/lxd-bridge

Also, change the default DHCP range,

...

This will make available 10.232.27.3 to 10.232.99.

Create a dnsmasq.conf file where you may reserve IP Addresses based on server names,

...

Modify /etc/default/lxd-bridge to reference an external dnsmasq.conf file,

Code Block
languagebash
sudo cp /etc/default/lxd-bridge /etc/default/lxd-bridge.ori
sudo sed -i 's/LXD_CONFILE=""/LXD_CONFILE=""' /etc/default/lxd-bridge


Reference

http://jason.trickett.us/2016/08/lxd-containers-static-ip-addresses-heres/ - Source article for this but missing some details on changing the default range otherwise you'll end up with collisions.