Any idea why am I getting this error in Luci system log?
Every time a phone connects to wifi I get:
Mon Nov 28 17:04:37 2022 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.103 f1:11:2D:70:4f:54 DadiPhone
Mon Nov 28 17:04:40 2022 daemon.err AdGuardHome[2820]: 2022/11/28 11:34:40.260839 [error] unpacking udp packet: dns: buffer size too small
Mon Nov 28 17:04:43 2022 daemon.err AdGuardHome[2820]: 2022/11/28 11:34:43.274015 [error] unpacking udp packet: dns: buffer size too small
and sometimes log is flooded with dns: bad rdata error like this:
Sun Nov 27 15:11:04 2022 daemon.notice netifd: Network device 'pppoe-wan' link is up
Sun Nov 27 15:11:04 2022 daemon.notice netifd: Interface 'wan' is now up
Sun Nov 27 15:11:04 2022 daemon.info qosify: start interface pppoe-wan
Sun Nov 27 15:11:04 2022 user.notice firewall: Reloading firewall due to ifup of wan (pppoe-wan)
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.269000 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.269002 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.269006 [error] unpacking udp packet: dns: buffer size too small
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.320417 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.408443 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.415034 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.415072 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.415095 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.421840 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.428710 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.474049 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.474345 [error] unpacking udp packet: dns: bad rdata
Sun Nov 27 16:02:34 2022 daemon.err AdGuardHome[2820]: 2022/11/27 10:32:34.557111 [error] unpacking udp packet: dns: bad rdata
Also are you running it in a docker container or directly on the router?
Directly on the router. I'm using stable OpenWrt 22.03.2
Either way I'd add your bug report to that thread to see why its happening.
Thank you. I tried changing TCP/UDP buffer size in openwrt but that didn't help. I googled the issue but unfortunately I couldn't find the solution on this one.
My suggestion would be to upgrade to the edge version and see if that solves your issue. If not then do add to the issue linked on adguards issue list and hopefully they can find the root issue. It does appear to be linked to buffers but I'd think its down to their go engine. Odd that more people haven't seen the issue given its a stable version. I'd defiantly report it and include what router you run AGH on, and what phone is causing the issue.
:edit: Actually. file a new bug report as it refers to 103 build but reference that bug report as part of your issue.
Thank you. Well that was on Samsung phone. Although I didn't see flood of error logs before with default AdGuardHome settings. I'll post my settings here in brief-
Meanwhile is there a next stable version for adguardhome? Edge builds are nightly builds right? Also is it possible to upgrade AGH on stable openwrt version?
uninstall AGH and revert your opkg changes by using my uninstall script which will set you back to defaults. Then you can use my script set to reinstall the edge version and resetup AGH.
A potentially faster way is to reset your OpenWrt install and start afresh. But that will depend on what customisations/defaults you have changed. EG DHCP statics setup etc.
The edge builds aren't nightly but are much more uptodate and so far I've not run into any major issues using them. As I've said before. Once they fix some long standing issues and AGH development is more stable then stable builds would be preferable. I still think AGH is "beta" software and thus its a moving target for builds. 107 has been more stable but they have not back ported some 108 changes.
potentially you could uninstall and use the edge script directly but I've never tested that. Also unless the router has its own WAN dns upstream set, when you remove AGH it can break DNS resolution. I'm just being cautious with how I suggest to rip/replace
really when doing things like this you should always start from a "known good configuration" just "incase". Its just good engineering. Duct tape works sometimes but that's just a patch till you get it really fixed
:edit: I rolled the opkg version into my thread as James and I had worked on it and it was a convenient place to have up to date info for both.
Haha Trust me I've literally spent 2-3 days fixing DNS issues while installing AGH. It's always DNS lol. Now I'm pretty aware how to setup AGH on my router Also, I'll go with your resetting method method cuz I like it clean setup so far.
Edit: Did you say your opkg version? That's great! But alas I can't install your updated version on my firmware right? It should be manual way as you said..
its not mine. @jamesmacwhite does the pulls of the 107 builds and gets them packaged for openwrt opkg installs. We both worked on it and the wiki to make it easier for people to use AGH on their router. I originally just worked on improving AGH's manual install and tweaked it for preparing OpenWrt for then using the script from AGH to install. James took that and used it to help do the opkg version with changes for smaller routers. There are key differences between the versions. Mine follows the /opt layout and saves all data and filters. James version due to OpenWrt settings has the bulk of the data saved in ram and thus re downloads filters etc after a reboot.
The opkg version is better for smaller space/ram routers. But it means you are restricted to stable releases only. (as OpenWrt rules require stable packages)
The manual edge builds are closer to bleeding edge and save all data to /opt. That requires more space. But also means AGH will self update.
yep. plenty of space etc. To make things simple just ensure you have a /opt folder be it part of your file system or even a mounted folder. Do that and everything will work smoothly as AGH assumes that for its install and my prepare script just moves dnsmasq so you are able to then install AGH and replace dnsmasq. Its that bit that's the tricky bit and to ensure both ipv6 and ipv4 is covered.
Then its just having AGH on different proxy port to avoid clashes with Luci (but you can also proxy it directly so you can use SSL but on your own internal lan its not really required. You could make it seamless by using nginx but that requires modifying Luci and AGH to be proxied.)
My aim was to make AGH less of an "I have to do what?" for users and more lego brick style replacement. Think of it as an aftermarket car upgrade. A few minutes with screwdrivers for better performance.
100mb as per the wiki. its 35mb for the AGH binary and you need double that when it upgrades and backs itself up. Then add in log space and filters. you have plenty space free but make sure you have /opt mounted as a folder rather than /sda0 as AGH expects to install to /opt.
I have a 3rd partition on my sd card mounted as /opt and keep my docker images and AGH installed there. That way I can reflash the first two partitions and reload my openwrt install but keep docker/agh and just re-add it.
that is another option but then you have to weigh the decompression time/power vs space. Neither is that much of an issue for rpi4 but for smaller dual or single core routers its a consideration. Also you have enough space so you don't have to compress it.
Oh btw I received adguardhome 0.107.6-1 ยป 0.107.18-1 opkg update. I might try it later since I'm busy at work. Also I haven't received flood of Unpacking udp packet: dns: bad rdata erros for days only npacking udp packet: dns: buffer size too small
First of all thank you for this great tutorial. I have a problem and I must be doing it wrong. I have adguardhome installed in docker on my NAS (1.15) and I have my router openwrt (1.1).
I want adguardhome to be the primary DNS server and not do DHCP and I want the router to be the secondary DNS and to be the only DHCP server on the network. So I end up with two IP addresses instead of just one.
The idea is that if Adguardhome is not available that I can browse the internet only with my router.
With the configuration below the name resolution with does not work.
If I understood correctly, the router uses port 54 and the NAS uses port 53.
Can you help me correct my configuration please in relation to the operation I am looking for?
I can provide you with more information if needed.
one last thing. In the dashboard in the top client box, I only have my router that appears. I had managed to configure it so that we could each client separately.
Firstly you cannot use these instructions to do a setup like yours. These instructions are for installing on router.
You won't need my scripts or to do major changes on your router. The only thing you will need to do is set your DHCP server to broadcast to use AGH DNS on your NAS. (option 6 is what you need)
This also means you won't need to move dnsmasq and so it will be port 53 on your router and not port 54.
Is there any reason why you can't run AGH on your router? or just easier to run it on your NAS?
Regarding dual DNS? That will not work. Having AGH as primary DNS and a secondary that is completely unfiltered gives a bypass. Its the equivalent of having a guard post that has a tunnel under it that anyone can use. You could mitigate this however by using AGH as your primary and another filtered DNS as secondary but again isn't ideal unless they both act similarly with regard to filters/blocking.
It seems very clear.
My router is a xiaomi Mi 3G V1 which is barely powerful enough to run AGH. AGH's administration interface was slow and I was limited in the number of filters because they slowed everything down. I tested the installation on my NAS and it was perfect, without power or memory limits.
I'm going to forget about this double DNS plan and I'm going to follow your configuration recommendations. Thanks again for your very quick and detailed response.