I recently set up Openwrt to use Port Forwarding rules under Firewall-> Port Forwards and also enable Masquerade under NAT Rules so that all the traffic is forced to go through Pi Hole, however it breaks if the Pi is down or otherwise unable to respond.
Is there a way to setup conditional port forwarding in this case which makes a check to see if the device is active every so often and incase it isn't; disable the port forward rules until the next time the check is made and the response is positive?
To be clear, the internet doesn't actually go down, it's just that domain name resolution stops working and thus anything with a domain (vs raw IP addresses) cannot be resolved and thus requested over the internet.
You may be able to use something like watchcat to check the status of the pihole and script changes if it is or is not available.
I was able to find a run script option under services -> Watchcat in luci, I will take a look on how to setup Firewall rules through that. If anyone has any sources that would be useful for this script; it would be much appreciated.
If your pihole doesn't work reliably, 24/7, 'always' - that's what you need to work on. There is no alternative, either make pihole bullet proof or find an alternative that is.
--
Enterprise solutions for automatic failover exist, but you really don't want to bother with that at home.