Pihole stop working till i disable and re-able my router DHCP

The issue I am facing: pihole stop working till i disable and re-able my router DHCP, it's the second day that i use pi-hole and it's the second time that around 10am paris/europe timezone that my pi-hole stop working, i can't ssh to my raspberry pi and i can't login in web interface too, while my ip is correct when i go in my router dashboard, it says active device with the static ip adress that i gave. Looks like a DHCP issue, i disabled it from my router and enabled on my pi-hole, not sure what's wrong here is my pihole -d command result : https://tricorder.pi-hole.net/NW9QfcN2/

Details about my system: raspberry pi os lite 64 bit latest version

What I have changed since installing Pi-hole: i enabled DHCP

Is the pihole running with a static IP address configured on the Pi directly or have you set a static lease within your router DHCP. You need to set the IP address on the pi directly outside the range of any DHCP scope..
If you are running more than one DHCP server on your network, the scopes should not overlap. The scope is the range of IP addresses each DHCP server allocates addresses from. If they overlap each DHCP server could/would allocate the same IP address to different clients.

I have 1 dhcp server it's the pi-hole one since i deactivated my main router dhcp, i checked /etc/dhcpcd.conf it says static, its outside dhcp ip range too, soo all looks okey here

I may be mistaken on this as I don't use the Pi as DHCP but my understanding is that you keep DHCP on the router but limit its range to 1. IE if the router is 192.1681.1 then make the PI static at Limit the routers DHCP to 1 client ( the PI )

On the PI turn DHCP on and serve leasers from to

If I recall this is because the PI cannot provide itself a DHCP lease.

This can be a smart move to enable DHCP on the router and limit it to 1 ip (pi hole ip). This can work but what about other devices connected to same network ? How can i say that only pi hole must be selected in router dhcp ?

You set set the static IP for the pi to that one ip addr. A lease reservation / mac address binding on the router may work just fine as well.

Once you have dhcp set on the pihole you would need to disconnect and reconnect your other devices to get the lease from the pi.

I believe that is how it should work but again but I've not done it myself.

Alright i gave to my pihole, looks like both dhcp servers works, i hope this fix my problem, i will let you know tomorrow morning if it worked

I'm confused on how your network is designed. Why port 97? If the gateway is x.x.x.1 then your pi would be x.x.x.2 with starting starting address of x.x.x.2 and ending address of x.x.x.2 ( one client ). The Pi would serve from x.x.x.3 to x.x.x.254
This would keep the ranges orderly between the router and the PI.

If you started at 96 and ended at 98 then you have 3 IP addresses in the middle of the range on the router. I'm not sure thats going to work.

I limited range to 95 in this case (on pi hole), adresses are from 20 to 95 for me( on piihole) and 96 to 98 on router ( i assigned to my pi before doing this) , my router allow me to chose between 20 to 100 that's why i selected 97.
The reason why i use DHCP on my pi hole is that my router DHCP don't allow me to use custom DNS. Do i do something wrong ?

My router don't allow me this sadly i can limit to 96 to 97, i can create 1 virtual machine and reserve that and turn it of foreever ? For now all my devices are between 20 to 95 (on pi hole dhcp)
Yes my gateway is but ip range start at x.x.x.20 in my box settings and i cant edit that.

Curious as to your router make and model. Seems like an odd one.

If your router supports lease reservations or mac address binding you can create false binding for those two extra addresses in the router. Use a made up mac address like aa:bb:cc:dd:ee:ff and bb:cc:dd:ee:ff:gg if that makes sense. The router will then not give out those IPs.

In france SIP limit routers for unknown reasons... specially SFR brand
I don't think that i have this at all in my router, the only option that i can see it to assign these adresses and make them static, even the tab for DNS dont do anything (i added my pi hole DNS and 0 effect even 24h later), that's why i use pi hole DHCP.

I understand. I hope this works for you.

What is the distro major release version if query with below?

hostnamectl | grep Operating

They switched from dhcpcd5 to network-manger with the latest Bookworm release.
With Boowkworm you can manually configure static IP details with below:

sudo nmtui

1 Like

Wow didn't know that, what should i change here ?

I seen a tutorial on the web, i did all correctly but at the end it said disbale eth0 and enable again to apply changes, i clicked on disable then it crashed and now i cant ssh, i hope to find a way, my pi is opened btw, any way to enable eth0 back ? Otherwise i cant access to my pi

Run sudo nmtui on console.
Or else you'd have to configure NM off-line on another Linux host.

Go into the "IPv4 CONFIGURATION" menu and configure static details.

Afterwards below one should return: "manually":

nmcli -f ipv4.method con show "$(nmcli -t -f name con show --active)"

EDIT: Oh ps. you dont have to disable eth0 at any stage!
Another tut thats wrong :frowning:

Alright after reboot eth0 enabled again and looks like it saved all but the command that you gave me give error

Run them separately.
First determine the --active connection name/profile with below:

nmcli -t -f name con show --active

And drop that name into below one:

nmcli -f ipv4.method con show "<CONNECTION_NAME>"

Ok soo i get this even when i replace connection name by Wired connection 1, i get >

Yeah I missed out a "
Should be:

nmcli -f ipv4.method con show "Wired connection 1"