Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Similar to LXC, LXD 2.x can also assign static IP addresses. Almost similar approach but the files are slightly different.

Also note as of LXD 2.3 there are networking tools that take care of this.

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

sudo cp
sudo sed -i 's/LXD_CONFILE=""/LXD_CONFILE=""' /etc/default/lxd-bridge

Also, change the default DHCP range,

sudo sed -i 's/LXD_IPV4_DHCP_RANGE="10.232.27.2,10.232.27.254"/LXD_IPV4_DHCP_RANGE="10.232.27.100,10.232.27.254"' /etc/default/lxd-bridge

This will make available 10.232.27.3 to 10.232.99.

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.

  • No labels