# Pihole behind Traefik handling DHCP in Docker

**URL:** https://discourse.pi-hole.net/t/pihole-behind-traefik-handling-dhcp-in-docker/42835
**Category:** Help
**Created:** [January 11, 2021, 6:46pm UTC](https://discourse.pi-hole.net/t/pihole-behind-traefik-handling-dhcp-in-docker/42835 "2021-01-11T18:46:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Shedin](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/shedin/32/21103_2.png) [@Shedin](https://discourse.pi-hole.net/u/Shedin)
#### Post date: [January 11, 2021, 6:46pm UTC](https://discourse.pi-hole.net/t/pihole-behind-traefik-handling-dhcp-in-docker/42835/1 "2021-01-11T18:46:37Z")

</div>

I'm trying to understand how to setup Pihole handling DHCP for my local network while using a reverse-proxy. I came across [this](https://docs.pi-hole.net/docker/DHCP/) in the doc and [this post](https://discourse.pi-hole.net/t/dhcp-with-docker-compose-and-bridge-networking/17038).  
The doc mentions this post saying it works well with reverse proxies but doesn't go into any details.

What's troubling me is in the post, the dhcp\_helper is started in host mode, how does this work with Traefik?

What I've managed so far: running Pihole with DHCP without Traefik or running pihole behing Traefik without DHCP (usless because I can't change my modem's DNS servers)

I'm mostly looking for pointers as I can't find anything else relevant to what I'm truing to do.  
Thanks

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [January 11, 2021, 7:05pm UTC](https://discourse.pi-hole.net/t/pihole-behind-traefik-handling-dhcp-in-docker/42835/2 "2021-01-11T19:05:31Z")

</div>

> [@Shedin](#):
>
> how does this work with Traefik?

Traefik isn't involved in DHCP. DHCP is a broadcast protocol using UDP packets. The dhcp\_helper needs to be on the network segment that the clients will broadcast to, hence the need ot be in host mode. The helper forwards the DHCP broadcasts to the DHCP server that's on a different network segment and then broadcasts the response from the DHCP server to the client broadcast domain.

> **[Dynamic Host Configuration Protocol | Operation](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Operation)**
>
> The DHCP employs a connectionless service model, using the User Datagram Protocol (UDP). It is implemented with two UDP port numbers for its operations which are the same as for the bootstrap protocol (BOOTP). The server listens on UDP port number 67, and the client listens on UDP port number 68.
> DHCP operations fall into four phases: server discovery, IP lease offer, IP lease request, and IP lease acknowledgement. These stages are often abbreviated as DORA for discovery, offer, request, and ack...

---

<div class="post-metadata">

### Author: ![Shedin](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/shedin/32/21103_2.png) [@Shedin](https://discourse.pi-hole.net/u/Shedin)
#### Post date: [January 12, 2021, 5:17pm UTC](https://discourse.pi-hole.net/t/pihole-behind-traefik-handling-dhcp-in-docker/42835/5 "2021-01-12T17:17:05Z")

</div>

I read more, including on DHCP and I was a bit confused. DHCP broadcasts won't go through Traefik and dhcp\_helper is just there to forward DHCP broadcasts. Dhcp\_helper needs to be in host mode to be in the same network than the clients.  
Thank you for hepling a complete newbie such as me.

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [February 2, 2021, 5:17pm UTC](https://discourse.pi-hole.net/t/pihole-behind-traefik-handling-dhcp-in-docker/42835/6 "2021-02-02T17:17:10Z")

</div>

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