I couldnt run adguard

hey there,

im unable to run adguardhome on my openwrt snapshot

root@OpenWrt:~# ubus call system board
{
        "kernel": "6.6.67",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 0",
        "model": "Bananapi BPI-R4",
        "board_name": "bananapi,bpi-r4",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r28410-a85059438f",
                "target": "mediatek/filogic",
                "description": "OpenWrt SNAPSHOT r28410-a85059438f",
                "builddate": "1735233486"
        }
}

i did install the package during build request but it wont forward me to 192.168.1.1:3000 for set up.

i think this is the error code. i ran this code in terminal too

root@OpenWrt:~# # Get the first IPv4 and IPv6 Address of router and store them in following variables for use during the script
.
root@OpenWrt:~# NET_ADDR=$(/sbin/ip -o -4 addr list br-lan | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1] }')
root@OpenWrt:~# NET_ADDR6=$(/sbin/ip -o -6 addr list br-lan scope global | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1
] }')
root@OpenWrt:~#  
root@OpenWrt:~# echo "Router IPv4 : ""${NET_ADDR}"
Router IPv4 : 192.168.1.1
root@OpenWrt:~# echo "Router IPv6 : ""${NET_ADDR6}"
Router IPv6 : fd42:8026:d452::1
root@OpenWrt:~#  
root@OpenWrt:~# # 1. Enable dnsmasq to do PTR requests.
root@OpenWrt:~# # 2. Reduce dnsmasq cache size as it will only provide PTR/rDNS info.
root@OpenWrt:~# # 3. Disable rebind protection. Filtered DNS service responses from blocked domains are 0.0.0.0 which causes dn
smasq to fill the system log with possible DNS-rebind attack detected messages.
root@OpenWrt:~# # 4. Move dnsmasq to port 54.
root@OpenWrt:~# # 5. Set Ipv4 DNS advertised by option 6 DHCP 
root@OpenWrt:~# # 6. Set Ipv6 DNS advertised by DHCP
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].noresolv="0"
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].cachesize="1000"
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].rebind_protection='0'
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].port="54"
root@OpenWrt:~# uci -q delete dhcp.@dnsmasq[0].server
root@OpenWrt:~# uci add_list dhcp.@dnsmasq[0].server="${NET_ADDR}"
root@OpenWrt:~#  
root@OpenWrt:~# #Delete existing config ready to install new options.
root@OpenWrt:~# uci -q delete dhcp.lan.dhcp_option
root@OpenWrt:~# uci -q delete dhcp.lan.dns
root@OpenWrt:~#  
root@OpenWrt:~# # DHCP option 6: which DNS (Domain Name Server) to include in the IP configuration for name resolution
root@OpenWrt:~# uci add_list dhcp.lan.dhcp_option='6,'"${NET_ADDR}" 
root@OpenWrt:~#  
root@OpenWrt:~# #DHCP option 3: default router or last resort gateway for this interface
root@OpenWrt:~# uci add_list dhcp.lan.dhcp_option='3,'"${NET_ADDR}"
root@OpenWrt:~#  
root@OpenWrt:~# #Set IPv6 Announced DNS
root@OpenWrt:~# for OUTPUT in $(ip -o -6 addr list br-lan scope global | awk '{ split($4, ip_addr, "/"); print ip_addr[1] }')
> do
> echo "Adding $OUTPUT to IPV6 DNS"
> uci add_list dhcp.lan.dns=$OUTPUT
> done
Adding fd42:8026:d452::1 to IPV6 DNS
root@OpenWrt:~# uci commit dhcp
root@OpenWrt:~# uci commit dhcp
root@OpenWrt:~# /etc/init.d/dnsmasq restart
udhcpc: started, v1.37.0
udhcpc: broadcasting discover
udhcpc: no lease, failing```

hey all,

been trying to install adguardhome on my openwrt snapshot r28410-a85059438f" its refuses to direct me to 192.168.2.1:3000 after i did all the steps carefully :confused:

this what i did in ssh terminal after installing the apk from luci in

root@OpenWrt:~# service adguardhome enable
root@OpenWrt:~# service adguardhome start
root@OpenWrt:~# NET_ADDR=$(/sbin/ip -o -4 addr list br-lan | awk 'NR==1{ split($
4, ip_addr, "/"); print ip_addr[1] }')
# 5. Set Ipv4 DNS advertised by option 6 DHCP
# 6. Set Ipv6 DNS advertised by DHCP
uci set dhcp.@dnsmasq[0].noresolv="0"
uci set dhcp.@dnsmasq[0].cachesize="1000"
uci set dhcp.@dnsmasq[0].rebind_protection='0'
uci set dhcp.@dnsmasq[0].port="54"
uci -q delete dhcp.@dnsmasq[0].server
uci add_list dhcp.@dnsmasq[0].server="${NET_ADDR}"

#Delete existing config ready to install new options.
uci -q delete dhcp.lan.dhcp_option
uci -q delete dhcp.lan.dns

# DHCP option 6: which DNS (Domain Name Server) to include in the IP configurati          on for name resolution
uci add_list dhcp.lan.dhcp_option='6,'"${NET_ADDR}"

#DHCP option 3: default router or last resort gateway for this interface
uci add_list dhcp.lan.dhcp_option='3,'"${NET_ADDR}"

#Set IPv6 Announced DNS
for OUTPUT in $(ip -o -6 addr list br-lan scope global | awk '{ split($4, ip_add          r, "/"); print ip_addr[1] }')
do
        echo "Adding $OUTPUT to IPV6 DNS"
        uci add_list dhcp.lan.dns=$OUTPUT
done
uci commit dhcproot@OpenWrt:~# NET_ADDR6=$(/sbin/ip -o -6 addr list br-lan scope           global | awk '
NR==1{ split($4, ip_addr, "/"); print ip_addr[1] }')
root@OpenWrt:~#
root@OpenWrt:~# echo "Router IPv4 : ""${NET_ADDR}"
Router IPv4 : 192.168.2.1
root@OpenWrt:~# echo "Router IPv6 : ""${NET_ADDR6}"
Router IPv6 : fdb8:1e51:1fd2::1
root@OpenWrt:~#
root@OpenWrt:~# # 1. Enable dnsmasq to do PTR requests.
root@OpenWrt:~# # 2. Reduce dnsmasq cache size as it will only provide PTR/rDNS
info.
root@OpenWrt:~# # 3. Disable rebind protection. Filtered DNS service responses f
rom blocked domains are 0.0.0.0 which causes dnsmasq to fill the system log with
 possible DNS-rebind attack detected messages.
root@OpenWrt:~# # 4. Move dnsmasq to port 54.
root@OpenWrt:~# # 5. Set Ipv4 DNS advertised by option 6 DHCP
root@OpenWrt:~# # 6. Set Ipv6 DNS advertised by DHCP
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].noresolv="0"
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].cachesize="1000"
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].rebind_protection='0'
root@OpenWrt:~# uci set dhcp.@dnsmasq[0].port="54"
root@OpenWrt:~# uci -q delete dhcp.@dnsmasq[0].server
root@OpenWrt:~# uci add_list dhcp.@dnsmasq[0].server="${NET_ADDR}"
root@OpenWrt:~#
root@OpenWrt:~# #Delete existing config ready to install new options.
root@OpenWrt:~# uci -q delete dhcp.lan.dhcp_option
root@OpenWrt:~# uci -q delete dhcp.lan.dns
root@OpenWrt:~#
root@OpenWrt:~# # DHCP option 6: which DNS (Domain Name Server) to include in th
e IP configuration for name resolution
root@OpenWrt:~# uci add_list dhcp.lan.dhcp_option='6,'"${NET_ADDR}"
root@OpenWrt:~#
root@OpenWrt:~# #DHCP option 3: default router or last resort gateway for this i
nterface
root@OpenWrt:~# uci add_list dhcp.lan.dhcp_option='3,'"${NET_ADDR}"
root@OpenWrt:~#
root@OpenWrt:~# #Set IPv6 Announced DNS
root@OpenWrt:~# for OUTPUT in $(ip -o -6 addr list br-lan scope global | awk '{
split($4, ip_addr, "/"); print ip_addr[1] }')
> do
> echo "Adding $OUTPUT to IPV6 DNS"
> uci add_list dhcp.lan.dns=$OUTPUT
> done
Adding fdb8:1e51:1fd2::1 to IPV6 DNS
root@OpenWrt:~# uci commit dhcp
root@OpenWrt:~# /etc/init.d/dnsmasq restart
udhcpc: started, v1.37.0
udhcpc: broadcasting discover
udhcpc: no lease, failing

thank you

Duplicate

can you help me tho :,)

There is a dedicated topic for this:

That said, if you want DNS-based adblocking then there are other options on OpenWrt which require much less tinkering in order to install and coincidentally use much less system resources, compared to AdguardHome. Specifically: adblock, adblock-fast and adblock-lean:

https://openwrt.org/docs/guide-user/services/ad-blocking

All 3 options are good and known to work. I am a contributor to the adblock-lean project and as such, can recommend you to try it out. It is super easy to set up and highly optimized for memory usage and speed.

(uninstall AdguardHome before installing any of the alternatives)

2 Likes

unfortunate the openwrt adguardhome opkg didnt work for me i did every step perfectly in the openwrt wiki still no luck

Unfortunately, I can't help you with AdguradHome but maybe other people in the dedicated topic can. Or you could try the alternatives.

1 Like

no problem and thank you. i will give it one more try and move to one of the alternatives

The late snapshots are buggy.

1 Like

im running banana pi r4 , in firmware selector the available build is snapshot

dont know if 23.05.5 will work tho

there's 24.10-RC4.

https://firmware-selector.openwrt.org/?version=24.10.0-rc4&target=mediatek%2Ffilogic&id=bananapi_bpi-r4

1 Like

tried it , this version still in opkg for some reason. also didnt work aswell

i have no idea where im doin it wrong

btw, is requesting build is available? seems like its buggy at this moment

can you check too?

Hey antonk,

I hope you are doin good. After 2 days trying with AGH i managed to run it on my openwrt router. However it didn't fulfill the purpose which is blocking ads over network the only device that have blocking service was only my PC ( connected directly to my openwrt router ) so i guess ima adblock-fast but before i start does it really block ads over wifi?

Thank you

If AGH is working but only for one device then you are close to making it work for all devices. It's just a matter of some DNS-related configuration. Moreover, likely any DNS-based adblocker will require same or similar config changes. I'd recommend you to ask how this should be done in a new topic in 'Installing and using OpenWrt' and most likely you will get help.

Besides, I am a contributor to adblock-lean, not adblock-fast. Both adblock-lean and adblock-fast are capable of providing DNS-based adblocking to all devices on your network. If you install either of them, both have a dedicated support threads on this forum and people there will likely be able to help you as well:

Adblock-lean: set up adblock using dnsmasq blocklist

Adblock-fast: ad-blocking service for dnsmasq, smartdns and unbound

2 Likes

I will be happy with any effective adblock service that really block ads over my network. Adblock-leak seems to be good enough for this purpose

1 Like