Docker pihole configuarion for dhcp - instructions not clear (with google wifi)

I'm trying to follow these instructions without success:
1 Google WiFi on 196.168.86.0/24 subnet, with IP 192.168.86.1
2 Pi is also on 192.168.86.0/24
3 Google WiFi has an IP reservation for the Pi, let's say 192.168.86.2
4 Google WiFi's IP pool range is a single address, that of the Pi
5 Google WiFi has Pi's IP as DNS server (and only that)
6 Pi's IP pool range does not overlap with Google WiFi's (in this example, 192.168.86.3 to whatever)
7 Pi has 192.168.86.1 configured as gateway

This list seems pretty straightforward. However, I think I have a configuration problem in the docker compose for pihole.

Instructions says:

  • For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
  • 67:67/udp is required if you are using Pi-hole as your DHCP server

It seems these two instructions contradictory each other. Should I add network_mode: host and remove all ports, including port 67 - or should I keep port 67? Should this be done before step 1 above?

Thank you for clarification

In host mode, a container is sharing ports from its host, so you can't remap ports.

In other network modes ((default) bridge), you'd have to declare the ports as required by a container, and you may remap them.

All of those above are Docker specifics.

Note that with DHCP, any mode isolating a container into its own network segment/link/collision domain (like bridge) would require configuration of a DHCP relay in all of the networks that want DHCP services from that isolated other-link container.
If your router does not offer a DHCP relay, you'd have to install that somewhere appropriate.

As most consumer grade routers do not support DHCP relay configuration, it is usually easier to run a DHCP container in host mode.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.