dhcplxd

LXD DHCP handing out IP addresses


I have been using LXC/LXD (4.0.4) for a while now and love the flexibility they provide - I however have started having some odd problems on my network. It seems the LXD is running a DHCP server and handing out address to other devices on my network.

I am running as a bridged network between the containers and the host computer and have assigned static address on the host machines as well as in the containers.

when i do a grep on DHCP on the host machine i see an LXD DHCP running and the address range that is being handed out to the other machines - as opposed to coming from the DHCP server i set up to address addressing.

Is there an easy way to disable the DHCP server, preferable through netplan or is there another method.

This problem is severely impacting my development as my test devices are getting the wrong IP assignments

Thank you in advance.


Solution

  • When you use LXD and you have configured a private bridge (that lxdbr0 network), then LXD has configured for you a dnsmasq instance that listens on the lxdbr0 network interface and responds to DHCP requests. That is, LXD responds only to the lxdbr0 network interface or what you get when you run the following command. All three network interfaces have their own dnsmasq because they are MANAGED by LXD.

    $ lxc network list
    +---------+----------+---------+---------------+------+-------------+---------+
    |  NAME   |   TYPE   | MANAGED |     IPV4      | IPV6 | DESCRIPTION | USED BY |
    +---------+----------+---------+---------------+------+-------------+---------+
    | lxdbr0  | bridge   | YES     | 10.10.10.1/24 | none |             | 25      |
    +---------+----------+---------+---------------+------+-------------+---------+
    | lxdbr1  | bridge   | YES     | 10.103.3.1/24 | none |             | 10      |
    +---------+----------+---------+---------------+------+-------------+---------+
    | lxdbr2  | bridge   | YES     | 10.20.30.1/24 | none |             | 5       |
    +---------+----------+---------+---------------+------+-------------+---------+
    

    LXD should not be able to give out DHCP releases to the LAN.