# Problem with AdguardHome documentation installation script

**URL:** <https://forum.openwrt.org/t/problem-with-adguardhome-documentation-installation-script/247048>\
**Category:** Talk about Documentation\
**Created:** [March 1, 2026, 2:41pm UTC](https://forum.openwrt.org/t/problem-with-adguardhome-documentation-installation-script/247048 "2026-03-01T14:41:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![recharger](https://forum.openwrt.org/letter_avatar/recharger/32/5_5575768a8748004e209b776fc1b2916d.png) [@recharger](https://forum.openwrt.org/u/recharger)\
**Post date:** [March 1, 2026, 2:41pm UTC](https://forum.openwrt.org/t/problem-with-adguardhome-documentation-installation-script/247048/1 "2026-03-01T14:41:50Z")

</div>

I was following the documentation on [https://openwrt.org/docs/guide-user/services/dns/adguard-home](https://openwrt.org/docs/guide-user/services/dns/adguard-home) and after installing AGH there is a script starting with:

```plaintext
# Get the first IPv4 and IPv6 Address of router and store them in following variables for use during the script.
NET_ADDR=$(/sbin/ip -o -4 addr list br-lan | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1]; exit }')
NET_ADDR6=$(/sbin/ip -o -6 addr list br-lan scope global | awk '$4 ~ /^fd|^fc/ { split($4, ip_addr, "/"); print ip_addr[1]; exit }')
echo "Router IPv4 : ""${NET_ADDR}"
echo "Router IPv6 : ""${NET_ADDR6}"

```

Immediately I see an issue here, since the echos are returning empty for both variables when I run it in my router SSH as root:

```plaintext
root@OpenWrt:~# NET_ADDR=$(/sbin/ip -o -4 addr list br-lan | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1]; exit }')
root@OpenWrt:~# NET_ADDR6=$(/sbin/ip -o -6 addr list br-lan scope global | awk '$4 ~ /^fd|^fc/ { split($4, ip_addr, "/"); prin
t ip_addr[1]; exit }')
er IPv6 : ""${NET_ADDR6}"root@OpenWrt:~# echo "Router IPv4 : ""${NET_ADDR}"
Router IPv4 : 
root@OpenWrt:~# echo "Router IPv6 : ""${NET_ADDR6}"
Router IPv6 : 

```

Of course, when I run the rest, and then try to execute dnsmasq, it is now failing:

```plaintext
root@OpenWrt:~# dnsmasq -k -C /var/etc/dnsmasq.conf.cfg01411c 2>&1

dnsmasq: bad IP address at line 57 of /var/etc/dnsmasq.conf.cfg01411c

```

If I check line 57 of my config file (/var/etc/dnsmasq.conf.cfg01411c), it is:

```plaintext
dhcp-option=lan,3,

```

Is there a better command to get the IPv4 and IPv6 on the router so we can update the documentation? Otherwise it will break other people’s config as well.

---

<div class="post-metadata">

**Author:** ![pavelgl](https://forum.openwrt.org/user_avatar/forum.openwrt.org/pavelgl/32/33073_2.png) [@pavelgl](https://forum.openwrt.org/u/pavelgl)\
**Post date:** [March 1, 2026, 3:05pm UTC](https://forum.openwrt.org/t/problem-with-adguardhome-documentation-installation-script/247048/2 "2026-03-01T15:05:17Z")

</div>

You are most likely using VLANs and your device is not `br-lan`, but `br-lan.X`.

Try this:

```plaintext
dev=$(ifstatus lan | grep \"device | awk '{ print $2 }' | sed 's/[",]//g')
NET_ADDR=$(/sbin/ip -o -4 addr list $dev | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1]; exit }')
NET_ADDR6=$(/sbin/ip -o -6 addr list $dev scope global | awk '$4 ~ /^fd|^fc/ { split($4, ip_addr, "/"); print ip_addr[1]; exit }')
echo "Router IPv4 : ""${NET_ADDR}"
echo "Router IPv6 : ""${NET_ADDR6}"

```

---

<div class="post-metadata">

**Author:** ![recharger](https://forum.openwrt.org/letter_avatar/recharger/32/5_5575768a8748004e209b776fc1b2916d.png) [@recharger](https://forum.openwrt.org/u/recharger)\
**Post date:** [March 1, 2026, 3:12pm UTC](https://forum.openwrt.org/t/problem-with-adguardhome-documentation-installation-script/247048/3 "2026-03-01T15:12:58Z")

</div>

> [@pavelgl](#):
>
> ```plaintext
> echo "Router IPv6 : ""${NET_ADDR6}"
> 
> ```

Indeed @pavelgl I am, and those commands work correctly. Maybe it is good to add them also to Adguard docs? I imagine I am not the only person using VLANs…

I also noticed it is setting in the script option 3 and 6 to lan only, maybe it needs to find all dhcp interfaces and add as well.

---

<div class="post-metadata">

**Author:** ![pavelgl](https://forum.openwrt.org/user_avatar/forum.openwrt.org/pavelgl/32/33073_2.png) [@pavelgl](https://forum.openwrt.org/u/pavelgl)\
**Post date:** [March 1, 2026, 5:53pm UTC](https://forum.openwrt.org/t/problem-with-adguardhome-documentation-installation-script/247048/4 "2026-03-01T17:53:51Z")

</div>

The automatic extraction of the `lan` device name was added to the script.

> [@recharger](#):
>
> maybe it needs to find all dhcp interfaces and add as well.

Since one may want to not use AGH on all interfaces, added a note regarding manually setting DNS (for the additional interfaces) using option 6.
