LXD Containers with Static IP Addresses
- 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
LXD_CONFILE="/etc/default/lxd_dnsmasq.conf"
...
- Edit /etc/default/lxd_dnsmasq.conf and add container ip setting
$ sudo vi /etc/default/lxd_dnsmasq.conf
# dhcp-host=containername,ipaddress
dhcp-host=myc1,10.0.3.10
- 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
Reference:http://jason.trickett.us/2016/08/lxd-containers-static-ip-addresses-heres/
Written on November 18, 2016