docker dhcp

作者: admin 分类: 乱7八糟 发布时间: 2018-05-04 15:25 ė 6 没有评论

Docker controls the IP address assignment for network and endpoint interfaces via libnetwork’s IPAM driver(s). On network creation, you can specify which IPAM driver libnetwork needs to use for the network’s IP address management.

Libnetwork’s default IPAM driver assigns IP addresses based on its own database configuration. For the time being, there is no IPAM driver that would communicate with an external DHCP server, so you need to rely on Docker’s default IPAM driver for container IP address and settings configuration.

The need for external DHCP server support has been identified, however, there is currently no sign that libnetwork developers are working on it. There are community efforts to produce a DHCP IPAM driver, but are currently not production ready.

If you critically rely on your DHCP for IP address management in your production, you can use pipework for the time being.

Alternatively, you can use both DHCP and Docker’s default IPAM on the same Layer 2 segment (a segment that covers both the physical network and the Docker hosted macvlan), with DHCP server providing data for hosts outside Docker host and IPAM providing data for Docker containers. In this case you should split the IP space and ensure DHCP does not suggest IPs in IPAM’s space and vice versa. You can exclude DHCP served IP addresses when creating docker network with –aux-address parameter, i.e.:

docker network create -d macvlan \
–subnet= –gateway= \
–aux-address= \
–aux-address= \
–aux-address= \
–aux-address= \
–aux-address= \
-o parent=eth0 \


本文出自 小Q,转载时请注明出处及相应链接。