Pi-hole eth0 no address

I set up pi-hole (on a raspberry pi 4 connected via ethernet) for my home hub 4000 (bell) recently. Given that this router can't configure the devices to use pi hole, I turned off the dhcp of my router and set it on pi-hole. Occasionally, the pi-hole stops working and disconnects (despite being connected by ethernet, I can't ssh into it). During this time, the internet is off for most devices connected to the pi-hole dhcp.

Expected Behaviour:

I should be able to have my devices connected to the internet pass through pi-hole without any issues (and more importantly, not have the pi-hole disconnect).

Actual Behaviour:

I then get a diagnostic saying "dhcp packet received on eth0 which has no ip-address", which is weird considering that I have an ip address on the ethernet (and it surpasses .10 as the final number).

Debug Token:

(https://tricorder.pi-hole.net/jsutNIiM/)

Tysm for reading.

A DHCP server can't assign an IP address to itself.

Your debug log shows the IP of your machine hosting Pi-hole with a lease time of about 3 days.

How did you ensure that the machine running Pi-hole's DHCP server has a fixed IP?

When setting up pi-hole with the crosstalk solutions tutorial (with the command pihole -r), I had the option between eth0 and wlan0 (I took eth0 given that it was what I set up the raspberry pi with). Before that however, I set up the raspberry pi with the router (so that it uses a fixed ip address via ethernet).

This was odd given that usually I should've seen this menu.

Here's the link for the tutorial: https://www.crosstalksolutions.com/the-worlds-greatest-pi-hole-and-unbound-tutorial-2023/

For most OS installations, you'd never see that message, except when dhcpcd would be used for managing your network on RaspberryPi OS. Beginning with 11/Bullseye, RPi OS has shifted to use NetworkManager as network management tool, and use that as its default since 12/Bookworm.

Your debug log shows you to run your Pi-hole RPi on Debian 12 (probably RPi OS (64bit)), so you would have seen:

The Pi-hole is a SERVER so it needs a STATIC IP ADDRESS to function properly.

IMPORTANT:
If you have not already done so, you must ensure that this device has a static IP
Depending on your operating system, there are many ways to achieve this, through DHCP reservation, or by manually assigning one.

Please continue when the static addressing has been configured.

Which is what you did:

This would suggest that your RPi 4 would lose its IP once its previous DHCP lease from your router expires.

You should try to manually set a static IP address on your RPi 4, e.g. via NetworkManager's nmtui.

So after looking at nmtui, I want to be sure that I'm not screwing up the ip of the ethernet. So here's a recap of what I (maybe) should do:

  • I edit the connection, select ethernet (given that that's what I'm working with), then edit ipv4 configuration. On addresses, I add in an ip address that isn't used, for example 192.168.2.200 (I'm not sure if I should add a port (ex: /22 or /24) at the end of 200).
  • I add the gateway as 192.168.2.1 (given it's pretty much a universal standard)
  • In dns servers, I choose the two dns servers ip's on my home router
  • After everything has been verified, I click ok (I don't touch any other routing protocols and leave them as is). I'm not sure if I have to modify "search domains" to the ones set up with unbound.

Since I don't want to have to screw up the ethernet ip, I'm just making sure that these steps are to be followed (because the websites I checked apply only on linux pc's).

So I tried to restart the device with a guide concerning the mentioned tool. The error's gone, but there's a resolve issue from what I saw in the log.

(https://tricorder.pi-hole.net/LzefBwWY/)

You need to enter the IP in CIDR format.
Example below:

The /24 postfix is not a port but a representation of how many ones there are in the subnet mask:

CIDR /24 = subnet mask 255.255.255.0 = 11111111.11111111.11111111.00000000

You can count the ones :wink:

After you've configured static IP details with nmtui, you can check with below (dont mind the lo profile for the loopback interface):

$ nmcli -t -f name con show --active | xargs  -d '\n' -n 1 nmcli -p -f ipv4.method con show
===============================================================================
                Connection profile details (Wired connection 1)
===============================================================================
ipv4.method:                            manual
-------------------------------------------------------------------------------
===============================================================================
                        Connection profile details (lo)
===============================================================================
ipv4.method:                            manual
-------------------------------------------------------------------------------
$ ip -br -4 address show scope global
eth0             UP             10.0.0.7/24
$ ip -4 route
default via 10.0.0.1 dev eth0 proto static metric 100
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.7 metric 100
$ cat /etc/resolv.conf
# Generated by NetworkManager
search home.dehakkelaar.nl
nameserver 10.0.0.1

After having set it up, everything seems to be showing as per your example (even the home.dehakkelaar.nl on the resolv.conf). Thanks for the lengthy detailing!

(https://tricorder.pi-hole.net/0up0gfF8/)

This should be the last debug log (I'm just uploading it to verify if there aren't anymore issues as far as other bugs are concerned, so that I won't have to do multiple posts again concerning simple issues)

1 Like