[Resolved] Cannot Reconnect With Static IP

I have a Raspberry Pi 02W running Pi-Hole and ordinarily things work perfectly, but I’ve got something in my house tripping my fuse box which I’m unable to locate. The tripper, not the fuse box. Anyway, what it means is occasionally, I lose power and so my router and my Pi-Hole go down.

I’ve configured my /etc/dhcpcd.conf so that my RPi02W can have a static IP


<span style="color:#323232;">interface wlan0
</span><span style="color:#323232;">static ip_address=192.168.1.100/24
</span><span style="color:#323232;">static routers=192.168.1.1
</span><span style="color:#323232;">static domain_name_servers=194.168.4.100 194.168.8.100
</span>

And have rebooted to confirm it’s fine, and it’s fine.

However when the router goes down and I bring everything back up, the Pi-Hole can’t reconnect to the router. I can log in to the router and see it connect briefly, but it’s only briefly and then nothing. I even try enabling DHCP on the router and it still refuses to reconnect. Ultimately the only way to get it to reconnect is to factory reset the router, change the password back to my usual password, wait for the RPi02W to connect and then disable the DHCP again. Needless to say it’s a pain in the arse.

What am I doing wrong? How do I fix this?

#Solution I switched the DNS servers from Virgin Media to 8.8.8.8 and that seems to fix it. Not sure why, but it does.

lemmyreader, (edited )

On routers and modems the DHCP range is usually not allocating the full range for IP addresses to hand out to devices. If I were you I would configure the pi-hole to have a static IP address on the pi-hole itself so it will be independent from your router’s DHCP server. For example let’s say

  • the DHCP IP range is 192.168.1.20 to 192.168.1.254
  • then you can pick for example 192.168.1.19 for your pi-hole

With that approach you will avoid IP address conflicts and the pi-hole should be fine. If you’re using systemd on the pi-hole that is maybe easiest, here an example :

Another option is to use nmtui from NetworkManager

Successful_Try543,

Some routers also have the ability to give a device a static ip address, so that such conflicts should be avoided.

sabreW4K3,
@sabreW4K3@lazysoci.al avatar

The IP is reserved on the router, but it’s still giving me gip.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • raspberrypi@lemmy.ml
  • DreamBathrooms
  • mdbf
  • tacticalgear
  • magazineikmin
  • thenastyranch
  • rosin
  • everett
  • Youngstown
  • khanakhh
  • slotface
  • ngwrru68w68
  • kavyap
  • cisconetworking
  • InstantRegret
  • JUstTest
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • tester
  • Durango
  • normalnudes
  • provamag3
  • modclub
  • cubers
  • Leos
  • megavids
  • anitta
  • lostlight
  • All magazines