[How-To-Updated 2021] Installing AdGuardHome on OpenWrt [Manual and opkg method]

This is working

1 Like

Up and running. Thank you :slight_smile:

1 Like

Does adguard home work in version 19.07.8?

Yes. Both the manual installation from AdGuard Home or the opkg package from 21.02 works.

1 Like

I installed via opkg on 21.02 and it looks like everytime I reboot my router, I would have to manually refresh filters on AdGuard. If I don't, the blocklist rule count is at 0 until I manually check for updates. What options do I have here? Can I make the filters persist somehow? Add some way to check for updates on filters on startup?

1 Like

[HowTo] Running Adguard Home on OpenWrt opkg version is in that thread mostly.

Mine is for those using the full install.

But what it comes down to is that the opkg one saves to ram so it needs to redownload stuff on reboot.

@jamesmacwhite does the PRs for it.

https://openwrt.org/docs/guide-user/services/dns/adguard-home#installation you can change where the working directory is and make it more perment if u desire.

The default working directory is /var/adguardhome (By default /var is a symlink to /tmp).
The working directory can be configured in /etc/config/adguardhome

Long story short, there were trade offs made to enable AGH to be more OpenWrt friendly. Downside is the configuration and understanding. Might need to make it bit more clear on the wiki for users.
However if u read my install post you will understand why some decisions were made given storage issues etc. AGH is a bit of a space hog for littler routers. my old bt hub 5 barely managed at times. my R4S NanoPi i use now is FAR better but it also has greater space. We are working with AGH team to try get improvements but it comes down to the fact it was never designed to fit in this sort of enviroment. Much like turning a mini metro into a drag racer. Its possible but requires engineering :stuck_out_tongue:

Thank you! I changed this to be opt/adguardhome now. I'm using a Raspberry Pi4 with an overkill 32GB SD Card so this is much better for me. (hopefully doesn't include so many writes that would kill the SD card though) The filters now persist and I don't have to manually update the filters.

1 Like

Thanks for your post. I was able to install AGH and is working, my problem is that I have 3 different interfaces, LAN, WAN, GUEST, IOT. LAN and WAN are working perfect and AGH do his job. The problem is with GUEST and IOT, in not access to internet, no DNS service. they can connect directly with IP adddress but is a put for example CNN.COM or google.com can not access. Guest and IOT are in different IP address. so what i need to do so it can have internet access. Thanks

have you setup those lans with their own dns? you will need to setup binds for agh for those lans.

I wrote their IP address here:
dns:
bind_hosts:

  • 127.0.0.1
  • ::1
  • 10.19.25.12
  • 172.20.25.15
  • 192.168.1.1
  • fd1a:c860:7174::1
    port: 53

I also open 53, 5353 for DNS and port 67 68 for DHCP firewall rules

What else I need to do?

Thanks

those are strange ip addresses. Usually you would use .1 for the main gateway for a new subnet range?

How have you setup your network ?

My bad I had in this way

bind_hosts:

  • 10.19.25.1
  • 172.20.25.1
  • 192.168.1.1
    port: 53

Those two are guest wifi - 10.19.25.1

  • 172.20.25.1 with their on firewall rules they don't have access to LAN 192.168.1.1.
    When I do your installation moving Dnsmasq to por 5353 a AGH port 53 is when breaks internet access to the Guest network, I can have access with plain DNS IP address but not typing for example CNN.com.

If I install AGH without changing Dnsmasq settings and port (using port 53) and AGH using port 5353 I don't have any issues, with firewall ports 67 68 53 opens, but I don't have rDNS working meaning AGH can no identify single devices connected to those guest interfaces only show what DNS was blocked on main banding host for those guests interfaces but for LAN interface show every single IP address devices.

So I think is a firewall rule that is breaking the guests interfaces when I do your setup. So what rules I need to have on the firewall to make work

Thanks

Ideally you should get your networking/firewalling working before swapping AGH into your dns setup. That way you can post a regular thread asking for help. Once its fully working you should just be able to insert AGH as dns server and it should pick up the networking that is setup and bind to those networks.

I had all the firewall working and I had access to internet before installing AGH. I had DHCP and DNS with TCP and UDP on port 67 68 53 and was working fine and after installing AGH thos guest wifi only can access internet with plain DNS address not with regular like CNN.com

Thanks

I fallow this guide [HowTo] Running Adguard Home on OpenWrt and AGH works but the private reverse DNS servers doesn't identify any of the hostnames of the clients with private IP address.

if AGH is bound to those ip addresses it should be responding to DNS requests.
Is the DHCP for each ip range giving out proper DNS options?

So for your LAN 192.168.1.1 range you should have this :
Your other rules should be similar for the other zones.

	list dns 'fd1a:c860:7174::1' #ipv6 dns
	list dhcp_option '6,192.168.1.1' #ipv4 dns
	list dhcp_option '3,192.168.1.1' #ipv4 gateway

you could just make your other ip ranges similar aka

192.168.2.1 #guest
192.168.3.1 #iot

Without knowing how your networking and firewall rules are setup its hard to see what you have broken.

Thanks for you time and aknowledge. Now is working and running good so far. I will run some test.

When I add for every interface this line got access.

list dns 'fd1a:c860:7174::1' #ipv6 dns
list dhcp_option '6,192.168.1.1' #ipv4 dns
list dhcp_option '3,192.168.1.1' #ipv4 gateway

Thanks again for you dedication and work for the openewrt community.

1 Like

Is it possible to detect the current running hardware architecture version? For example when first time we run this script it autodetect the hardware version installAGH.sh we don't specified for that, so is it possible to autodetect the same way when we run updateAGH.sh? Or if any possibility to merge installAGH.sh and updateAGH.sh in such way; so we have one additional switch -update for updates like we have "./AdGuardHome -s start|stop|restart|status|install|uninstall|update" ? Ty

uname -i but that doesnt always work.

root@OpenWrt:~# uname -i
unknown

uname -a

Linux OpenWrt 5.4.163 #0 SMP PREEMPT Mon Dec 13 17:21:25 2021 aarch64 GNU/Linux

The AGH team are looking into better updating practises and there's an issue filed for it.
I only wrote the manual update patch script for a specific case. That being my old BT Hub5 had VERY limited space and there was not enough room for a backup AND a new install. Thus i just made it grab the update and unpack it over the top of the existing install. It works but its not recommended. It is far better to have your /opt/AdGuardHome folder mounted on additional storage like a usb drive instead, if you are that limited on space.

My scripts do NOT do auto detection. It is the AGH install script that i pull and run that does everything like that.

1 Like

Thanks for reply.

I just run this uname -a and got this result
root@OpenWrt:/# uname -a
Linux OpenWrt 5.4.154 #0 SMP Sun Oct 24 09:01:35 2021 mips GNU/Linux

Yes, I already attached USB stick and got 7GB free space in overlay, So is it ok to download this new version https://static.adguard.com/adguardhome/edge/AdGuardHome_linux_mips64_softfloat.tar.gz to upgrade with current one? Ty.