

docker run -net=host if you don't use docker-composeĪdvantages: Works well with NAS devices or hard port conflictsĪ Macvlan network is the most advanced option since it requires more network knowledge and setup.Inside your docker-compose.yml remove all ports and replace them with: network_mode: host.It will have the same IP as your Docker host server in this mode so you may still have to deal with port conflicts. Possibly the simplest way to get DHCP working with Docker Pi-hole is to use host networking which makes the container be on your LAN Network like a regular Raspberry Pi-hole would be, allowing it to broadcast DHCP. Docker Pi-hole with host networking mode ¶ Here are details on setting up DHCP for Docker Pi-hole for various network modes available in docker. In order to get DHCP on to your network there are a few approaches: Working network modes ¶ However, DHCP protocol operates through a network 'broadcast' which cannot span multiple networks (docker's bridge, and your LAN network). You gain access to the isolated container's service ports by using port forwards in your container's runtime config for example -p 67:67 is DHCP. Technical details ¶ĭocker's bridge network mode is default and recommended as a more secure setting for containers because docker is all about isolation, they isolate processes by default and the bridge network isolates the networking by default too. This document details why Docker Pi-hole DHCP is different from normal Pi-hole and how to fix the problem. Optional: Dual operation: LAN & VPN at the same timeĭocker runs in a separate network by default called a docker bridge network, which makes DHCP want to serve addresses to that network and not your LAN network where you probably want it.
