Connected to new WiFi network but with old static IP address

Hi all,

I wasn't sure if this should be posted here or in the Pi forums.

I'm pretty new to the world of Pi and I've been searching for a fix the past 2+ hours and getting nowhere. When I set up the Pi a few weeks ago, it was able to automatically connect to the LAN via WiFi. Later, I set up PiHole, using the same IP address. Everything was working as intended. I did not set up PiHole as the DHCP server or set up a static IP in the router because, 1) I didn't want to mess up my family's internet access and 2) I share WiFi with my landlord back at home and I do not have access to the router. The goal was to get everything set up so it wouldn't take me so long to get it working once I went home. Yeah, in either case there was a risk that the router would reassign a different IP, but it's a risk I'd have to work with. Unfortunately, I didn't take notes during the set up process.

Now, I'm back at home and the Pi is using the old static IP from my family's LAN (family network was a 192.168.86.x and home network is a 192.168.2.x). When I set up the Pi, I included an entry in wpa_supplicant.conf to include my home network and family's network. So, while the Pi is connected to the home network, it's using its old IP address from my family's network. I was able to access the admin web interface but not the internet. Using a network analyzer, I was unable to find my pi on the LAN, which makes sense.

Since then, I've been monkeying around with pihole -r to change the IP address to a random IP address within my home network's address range (one not being used), and changed the router's address to the correct one. Now I'm unable to access the web interface.

Here's what I think needs to happen: Revert back to the old IP address to access the interface, disable PiHole, reenable DHCP(?) on the Pi, reconfigure PiHole to use that new IP address.

What are the next steps I should take?

The static IP is mapped in /etc/dhcpcd.conf

It will look like this (with your IP addresses):

interface wlan0
  static ip_address=192.168.0.154/24
  static routers=192.168.0.1
  static domain_name_servers=127.0.0.1

Edit that file and make the changes, then restart the Pi.

Thanks. I saw a few threads dhcpcd.conf and I didn't find it in /etc/. Yeah, I'm blind. Too much staring at two monitors.

For anyone who wanders in here looking for a solution, I deleted the static ip_address row and changed the router to the correct IP address. I also changed the local.list and setupVars.conf filed in /pihole/ to account for the Pi's new IP address, along with the hosts file in /etc/.

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