I may have to redo that script to pick up the ULA prefix and add it. I thought i could shortcut and use ::1 as a shortcut and thus not need to handle the prefix. Unfortunately because my ISP lives in the dark ages I'm actually unable to test this. (They have been promising IPv6 for years... and done nothing.)
I may have to reconsider if using AGH DHCP may be a simpler option. Downside is that their DHCP is vastly inferior to OpenWrt's setup. Upside would be easier configuration as AGH would hand out the proper IP4/6 DNS to clients.
Sorry for the late response. The current behaviour is definitely invalid, since --check-config really shouldn't rewrite the configuration file.
As for the original use case, we'll probably consider adding a mechanism for setting some default values on the first run, including user information and addresses, in the future. But that will require a refactoring of the configuration handling, which should happen around v0.108.
This would aid with scripting the install and hopefully will be "Soon(tm)" as 108 builds are on edge channel now.
I've done some thinking and i think what i shall do is revamp my install script to pull ip4 and ip6 addresses from uci and thus parse those values into the script. The bonus to that is that I can remove the warnings for people who aren't using 192.168.1.1 for OpenWrt as it will use the routers config to do it instead. I'll try have this fixed for this week.
I have one more question: how do I find out which package I should download to update adguard home? I use a xiaomi miwifi 3g, using the command uname -a, it shows the mips information, but it has the mipsle package on the adguard home github, so which of the two packages is the correct one for the mi router 3g?
The manual script i developed for tight on space routers and it was purely for my router variant. There is however no reason you couldn't adapt it for your router. However it should not be needed soon as AGH team are redoing their updating so limited space routers are handled better.
If you check your syslog you should see a line like this (even if it fails to update due to lack of space)
There is an issue filed for disk space and failed updates which is being worked on. Its been pushed back to 108 due to them needing to know actual sizes and compression so they can automate it better.
Here only the blue tab appears with the message that a new update is available, but not the update now button. I even added a pendrive as extroot, followed the openwrt website tutorial, I didn't create swap.
Ok if you are using the edge version it should give you the update button. I'd raise an issue with AGH team but only after a full reboot #incase. Mostly because reboots fix everything... unless it doesn't. Dont you love IT?
Well it turns out you cannot pull the ipv6 address from the uci system therefore its time for some bash scripting.
(edit make sure you have the jq package installed first. opkg update then opkg install jq)
fixIP6DNS.sh
#!/bin/sh
NET_ADDR=$(/sbin/ip -o -4 addr list br-lan | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1] }')
NET_ADDR6=$(/sbin/ip -o -6 addr list br-lan scope global | awk 'NR==1{ split($4, ip_addr, "/"); print ip_addr[1] }')
echo "Router IPv4 : ""${NET_ADDR}"
echo "Router IPv6 : ""${NET_ADDR6}"
#delete incorrect ipv6 DNS server and replace with proper ip
uci -q delete dhcp.lan.dns
for OUTPUT in $(ip -json address list br-lan | jq -r '.[0].addr_info[] | select(.family=="inet6" and .scope=="global") | .local')
do
echo "Adding $OUTPUT to DNS"
uci add_list dhcp.lan.dns=$OUTPUT
done
# Save changes
uci commit dhcp
# Restart dnsmasq service to reflect changes
/etc/init.d/dnsmasq restart
For completeness change your AdGuardHome.yaml file and add your ipv6 router ip.
Ok. Main post updated. IPv6 DNS fix is in and I split my script into two parts. The first removes your ISP DNS and sets the router DNS to use Cloudflare. You may ignore that and continue with the master install script if you wish.
The install script is now fixed for IPv6. It also looks up the first ipv4 and v6 addresses to use for installing. It uses the br-lan interface for this. If you have a different interface you will need to change the script.
I was confused on that part. Is the ipv6 address you say to add here the one that appears in br-lan, the ipv6 address that is below ipv4, which in this case is 192.168.1.1?
What values did you use? I have a mi router 3g, it has the same chipset.
(while this does improve speed of DNS queries, you have to understand that this will continually refresh EVERY DNS request that was passed to the server, instead of letting them expire and only cache used ones.)
Friend, explain to me how I create the .sh files, because it is giving error in the installation. Once created, which commands should I use for them to run? I have little knowledge of linux, I know very little and .sh scripts is not one of them.
Got it, so it was the way I had researched, thanks for the explanation. But still something is not working for me, look what the log generated by fixIP6DNS.sh:
root@OpenWrt:~# vi fixIP6DNS.sh
root@OpenWrt:~# chmod +x fixIP6DNS.sh
root@OpenWrt:~# ./fixIP6DNS.sh
Router IPv4 : 192.168.1.1
Router IPv6 : fd0b:7a4c:589f::1
./fixIP6DNS.sh: line 11: jq: not found
BusyBox v1.33.1 (2021-10-24 09:01:35 UTC) multi-call binary.
Usage: ip [OPTIONS] address|route|link|neigh|rule [ARGS]
OPTIONS := -f[amily] inet|inet6|link | -o[neline]
ip addr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX]
ip route list|flush|add|del|change|append|replace|test ROUTE
ip link set IFACE [up|down] [arp on|off] [multicast on|off]
[promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC]
[master IFACE | nomaster]
ip neigh show|flush [to PREFIX] [dev DEV] [nud STATE]
ip rule [list] | add|del SELECTOR ACTION
udhcpc: started, v1.33.1
udhcpc: sending discover
udhcpc: no lease, failing
root@OpenWrt:~#
This also happens when I run installAGH.sh, after it installs adguard home, this part of ipv4 and ipv6 gives the same errors generated by the previous script, here the output is not the same as yours. Am I doing something wrong? Before running installAGH.sh need to modify it in something?
... i fought network.sh over the weekend and could NOT get it to pull properly. I could get it to pull WAN addressses fine but not lan. (your script needed an extra 6 removing.)
Its why i resorted to bash scripting instead.
(edit - does that pull ALL your ip6 addresses or just the first ULA one btw? It only pulls my lone one when i try it)