LXD Containers with Static IP Addresses

  1. Edit /etc/default/lxd-bridge and change the value of LXC_CONFILE
$ sudo vi /etc/default/lxd-bridge


# Path to an extra dnsmasq configuration file


  1. Edit /etc/default/lxd_dnsmasq.conf and add container ip setting
$ sudo vi /etc/default/lxd_dnsmasq.conf

# dhcp-host=containername,ipaddress


  1. Stop container. restart lxd-bridge, start container
$ sudo lxc stop myc1

$ sudo service lxd-bridge stop && sudo service lxd-bridge start

$ sudo lxc start myc1


Written on November 18, 2016