You are very welcome. It was confusing instructions and mishmash of information combined with changes in AGH and OpenWrt that made me re-write the original 2 year long post into a much more current affair. However, it is not all my work. A number of other contributors have helped, also the wiki editors too. So where possible I have noted their contributions too.
The end result is much clearer instructions and cleaner way to add AGH. It has also resulted in improvements to AGH as feedback and issues were raised to make them aware and deploy fixes.
Long term I am hoping that AGH becomes a stable package and we can make the install simpler by using AGH's DHCP services. That will make the switchover much easier. It would be nice to just be able to opkg install and it do everything for you and make it much more friendly to newer users.
It would also make this thread redundant i guess but if it brings adblocking and content filtering to more users and improving things then I'm happy for that to happen.
Well mine was all working then m cable modem went faulty, so was with out internet for 3 days.
the nano pi r4s was left on but rebooted a few times to try and fix the internet connection
So finally got the new modem and thought it would be a case of plug everything back and boot up.
But internet didnt work, when you opened adgaurd it said it couldnt update etc. so was thinking it was justthe modem not connecting to router correctly, when i opened adgaurd it showed it had some queuries but date was 2013
Its a little of both. If you had rebooted again after getting the new modem it would have picked up an NTP update and thus fixed itself. What happened is with your modem out, and you rebooting the R4S, it lost its time (because it doesnt have a RTC). Without a proper time sync, you cannot do encrypted dns lookups as it requires proper time/date to be set. Once you updated the time, it all fell back in place and carried on. This is why we either use unencrpyted DNS for NTP updates or put a NTP bypass in place.
Regarding the battery for the R4S, I investigated that and if you look on the R4S thread and on the wiki, i have posted pictures showing a rtc battery vs the case of the r4s. It would not be an easy fit. Potentially you could drill a hole in the external case and just tape the battery to the side or maybe use a smaller battery.
The default configured working directory will mean query logs and statistics will be lost on a reboot. To avoid this you should configure a persistent storage path such as /opt or /mnt with external storage and update the working directory accordingly.
Either switch to using the edge or stable version which will install to /opt or change the working directory for your existing install which can be configured in /etc/config/adguardhome. Be aware you do require about 100mb of space if you are making AGH persist in /opt.
However I suspect an easier fix would be to change the init script to run a bit later as the default values currently being used may be bringing AGH up before your internet is ready so the filters fail to update automatically on reboot. This would still keep your filters/data on /tmp but add a delay to AGH starting so the internet is up when it starts and updates filters.
@jamesmacwhite Is the opkg version using differing start / stop times still? I recall there was bit of discussion on it from last time this popped up?
If you followed my instructions, your router is either using your ISP's DNS or you used my script to set it to cloudflare (or whatever provider you chose), then your router will be using unencrypted standard DNS. This avoids the issue of NTP updates being a problem as the time can now be set properly after it boots as usual.
AGH will use encrypted DNS for your LAN devices. The reason it wasn't working was because its time was wrong and thus would not get a https session to do DNS Lookups due to the invalid time/date. Once you updated the time it would have kicked back in and continued working.
Adding those entries wont hurt anything. It will just make it explicit to let those pass as unencrypted.
(edit - you can use sniffer tools to dump dns packets if you really want to get technical and check to make sure but it is rather bit of a technical skill to do)
That bit is for the PTR or Reverse DNS lookups. It tells AGH to pass any <host>.lan and <host> to goto dnsmasq instead.
Because we use OpenWrt to do dhcp we need to let AGH know to use dnsmasq (which we moved to port 5353) to look up internal DNS addresses. It should just be handled by the Reverse DNS part lower down but there was some "wierdness" in earlier builds. They have since updated PTR code as others were seeing PTR requests go upstream instead of being left to dnsmasq.
yes. the topline is the encrypted cloudflare upstream
[lan]
[//]
are the ptr lookups
(edit - technically you only really require these if you are running multiple networks. its a catch all to force internal requests to go to to dnsmasq as per my previous post)
I use 127.0.0.1 for local PTR requests because it shows up in the stats for easier tracking.
You can also use the local ip of the router (eg 192.168.1.1)
(edit 2 - And all of this can be avoided if you disable OpenWrt's DHCP and use AGH's DHCP because it will do it internally. However unless you have a fairly simple network I would take care before you try that route. AGH team still have yet to fix some DHCPv4/v6 issues and I am unable to test that yet. You are welcome to try but over there... there may be dragons! )
Its detailed in this post.
This bit is in my first post but it is a giant wall of text. The opkg version is detailed on the wiki and thus is easier to read.
I have pondered if i should do the same maybe. That being said, a fair amount between the two versions is identical due to essentially the same process but different packaging.
Technically my "manual" process isn't "official" OpenWrt as its not packaged. The wiki is more for OpenWrt stuff directly. My scripting does however enable easier integration of AGH by making it more "new to linux" friendly. AGH's wiki expects you to understand what you are doing and thus the consequences of what you do.
/opt should be part of your filesystem and thus saved when you reboot. the opkg version saves to /tmp and is only in RAM so will be lost on reboot. That will make it reload filters on boot. If your setup has them saved to disk then it will reuse those instead. If you have edited the working config to have it write to ram then yes when you reboot those will be lost.
Thank you very much for reply. It was my mistake that didnt read it carefully. Now i install edge version and all working fine.
One last question, what should i include in System -> Backup and flash firmwares -> Configuration so i will have back up of all settings for future?
i put this patch /opt/AdGuardHome/AdGuardHome.yaml
Do i need also /opt/AdGuardHome/AdGuardHome.sig or anything else?