this post was submitted on 11 Oct 2023
85 points (85.1% liked)

Selfhosted

39159 readers
376 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Every month or so all my devices lose internet and the only way to connect them all back is to disconnect them from the DNS server that Pihole is running.

I set my Pihole to have a static IP but for some reason after around a month or maybe longer, it just fails. This has happened 4 times over the last while and the only fix is to essentially uninstall everything on my Pihole, disable it, and then reconfigure it from scratch again.

I’m not sure what’s going on so any help would be appreciated.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 13 points 11 months ago (1 children)

Are you assigning the static address on your pi, or are you assigning a static address on the router?

[–] [email protected] 5 points 11 months ago (1 children)

This. I’ve always done dynamic IPs on my devices and set static IPs for them on my router. Never had an issue.

[–] [email protected] 1 points 11 months ago (1 children)

This is the way. Although, to clarify, you should assign static IPs on your DHCP server, which for most SOHO networks, that's going to be your router.

If you assign statics on your hosts, your DHCP server will assign them the preferred address if available, but if it's already assigned then the DHCP server is going to give your device the middle finger and assign them whatever the fuck it wants.

[–] [email protected] 4 points 11 months ago (2 children)

Not sure if I’m misunderstanding you, but the router/DHCP server doesn’t assign an IP at all to a host that you’ve assigned statically. Any given host can be statically assigned or use DHCP, not both.

The real problem with statically assigning IPs to hosts, is that your DHCP server won’t know that and could give a new device the same IP address as your statically assigned host, causing an IP conflict, if you statically assigned the host with an IP that’s inside the DHCP scope.

What you have to do is only assign static IPs that are outside the DHCP scope, or set all hosts to use DHCP and then use reservations in your DHCP server to make sure they get the same one each time.

[–] [email protected] 1 points 11 months ago* (last edited 11 months ago)

For infrastructure critical services I recommend reservations on the DHCP server and then set static assignment on the device for the IP reserved in DHCP. This way if the device ever fails over to DHCP for any reason the IP will not change. I'll usually also leave some small address space outside the DHCP scope available for static assignment if needed, usually at the front and usually around 20 IPs max as it's easier to let DHCP do the heavy lifting.

Static IPs are important on infra critical devices if you ever find yourself in a situation where the DHCP services are not available, you don't want them to be a single point of failure.

Just my 2 cents.

[–] [email protected] 0 points 11 months ago

Probably a bit of both to be honest. Thanks for clarifying.