Thank you very much for this! Exactly what I need!
I'm having some issues trying to get this to work - I've hopefully followed all the instructions, but I've got the following message on my Windows box "An error occurred while renewing interface Ethernet 2 : unable to contact your DHCP server. Request has timed out."
Hi, Thank you very much for this amazing post. I have a small question, I followed all the instructions, I don't see any errors per se' my setup should be working but I can't seem to access my pi-hole from the "ServerIP" which is in my case is 192.168.0.14 (where my mini-server is living). The logs from the pi-hole seems all to be fine following are last few lines from the logs:
I really can't seem to understand what is happening. I think it is either stuck somewhere or did something wrong. The one thing I can think of is the "frontproxy_proxy-tier" network, docker complain the network did not exists, and I simply created it.
Also I ssh'd into the pi-hole container:
root@809820f86916:/# pihole status
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled
Thanks a lot for this small tuto and explanation.
I'm having the network bridge problem. PiHole shows only one IP address in the Client column, which in my case is 172.18.0.1. Of course I'd love to have the real IP address of each client.
Then I followed the method to try to fix it.
I'm not getting any errors and everything seams to work but it didn't solve my problem, I still have only this IP visible.
My router doesn't support dhcp relay.
I don't need to use dhcp in pihole as I'm using dhcp from my router.
My only goal is to solve the client email showing wrong.
Can someone help me on this? did I do something wrong in following the tuto ?
When I first ran docker-compose up -d, it prompted that the network frontproxy_proxy-tier was not present. The prompt suggested using docker network create frontproxy_proxy-tier. Is that what I'm supposed to do?
Also, what should I put in the "Ranges of IP addresses to be given out" and "Router (gateway) IP address" in the Pihole GUI? Should this be the network range 192.168.0.2-192.168.0.255 with my router being 192.168.0.1?
Additional information:
my router: 192.168.0.1
Pihole: 192.168.0.2 (docker network 172.20.0.2)
From my understanding (I could be completely wrong), having the dhcphelper container in host network mode and bridging it to the pihole container would be enough to make this setup work, right? (At least I've tried it like this and it works fine)
I say this because I don't understand the purpose of the frontproxy_proxy-tier network. It is external, which the docs state it means the following (that's why @ggl-wolfy receives that error):
This network has been created outside of Compose. docker-compose up does not attempt to create it, and raises an error if it doesn’t exist.
@DerFetzer: Is the frontproxy_proxy-tier network something specific to your setup but unnecessary in general?
Also, @ggl-wolfy: I think your configuration is OK, at least I've done something similar and it works.
@ggl-wolfy If you are not using a reverse proxy you have to forward port 80 of the pihole container to the host and can remove the external network. ServerIP has to be set to your external IP address (192.168.0.2).
Yes, the range is what you want the DHCP server to hand out IP addresses from. You could leave out some IP addresses when you want to use a range independently from Pi-hole.
@DerFetzer Sorry to bother you, but I still have some problems with the setup.
Thanks for the explanation regarding the network. I am indeed using a reverse proxy by linking Pihole from another container within the same network using http://pihole:80. So I have removed frontproxy_proxy-tier. That's ok?
I have now set Server IP to 192.168.0.2, and the network range and gateway as mentioned above.
A dev suggested (don't remember where) using 99-dhcp-debugging.conf which contained the line log-dhcp for troubleshooting, and I got the following when going through pihole.log: no address range available for DHCP request via eth0
ifconfig on my raspberry pi:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255
If you could provide me with some advice? Thank you.
Though 192.168.0.255 is a valid address, maybe dnsmasq has a problem with it. You could try 192.168.0.254 instead.
How does your 02-pihole-dhcp.conf look like?
Thanks. I made the change and I still receive the same error. Here's 02-pihole-dhcp.conf:
###############################################################################
# DHCP SERVER CONFIG FILE AUTOMATICALLY POPULATED BY PI-HOLE WEB INTERFACE. #
# ANY CHANGES MADE TO THIS FILE WILL BE LOST ON CHANGE #
###############################################################################
dhcp-authoritative
dhcp-range=192.168.0.2,192.168.0.254,24h
dhcp-option=option:router,192.168.0.1
dhcp-leasefile=/etc/pihole/dhcp.leases
I also have dhcp-option=option:dns-server,192.168.0.2 in 07-dhcp-options.conf as described in the above guide.
Thanks so much for this. Made this account just to thank you. I have been trying to sort the DHCP server on my pihole for ages and this really helped. Simple when you know what your doing. only thing that threw me was that the docker-file must actually be called "Dockerfile" (case sensitive)
Since the dhcphelper container's network is configured to run in "host" mode, can it even see bridged network? ie. -s 172.31.0.100 should be invisible to the dhcp-helper docker right?