Access Point Devices can't reach Pi-Hole-DHCP

My Network Setup consists of two Routers, one LTE Router (Router 1) working as a Gateway to the Internet, the other one (Router 2) working as Access Point in order to expand the network accessibility.

In addition, a RPi Zero running Pi-Hole acts as the DHCP Server of the Network.

Expected Behaviour:

Pi-Hole (DHCP) should be capable of reaching every device within my network and assign the correct IPs.

Actual Behaviour:

Devices connecting via Router 2 get IPs outside the specified range e.g 169.254.246.237 --> Pi-Hole DHCP somehow can't communicate with devices connected to Router 2.

Network Setup:

Router 1:

  • Model: Huawei E5186s-22a. (Sometime advertised as "Huawei Webgate")
  • Firmware: 21.306.01.07.22 (Standard Huawei Firmware)
  • IP: 192.168.1.1
  • DHCP is deactivated.
  • This Router establishes the connection to the internet.

Router 2

  • Model: Linksys WRT54GS Version 6
  • Firmware: DD-WRT v3.0-r40559 micro (08/06/19)
  • IP: 192.168.1.2
  • Subnet Mask: 255.255.255.0
  • Gateway: 192.168.1.1
  • Local DNS: 192.168.1.1
  • DHCP is deactivated.
  • This router works as Access Point and has been configured according to this Guide (Normal Version (Same Subnet)

Router 1 and Router 2 share one Wireless SSID but work on different channels.

DHCP Server:

  • Model: RPi Zero with Pi-Hole installed
  • Pi-hole version is v4.3.2 (Latest: v4.3.2)
  • AdminLTE version is v4.3.2 (Latest: v4.3.2)
  • FTL version is v4.3.1 (Latest: v4.3.1)
  • IP: 192.168.1.10
  • DHCP enabled:
  • DHCP Range: 192.168.1.100 - 192.168.1.250
  • Router (gateway) IP address: 192.168.1.1 (Router 1)
  • Enable IPv6 support (SLAAC + RA) --> Enabled
  • Enable DHCP rapid commit (fast address assignment) --> Enabled

Wiring:

  • There's a wired ethernet connection between Router 1 LAN 1 and Pi-Hole (DHCP).
  • There's a wired ethernet connection between Router 1 LAN 2 and Router 2 LAN 1.

Solution:

It turned out Router 1 has a LAN/WAN Port. As soon as I plugged Pi-Hole into that Port, everything started working.

Final working wiring setup:

  • There's a wired ethernet connection between Router 1 LAN/WAN Port and Pi-Hole (DHCP).
  • There's a wired ethernet connection between Router 1 LAN 1 and Router 2 LAN 1.

Debug Token: https://tricorder.pi-hole.net/q69vl5peen

1 Like

This is not a Pi-hole issue:
Router 1 and Router 2 are sharing the same IP, rendering your network configuration invalid.

Thus, your clients switch to basic network configuration using only their link-local addresses (from the 169.254.0.0/16 range). Such addresses are only valid on the current link (e.g. the same cable or WiFi), so they can't cross routers, switches and the like.

Router 1 and Router 2 should be on different IPs.

Thanks for the fast reply. The IP of Router 2 is 192.168.1.2. Got that wrong in my first post.

In that case, your clients broadcasts for a DHCP server are not answered correctly, either because the broadcasts don't reach your Pi-hole or because Router 2 does not recognise Pi-hole as DHCP.

Try to configure Router 2 to distribute Pi-hole as DHCP server, or connect your Pi-hole to Router 2.

There even is a DHCP Forwarder Option on Router 2 (Linksys running DD-WRT).
Added PiHole as DHCP Server and it works.
Thank you!

Edit --> turned out it did not work. The IP automatically obtained IP Adresses still don't match the specified range. They all get 169.254....

1 Like

(I certainly didn't like this one :wink: )

What did make you think it worked 2 days ago?
Or put differently: What does make you think it is not working now, after 2 days?
Anything happening in the meantime?

What did make you think it worked 2 days ago:
I use a Pi running Kodi LibreElec as Media Center and originally assigned a manual IP within the GUI. I thought I changed the IP configuration 2 days ago to automatic and the Pi got the desired IP. Today I plugged in another device and since it did not get a correct IP I checked on the Media Center again and noticed that I probably never saved to auto ip configuration in the first place. Must have simply forgotten to save.

That new device, is it connected to Router 1 or Router 2?

Also, what about other devices in your network?

Router 2 via ethernet cable.

All Wifi devices get IPs within the specified DHCP Range.

(It's quite funny watching you format and reformat your answer :wink: )

Let me try to explain what is happening on your network in more detail:

As mentioned before, an IP address in the 169.254.0.0/16 range indicates that your new device (and maybe your Kodi-Pi as well) is not receiving an answer to its DHCPDISCOVER broadcast.

Note that broadcasts are only visible for clients on the same network segment (for simplicity, let's assume that to be the same cable or WiFi connection, or the same router at the moment).

So not receiving an answer from your Pi-hole -connected to Router 1- from a device plugged into Router 2 is to be expected.

However, most routers would normally answer to those DHCPDISCOVER messages, as they consider themselves as DHCP server.
Yet in your setup, you have configured Router 2 as AP, which you have additionaly instructed to forward DHCP broadcasts to Pi-hole.

This should have worked.

As it doesn't, verify your Router 2 forwarding settings for the correct IP addresses again, and maybe check if there are options to apply this to WiFi as well as LAN.

I am afraid I can't provide you with the exact details, as they are specific for your router model and software version, and I am not familiar with DD-WRT.
You may have better luck consulting your manuals or accessing DD-WRT specific sources for DHCP forwarding, as this is not a Pi-hole issue.

The alternative (which I also included in my previous answer) would be to put Pi-hole on the same network segment as the affected devices (or rather the same network segment as the majority of your prospective clients, preferably) so that Pi-hole will be able to receive DHCPDISCOVER broadcasts directly:

A third option may be to disable Pi-hole as DHCP server, reenable Router 1 as DHCP server, and see if Router 2 handles DHCP correctly when setup as AP for Router 1.

Thanks I'll try to get a bit more into DD-WRT.

The third options you're proposing has been my setup for the last coupe of months and everything worked fine.

Thanks so far for your fast replies and help :slight_smile:

I tried that and now the problem seems reversed but slightly improved:
The Device connected to Router 2 gets the correct IP.
The device connected to Router 1 gets a wrong IP (169....) but uses PiHole.
So the Device and DHCP Server still don't meet but PiHole grants the device it's ad blocking capabilities.

That was to be expected (hence my former hint to put Pi-hole on "the same network segment as the majority of your prospective clients, preferably"). :wink:

I repeat: A DHCP server can only receive broadcasts from clients on the same network segment.

In your case, that translates to "Pi-hole can act as DHCP server for devices connected to the same router as Pi-hole, i.e. Router 1 or Router 2" - unless your respective other router can be configured to relay DHCP messages conforming to RFC 1542, chapter 4.


And again, if and how your router does offer support for DHCP relay will depend on your router model, router software and software version, and even ethernet port allocation for the connection between your routers.

If your router(s) cannot be configured accordingly, and you absolutely want to keep Pi-hole as DHCP server, you may try a split DHCP pool.

As suggested before, put Pi-hole on the segment with the majority of your prospective clients (presumably Router 2) and configure a DHCP range that covers a large portion of your network (e.g. .20 to .149).

Those fewer clients on your other segment (Router 1) should be issued with a fixed IP address, preferably employing a DHCP lease reservation managed by Router 1's DHCP server with a separate address range (e.g. .150 to .219) or by setting a static IP (outside any DHCP range) on the device itself.

You are free to assign address ranges as you see fit, but you must ensure that DHCP address ranges do not overlap.


Note that this isn't an ideal solution, as your WiFi clients roaming from Router 1 to Router 2 would now be forced to not only switch channels but to switch their IP addresses also.

To conclude this:
Your problem is not specific to Pi-hole, but rather to your network configuration, specifically to the restrictions as imposed by your routers.

My body of knowledge -applicable here- is limited to a bit of Pi-hole and a bit of general networking.

You may find better answers frequenting your router's or the DD-WRT forums. :wink:

Solution:

It turned out Router 1 has a LAN/WAN Port. As soon as I plugged Pi-Hole into that Port, everything started working.

Final working wiring setup:

  • There's a wired ethernet connection between Router 1 LAN/WAN Port and Pi-Hole (DHCP).
  • There's a wired ethernet connection between Router 1 LAN 1 and Router 2 LAN 1.
    Thanks again.

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