2021-01-07 08:07

Question: reload bridge configuration post 2.3

  • Distribution: Ubuntu
  • Distribution version: Xenial
  • The output of "lxc info" or if that fails:
  • Kernel version: 4.4.0-53-generic
  • LXC version: 2.15
  • LXD version: 2.15
  • Storage backend in use: btrfs

Issue description

Prior to 2.3 I was using static IP entries for my containers. This was referenced in the file /etc/default/lxd-bridge

# Path to an extra dnsmasq configuration file

and the file itself:



How can I reload the bridge configuration when adding another static entry to that file with lxd > 2.3?



  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39688875 weixin_39688875 4月前

    If you move your custom config to raw.dnsmasq, then whenever you change the value of that key, LXD will restart dnsmasq.

    But note that in your case, it may just be easier to set the ipv4.address property on the container's network device, which will have LXD setup the static entry for you.

    lxc config device add cont1 eth0 nic nictype=bridged name=eth0 parent=lxdbr0 ipv4.address=
    点赞 评论 复制链接分享
  • weixin_39844880 weixin_39844880 4月前

    Hi ,

    thanks for the hint. But why would this value change if I set it once with lxc network set lxdbr0 raw.dnsmasq conf-file=/etc/default/lxd_dnsmasq.conf ? I guess I´ll stick with you second proposal :)

    Speaking of dnsmasq: how does lxd use dnsmasq as I see that the service isn´t started but in the process list I see a dnsmasq instance running?

    点赞 评论 复制链接分享
  • weixin_39688875 weixin_39688875 4月前

    it wouldn't, but you could just move the content of /etc/default/lxd_dnsmasq.conf to the raw.lxc config key itself.

    LXD spawns dnsmasq directly, similar to what libvirt and a bunch of other daemons do. That way it doesn't interfere with an existing system daemon. LXD also needs one dnsmasq instance per bridge it manages, which isn't something the normal distro init script supports.

    点赞 评论 复制链接分享
  • weixin_39844880 weixin_39844880 4月前

    Thanx, got it

    点赞 评论 复制链接分享