Internet unreachable after static ip change

Expected Behaviour:

I’m changing my local network addresses from the range set 192.168.0.0/24 to 10.0.0.0/22. Ideally my pihole machine would go from 192.168.0.2 to 10.0.1.2 and the gateway from 192.168.0.1 to 10.0.1.1.

Actual Behaviour:

I first tried with pihole -r attended to set the new ip, mask and gateway. It worked partially as the interface showed 10.0.1.2/24 and the gateway didn’t update. No package updated as the pi is now unable to reach the internet. I retried again and the gateway updated but not the mask. I then changed the mask with
sudo nano /etc/pihole/setupVars.conf setting it to 255.255.252.0. It worked. The gui showed /22 but ifconfig still 255.255.255.0.
In the end I’m unable to get the machine to reach the internet as ping reports 8.8.8.8 as unreachable.
I need help to get the raspberry pi to actually connect to the internet.

Debug Token:

Can’t connect!
There was an error uploading your debug log.

Check /etc/dhcpcd.conf

Right. I checked and indeed there are three eth0 interfaces. One for 192.168.0.2/22, one for 10.0.1.2/24 and one for 10.0.1.2/22.

I deleted the two unnecessary ones and now it pings correctly and it updates packages. I will update the post if other issues arise.
Is it a possible bug that pihole -r appends static interfaces instead of overwriting them or is my installation bugged in some way?

Thank you for the help.

Yes and no. If pihole -r changed the IP addressing then there is the possibility that it overwrites intended changes to the existing file. We can write to it one time with a high certainty that it will be what the user wants but making changes after the fact is not really a great idea.

I have another somewhat unrelated issue.
Yesterday my ISP’s provided modem/router received some kind of maintenance (remote management). Not sure what they did but now, despite turning off DHCP and DNS services, the router still supersedes pihole as a dns server. Thus if i type ipconfig on my desktop pc i get:

DNS Servers . . . . . . . . . . . : fe80::a691:bfff:feee:aaaa%17
                                    10.0.1.2

where, as per netsh:
fe80::a691:bfff:feee:aaaa Reachable (Router)

I just don’t understand why. I also specified 2 custom IPv6 dns upstream servers on the pihole web gui, but they don’t get picked up. The IPv6 checkboxes for google, opendns etc. are greyed out.

Why is this happening? Is there an option on pihole that I can use to solve this? This is driving me crazy as I can’t find a fix and now I can’t access many sites that my ISP based DNS blocks.

P.S.:Since yesterday everything worked fine. If I disable IPv6 on Windows 10, or manually define IPv6 dns servers, the problem goes away, but this is not an option for the Andorid devices and a few others.
The router IPv6 PPP connection is disabled and IPv6 is reported as not assigned in its gui.

Who is your ISP? Have you tried disabling IPv6 on the router?

TIM (Italy). I have FTTH installed. I use the router provided (TIM Hub) solely as modem/router/switch. Everything else is disabled…dhcp, dns, wireless APs, file/printer sharing as well as IPv6

On the tab Internet Access -> PPP connection of the gui

Status Connected
Enabled ON
NAT ON
IPv6 OFF
IPv4 Address 79.79.79.79
DNS servers 85.38.28.3,85.38.28.2

I can’t change the DNS servers (the device is actually using 85.38.28.235). I can only announce different ones through the built-in DHCP server that is disabled since it would conflict with pihole.
The problem described above happens to my desktop and one android device out of three. For whatever reason, at least for now, the other two devices correctly use pihole as dns server.

Edit: Running

getprop net.dns1
getprop net.dns2

on the Android terminal returns the IPv6 address of my router as first and the IPv4 address of the pihole server as second.