The idea is to repurpose an old device able to run OpenWRT as dedicated AdGuard appliance, for this purpose we need to:
dnsmasq
As I have installed OpenWRT in an old laptop I use for testing purposes, I’m jumping straight to uninstalling dnsmasq
dnsmasq
This is required assuming the device is not the primary dns or dhcp server in the network. Since AdGuard will take the role of dns server.
There are ways to remove each service individually, however I prefer to remove dnsmasq
completely
/etc/init.d/dnsmasq stop
opkg remove dnsmasq
If you prefer to -for some reason- keep dnsmasq
and instead disable each server independently, see following links
(Disable DHCP Server)[https://openwrt.org/docs/guide-user/network/wifi/dumbap#step_3disable_dhcp_server]
(Disable DHCPv6 Server)[https://openwrt.org/docs/guide-user/network/wifi/dumbap#step_4disable_dhcpv6_server]
opkg update
opkg install adguardhome
Install curl
either via the LuCi web interface or using opkg
example:
opkg install curl
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
/opt/AdGuardHome/AdGuardHome -s start
example of how /etc/config/network
should look like (use your own values)
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1 eth1'
option proto 'static'
option ipaddr '192.168.0.2'
option netmask '255.255.255.0'
option gateway '192.168.0.1'
list dns '192.168.0.100'
Learn more: