Setting up Pi-hole

Ok I told the router to handle DHCP instead of the Pi and was able to sign into the Pi again, both via Putty and the Pi-Hole web interface. Next I did a 'sudo apt install --reinstall raspi-firmware' as per https://www.raspberrypi.com/documentation/computers/os.html then restarted the Pi. I had been doing a continual ping of the 192.168.0.134 IP and it dropped but came back up within seconds so I think it's sorted again. I've disabled DHCP on the router and the Pi seems to be OK now.

Got this for 'ip a' and 'lspci'. Everything looks good to me?

Code:
marc@pi-hole:~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul                                                                          t qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP gr                                                                          oup default qlen 1000
    link/ether d8:3a:dd:e7:93:f7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.134/24 brd 192.168.0.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 2a07:244:40:ab00:d6b7:90c9:91de:5c1e/64 scope global dynamic noprefixr                                                                          oute
       valid_lft 301sec preferred_lft 301sec
    inet6 fe80::95f9:b81a:ff06:fcf2/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DO                                                                          WN group default qlen 1000
    link/ether d8:3a:dd:e7:93:f8 brd ff:ff:ff:ff:ff:ff
marc@pi-hole:~ $ lspci
0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0000:01:00.0 Non-Volatile memory controller: Phison Electronics Corporation PS5013 E13 NVMe Controller (rev 01)
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
 
Having your DHCP server using a DHCP address itself isn't a good idea for the reason you've just seen. I'd set eth0 to a static IP and then make sure that the DHCP range that Pi-Hole is dishing out excludes that IP (plus that of your router).
 
Having your DHCP server using a DHCP address itself isn't a good idea for the reason you've just seen. I'd set eth0 to a static IP and then make sure that the DHCP range that Pi-Hole is dishing out excludes that IP (plus that of your router).
So change the Pi's IP to 192.168.0.2 and then tell Pi-Hole to assign IPs from 192.168.0.3 upwards?
Absolutely that, you failed to mention that part! :cry:
Whoops!
Pi-hole offers to set a static IP on startup.

Incidentally, I tried adguard home a couple of weeks ago. I liked how the dashboard showed the average response time.

But that was about it. I’m firmly in the Pi-hole camp.
192.168.0.134 is the IP address Pi-Hole set during the setup.
 
So change the Pi's IP to 192.168.0.2 and then tell Pi-Hole to assign IPs from 192.168.0.3 upwards?

Assuming your router is 192.168.0.1 then yes, that'd work.

192.168.0.134 is the IP address Pi-Hole set during the setup.

If that's the case then it doesn't make sense that the Pi didn't have an IP (other than loopback address) until you enabled DHCP on the router. If the Pi really had a static IP then DHCP being enabled or not on the router would make zero difference. On the Pi can you do 'cat /etc/dhcpcd.conf' and post the output.
 
If that's the case then it doesn't make sense that the Pi didn't have an IP (other than loopback address) until you enabled DHCP on the router. If the Pi really had a static IP then DHCP being enabled or not on the router would make zero difference. On the Pi can you do 'cat /etc/dhcpcd.conf' and post the output.
Hmm that's strange. I ran it and got "No such file or directory". :confused:
 
It’s not dhcpcd any more in Bookworm.

I've not got my Pi to hand (it died) but it also depends on which/if any install configs you used, as they switched to nmcli as default apparently, but if you have a cli only environment it's not included and you have to go to /etc/network/interfaces/ and mess around with if up/down - I had to troubleshoot this the other day on my main computer which only has a window manager, but running minimal bookworm.
 
It’s probably /etc/dnsmasq.d/01-pihole.conf or similar.
How's this?

Code:
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.

###############################################################################
#      FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE.      #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#        IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN:          #
#                      /etc/pihole/setupVars.conf                             #
#                                                                             #
#        ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE           #
#                    WITHIN /etc/dnsmasq.d/yourname.conf                      #
###############################################################################

addn-hosts=/etc/pihole/local.list
addn-hosts=/etc/pihole/custom.list


localise-queries


no-resolv

log-queries
log-facility=/var/log/pihole/pihole.log

log-async
cache-size=10000
server=1.1.1.1
server=1.0.0.1
server=2606:4700:4700::1111
server=2606:4700:4700::1001
domain-needed
expand-hosts
bogus-priv
local-service
dhcp-name-match=set:hostname-ignore,wpad
dhcp-name-match=set:hostname-ignore,localhost
dhcp-ignore-names=tag:hostname-ignore
marc@pi-hole:/etc/dnsmasq.d $ /etc/dnsmasq.d/01-pihole.conf# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.

###############################################################################
#      FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE.      #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#        IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN:          #
#                      /etc/pihole/setupVars.conf                             #
#                                                                             #
#        ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE           #
#                    WITHIN /etc/dnsmasq.d/yourname.conf                      #
###############################################################################

addn-hosts=/etc/pihole/local.list
addn-hosts=/etc/pihole/custom.list


localise-queries


no-resolv

log-queries
log-facility=/var/log/pihole/pihole.log

log-async
cache-size=10000
server=1.1.1.1
server=1.0.0.1
server=2606:4700:4700::1111
server=2606:4700:4700::1001
domain-needed
expand-hosts
bogus-priv
local-service
dhcp-name-match=set:hostname-ignore,wpad
dhcp-name-match=set:hostname-ignore,localhost
dhcp-ignore-names=tag:hostname-ignore
 
Back
Top Bottom