https://forum.openwrt.org/t/why-is-openwrts-dev-root-turn-to-read-only-mode/28631/4?u=whc2001 https://macgeeker.com/openwrt/openwrt-readonly/
https://openwrt.org/docs/guide-user/base-system/hotplug#rename_interfaces_by_mac_address
Run the script in /etc/rc.local
CONF_FILE="/root/eth_device_names.tsv"
devices="$(ls /sys/class/net/*/device/uevent | awk -F '/' '{print $5}')"
for deviceName in ${devices}; do
hasConf=0
deviceMAC="$(cat /sys/class/net/"${deviceName}"/address)"
ip link set "${deviceName}" down
while IFS= read -r line; do
confMAC=$(echo -n "$line" | cut -f 1)
confName=$(echo -n "$line" | cut -f 2)
if [ -n "${confMAC}" -a -n "${confName}" ] && [ "${deviceMAC}" == "${confMAC}" ]; then
ip link set "${deviceName}" name "${confName}"
hasConf=1
break
fi
done < $CONF_FILE
if [ $hasConf -eq 0 ]; then
# If not specified in config file, default to last 4 digit of MAC
defName="eth$(echo -n $deviceMAC | sed "s/://g" | tail -c 4 | tr "a-f" "A-F")"
ip link set "${deviceName}" name "${defName}"
fi
done
/etc/init.d/network reload
Config file (TSV):
XX:XX:XX:XX:XX:XX ethLAN1
XX:XX:XX:XX:XX:XX ethLAN2
XX:XX:XX:XX:XX:XX ethWAN
...
Don't forget to modify /etc/config/network
DO NOT TRY THIS AT HOME!!! THIS IS MISLEADING BUT IT WORKS FOR NOW AND I AM TAKING NOTES FOR MYSELF
--> [53] AdGuardHome --> [1745] dnsmasq --> [1053] OpenClash
AdGuardHome as ad filter, dnsmasq as local domain hijacking, OpenClash as proxy and DNS traffic redirector
Should listen on 53 (Enable redirection like below, dnsmasq is automatically adjusted to 1745).
Next DNS of AdGuardHome should point to dnsmasq (1745)
As mentioned before, AdGuard Home LuCI should automatically change the listening port of dnsmasq to 1745 under replace mode.
Next DNS of dnsmasq should point to OpenClash (1053)
Uncheck the two checkboxes in the advanced settings or OpenClash can't obtain the domain name (unsure if it's because these two options but very likely)
Use 7-6-1 and 7-6-2 to set the NameServer DNS and Fallback DNS
Use 7-6-7 in CLI to disable local DNS hijacking (after doing this the local DNS menu option should say "disabled". Actually it's not, but the CLI says so and prevents you from accessing the DNS settings until you re-enable it? Not sure, just set the DNS servers before this step)
Point published DNS server to OpenWrt and done.