Changing Routers & Subnets: How to reset PiHole IP

I have a piHole running on a raspberrypi currently on my network with a static IP (192.168.1.X subnet).

I'm going to move to a new router with a default subnet of (10.0.0.X).

At first I thought the IP assignment would get reset on it's own when I removed the router with the IP reservation for my RaspberryPi on the 192.168.1.x subnet). Found out, this was not the case the the raspberrypi kept it's 192... IP address even on the new 10.0...subnet and was also thusly unroutable and I couldn't navigate or ping it from computers on the network.

I've reset everything so I can once again access the RaspberryPi.

Question How should I prepare or reset my RaspberryPi before moving to my new router and subnet so that it can reserve an IP in the 10.0...range?

Thanks in advance!

You have a few options:

  1. With a monitor (or TV), keyboard and mouse, you can log into your Pi terminal directly and change your static IP configuration to the new network range. In Raspbian, this is in /etc/dhcpcd.conf.

  2. If you are running headless, then make this change and shut the Pi down while connected to the current IP range. Then reboot the Pi on the new range and it will use the new static IP on the new network range.

With either of these, you will need to run pihole -r and select reconfigure to set up Pi-hole on the new IP after the Pi is connected to the new IP range.

Very helpful.

I'm in headless mode, so I think I need to follow step 2.

To confirm my understanding: I I should terminal into the Pi on it's current IP range (192...) and update /etc/dhcpcd.conf to select an IP in the new range, let's just say... 10.0.0.30 and then power the pihole down.

Then I'll make the hardware and network changes, boot up the Pi on the new subnet and then I can terminal back in on 10.0.0.30 and run pihole -r to reconfigure and then reserve the static IP on my new router?

Appologies if I misunderstood the steps you already laid out. I appreciate the help!

You have it correct.

Many thanks! I'll give it a shot!

Sorry to be needy, but would like to confirm before I make these changes (i'm worried about bricking it :stuck_out_tongue: )

My current dhcpcd.conf

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0
interface eth0
        static ip_address=192.168.1.237/24
        static routers=192.168.1.1
        static domain_name_servers=127.0.0.1

I plan to change this to be

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0
interface eth0
        static ip_address=10.0.0.30/24
        static routers=10.0.0.1
        static domain_name_servers=127.0.0.1

That should work. Make the change, then shut down the Pi with sudo shutdown now

Got through the reconfiguration and we're mostly back up and online! Thank you kindly, jfb!

When I got to the end of the reconfiguration it notes that IPv4 was configured, but not IPv6? Did I miss something in a config file? When I went through the steps to reconfigure I left both IPv4 & IPv6 selected so I'm a little confused at why IPv6 didn't set up. Any words of wisdom?

If the host device isn't using IPv6, you can't configure IPv6 parameters in Pi-hole. This won't be a problem though. IPv6 IP's can be resolved using IPv4. A client using IPv6 can request an IPv6 IP from your IPv4-only Pi-hole and get an IPv6 IP in return.

Oh ok! Roger that. Thanks. Good to know it just has to do with the new router and not something I mucked up.You've been wildly helpful. Thank you!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.