After a DietPi OS update froze mid-stream something in my network config broke. I’ve since been able to fix the OS install and that’s fine. But there’s something wrong as the PiHole is no longer connected properly via ethernet.
Where do you see those?
Your debug log shows your RPi's eth0 interface to carry only one IPv4:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 192.168.0.180/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 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 group default qlen 1000
link/ether b8:27:eb:02:94:34 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.180/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.227.5/24 brd 192.168.227.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 ##################/64 scope link
valid_lft forever preferred_lft forever
~# ip r
default via 192.168.227.1 dev eth0 src 192.168.227.5 metric 1002
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.180
192.168.227.0/24 dev eth0 proto dhcp scope link src 192.168.227.5 metric 1002
Hence there is still another DHCP server active in your network which distributes an invalid subnet with a default route which points to nowhere.
So a static IP without DHCP client is still the solution, and anyway reasonable for a Pi-hole DNS resolver.
I guess
pihole-FTL dhcp-discover
does not trigger any DHCP offer from that 192.168.227.1 rogue server, i.e. it is not visible in the tricorder upload of this issue either, right?
Does anyone have a good idea how to detect a DHCP server which distributes a default route that does not exist? Not visible on the true router either, since it is in that different subnet. tcpdump could work, e.g. on a detachable shell session, so the command can just run for a day or so and does not abort if the SSH connection does:
apt install tcpdump
tcpdump -i eth0 udp port 68
EDIT: Or a running a network scanner with ping (or something on port 67 which DHCP servers respond to) through 192.168.227.1 - 192.168.227.254 range, as that DHCP server should have an IP in that range as well. Why not just that:
for i in {1..254}; do ping -c1 -W1 -q "192.168.227.$i"; done
A attempt and 1 second timeout per IP, could be tweaked, but should usually work for hosts in same LAN which do respond to pings at all.
*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 6 seconds)
Scanning all your interfaces for DHCP servers and IPv6 routers
Timeout: 6 seconds
Error while sending Router Solicitation on eth0: Address not available
* Received 300 bytes from 192.168.0.1 @ eth0
Offered IP address: 192.168.0.180
Server IP address: 192.168.0.1
Relay-agent IP address: N/A
BOOTP server: (empty)
BOOTP file: (empty)
DHCP options:
Message type: DHCPOFFER (2)
server-identifier: 192.168.0.1
lease-time: Infinite
netmask: 255.255.255.0
broadcast: 192.168.0.255
dns-server: 192.168.0.1
router: 192.168.0.1
--- end of options ---
Received 1 DHCP (IPv4) and 0 RA (IPv6) answers on eth0
I don't see any indications that another DHCP server would be involved here.
A DHCP server may well be active on the same link / network segment / collision domain, while handing out configurations for a different subnet, i.e. it would have link layer visibility, and it may even have transport/IP layer accessibility through the link's router(s).
Since no other DHCP server answered the Pi-hole machine's broadcasts, that would suggest that there is no other DHCP server on the same link, or that it wasn't active when the DHCPDISCOVER was broadcasted (and similar would apply if a DHCP relay would transfer broadcasts to other links).
Most importantly, jacorizla's IP output clearly indicates that both IPs have not been dynamically assigned via DHCP (no appearance of dynamic), suggesting that they were assigned by some process on the device itself.
You should verify your OS's static IP configuration.
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:1234-block-mmcblk0-mmcblk0p1.device loaded active plugged /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p1
sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:1234-block-mmcblk0-mmcblk0p2.device loaded active plugged /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p2
sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:1234-block-mmcblk0.device loaded active plugged /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0
sys-devices-platform-soc-3f215040.serial-3f215040.serial:0-3f215040.serial:0.0-tty-ttyS0.device loaded active plugged /sys/devices/platform/soc/3f215040.serial/3f215040.serial:0/3f215040.serial:0.0/tty/ttyS0
sys-devices-platform-soc-3f980000.usb-usb1-1\x2d1-1\x2d1.1-1\x2d1.1.1-1\x2d1.1.1:1.0-net-eth0.device loaded active plugged 7800
sys-devices-virtual-block-ram0.device loaded active plugged /sys/devices/virtual/block/ram0
sys-devices-virtual-block-ram1.device loaded active plugged /sys/devices/virtual/block/ram1
sys-devices-virtual-block-ram10.device loaded active plugged /sys/devices/virtual/block/ram10
sys-devices-virtual-block-ram11.device loaded active plugged /sys/devices/virtual/block/ram11
sys-devices-virtual-block-ram12.device loaded active plugged /sys/devices/virtual/block/ram12
sys-devices-virtual-block-ram13.device loaded active plugged /sys/devices/virtual/block/ram13
sys-devices-virtual-block-ram14.device loaded active plugged /sys/devices/virtual/block/ram14
sys-devices-virtual-block-ram15.device loaded active plugged /sys/devices/virtual/block/ram15
sys-devices-virtual-block-ram2.device loaded active plugged /sys/devices/virtual/block/ram2
sys-devices-virtual-block-ram3.device loaded active plugged /sys/devices/virtual/block/ram3
sys-devices-virtual-block-ram4.device loaded active plugged /sys/devices/virtual/block/ram4
sys-devices-virtual-block-ram5.device loaded active plugged /sys/devices/virtual/block/ram5
sys-devices-virtual-block-ram6.device loaded active plugged /sys/devices/virtual/block/ram6
sys-devices-virtual-block-ram7.device loaded active plugged /sys/devices/virtual/block/ram7
sys-devices-virtual-block-ram8.device loaded active plugged /sys/devices/virtual/block/ram8
sys-devices-virtual-block-ram9.device loaded active plugged /sys/devices/virtual/block/ram9
sys-devices-virtual-tty-ttyprintk.device loaded active plugged /sys/devices/virtual/tty/ttyprintk
sys-module-configfs.device loaded active plugged /sys/module/configfs
sys-module-fuse.device loaded active plugged /sys/module/fuse
sys-subsystem-net-devices-eth0.device loaded active plugged 7800
This is incomplete. Below mount and device sections, there should be services and timers listed, loaded on you system. If a pager was used (often invoked automatically), hit backspace to show the remaining parts of the output.
Something fishy going on.
Looks like below route was created/installed via DHCP:
$ man ip-route
[..]
protocol RTPROTO
the routing protocol identifier of this route. RT‐
PROTO may be a number or a string from the file
/etc/iproute2/rt_protos. If the routing protocol ID
is not given, ip assumes protocol boot (i.e. it as‐
sumes the route was added by someone who doesn't un‐
derstand what they are doing). Several protocol val‐
ues have a fixed interpretation. Namely:
redirect - the route was installed due to an
ICMP redirect.
kernel - the route was installed by the ker‐
nel during autoconfiguration.
boot - the route was installed during the
bootup sequence. If a routing daemon starts,
it will purge all of them.
static - the route was installed by the ad‐
ministrator to override dynamic routing.
Routing daemon will respect them and, proba‐
bly, even advertise them to its peers.
ra - the route was installed by Router Dis‐
covery protocol.
The rest of the values are not reserved and the ad‐
ministrator is free to assign (or not to assign) pro‐
tocol tags.
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:1234-block-mmcblk0-mmcblk0p1.device loaded active plugged /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p1
sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:1234-block-mmcblk0-mmcblk0p2.device loaded active plugged /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0/mmcblk0p2
sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:1234-block-mmcblk0.device loaded active plugged /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:1234/block/mmcblk0
sys-devices-platform-soc-3f215040.serial-3f215040.serial:0-3f215040.serial:0.0-tty-ttyS0.device loaded active plugged /sys/devices/platform/soc/3f215040.serial/3f215040.serial:0/3f215040.serial:0.0/tty/ttyS0
sys-devices-platform-soc-3f980000.usb-usb1-1\x2d1-1\x2d1.1-1\x2d1.1.1-1\x2d1.1.1:1.0-net-eth0.device loaded active plugged 7800
sys-devices-virtual-block-ram0.device loaded active plugged /sys/devices/virtual/block/ram0
sys-devices-virtual-block-ram1.device loaded active plugged /sys/devices/virtual/block/ram1
sys-devices-virtual-block-ram10.device loaded active plugged /sys/devices/virtual/block/ram10
sys-devices-virtual-block-ram11.device loaded active plugged /sys/devices/virtual/block/ram11
sys-devices-virtual-block-ram12.device loaded active plugged /sys/devices/virtual/block/ram12
sys-devices-virtual-block-ram13.device loaded active plugged /sys/devices/virtual/block/ram13
sys-devices-virtual-block-ram14.device loaded active plugged /sys/devices/virtual/block/ram14
sys-devices-virtual-block-ram15.device loaded active plugged /sys/devices/virtual/block/ram15
sys-devices-virtual-block-ram2.device loaded active plugged /sys/devices/virtual/block/ram2
sys-devices-virtual-block-ram3.device loaded active plugged /sys/devices/virtual/block/ram3
sys-devices-virtual-block-ram4.device loaded active plugged /sys/devices/virtual/block/ram4
sys-devices-virtual-block-ram5.device loaded active plugged /sys/devices/virtual/block/ram5
sys-devices-virtual-block-ram6.device loaded active plugged /sys/devices/virtual/block/ram6
sys-devices-virtual-block-ram7.device loaded active plugged /sys/devices/virtual/block/ram7
sys-devices-virtual-block-ram8.device loaded active plugged /sys/devices/virtual/block/ram8
sys-devices-virtual-block-ram9.device loaded active plugged /sys/devices/virtual/block/ram9
sys-devices-virtual-tty-ttyprintk.device loaded active plugged /sys/devices/virtual/tty/ttyprintk
sys-module-configfs.device loaded active plugged /sys/module/configfs
sys-module-fuse.device loaded active plugged /sys/module/fuse
sys-subsystem-net-devices-eth0.device loaded active plugged 7800
-.mount loaded active mounted Root Mount
boot-firmware.mount loaded active mounted /boot/firmware
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
run-lock.mount loaded active mounted Legacy Locks Directory /run/lock
sys-fs-fuse-connections.mount loaded active mounted FUSE Control File System
sys-kernel-config.mount loaded active mounted Kernel Configuration File System
sys-kernel-debug.mount loaded active mounted Kernel Debug File System
sys-kernel-tracing.mount loaded active mounted Kernel Trace File System
tmp.mount loaded active mounted /tmp
var-log.mount loaded active mounted /var/log
systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
init.scope loaded active running System and Service Manager
console-setup.service loaded active exited Set console font and keymap
cron.service loaded active running Regular background program processing daemon
dhcpcd.service loaded active running DHCP Client Daemon on all interfaces
dietpi-postboot.service loaded active exited DietPi-PostBoot
dietpi-preboot.service loaded active exited DietPi-PreBoot
dietpi-ramlog.service loaded active exited DietPi-RAMlog
dropbear.service loaded active running Lightweight SSH server
getty@tty1.service loaded active running Getty on tty1
ifup@eth0.service loaded active exited ifup for eth0
ifupdown-pre.service loaded active exited Helper to synchronize boot up for ifupdown
keyboard-setup.service loaded active exited Set the console keyboard layout
kmod-static-nodes.service loaded active exited Create List of Static Device Nodes
networking.service loaded active exited Raise network interfaces
pihole-FTL.service loaded active running Pi-hole FTL
rngd.service loaded active running Start entropy gathering daemon (rngd)
serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0
systemd-fsck-root.service loaded active exited File System Check on Root Device
systemd-fsck@dev-disk-by\x2dpartuuid-e8af6eb2\x2d01.service loaded active exited File System Check on /dev/disk/by-partuuid/e8af6eb2-01
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-random-seed.service loaded active exited Load/Save OS Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-tmpfiles-setup-dev-early.service loaded active exited Create Static Device Nodes in /dev gracefully
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create System Files and Directories
systemd-udev-load-credentials.service loaded active exited Load udev Rules from Credentials
systemd-udev-trigger.service loaded active exited Coldplug All udev Devices
systemd-udevd.service loaded active running Rule-based Manager for Device Events and Files
systemd-user-sessions.service loaded active exited Permit User Sessions
-.slice loaded active active Root Slice
system-getty.slice loaded active active Slice /system/getty
system-modprobe.slice loaded active active Slice /system/modprobe
system-serial\x2dgetty.slice loaded active active Slice /system/serial-getty
system-systemd\x2dfsck.slice loaded active active Slice /system/systemd-fsck
system.slice loaded active active System Slice
systemd-creds.socket loaded active listening Credential Encryption/Decryption
systemd-hostnamed.socket loaded active listening Hostname Service Socket
systemd-initctl.socket loaded active listening initctl Compatibility Named Pipe
systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log)
systemd-journald.socket loaded active running Journal Sockets
systemd-sysext.socket loaded active listening System Extension Image Management
systemd-udevd-control.socket loaded active running udev Control Socket
systemd-udevd-kernel.socket loaded active running udev Kernel Socket
var-swap.swap loaded active active /var/swap
basic.target loaded active active Basic System
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Preparation for Local File Systems
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Preparation for Network
network.target loaded active active Network
nss-lookup.target loaded active active Host and Network Name Lookups
paths.target loaded active active Path Units
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slice Units
sockets.target loaded active active Socket Units
swap.target loaded active active Swaps
sysinit.target loaded active active System Initialization
time-set.target loaded active active System Time Set
timers.target loaded active active Timer Units
dpkg-db-backup.timer loaded active waiting Daily dpkg database backup timer
e2scrub_all.timer loaded active waiting Periodic ext4 Online Metadata Check for All Filesystems
fake-hwclock-save.timer loaded active waiting Periodically save current clock
fstrim.timer loaded active waiting Discard unused filesystem blocks once a week
lighttpd-maint.timer loaded active waiting timer for lighttpd maintenance tasks
phpsessionclean.timer loaded active waiting Clean PHP session files every 30 mins
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
Legend: LOAD → Reflects whether the unit definition was properly loaded.
ACTIVE → The high-level unit activation state, i.e. generalization of SUB.
SUB → The low-level unit activation state, values depend on unit type.
110 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
$ sudo rgrep -v '^ *\(#\|$\)' /etc/network/interfaces*
/etc/network/interfaces:auto lo
/etc/network/interfaces:iface lo inet loopback
/etc/network/interfaces:auto eth0
/etc/network/interfaces:iface eth0 inet dhcp
Above output is confusing me bc its mentioning a wireless interface wlp170s0 and not eth0.
It also seems to be still connected via Wifi.
What does below output (it redacts the MAC's)?
ip -br l | awk '{print $1,$2,$4}' | column -t
dhcpcd works like so, if you dont configure any IP details for particular interfaces, like in your case from above output, it will try to automatically acquire IP details via DHCP for all detected interfaces.
You either have to configure manual static IP details via dhcpcd.conf,
or you have to purge/uninstall dhcpcd from your system and configure static IP details in the /etc/network/interfaces file (or files in the .d folder if configured correctly) so ifupdown can configure IP details instead of dhcpcd:
$ man ifup
[..]
DESCRIPTION
The ifup and ifdown commands may be used to configure (or, respec‐
tively, deconfigure) network interfaces based on interface defini‐
tions in the file /etc/network/interfaces.
Alias for autoremove --purge since Debian Bullseye or so .
Indeed weird that wlp170s0 which was not shown in ip l output further above. And since classic interface names are used, it should be wlan0 if any WiFi adapter is attached. And ifupdown config missing now. You did not by chance run the commands in a different system accidentally?