# Install USB storage supporting packages
opkg update && opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3
# Show a list of block devices
ls -al /dev/sd*
# Install EXT4 file system on USB drive and use EXT4 to format the partition
mkfs.ext4 /dev/sda
# Log into Luci interface
# System menu >> Mount Points
# "Global Settings" >> "Generate Config"
# "Automount Filesystem" checked
# "Mount Points" >> "Edit"
# "Enabled" checked | "UUID" > "/dev/sda" | "Mount point" > "/mnt"
# "Global Settings" >> "Mount attached devices"
# "Save & Apply"
# System menu >> Startup
# Find "dnsmasq" and disable it
# Download armv5 release from official repo
opkg install curl, wget, libmbedtls12, tar
cd /mnt
wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_armv5.tar.gz
# Uncompress
tar -xvf AdGuardHome_linux_armv5.tar.gz
# Start init configuration wizard
cd /mnt/AdGuardHome
./AdGuardHome
# Admin Web Interface port : 8080
# DNS server port : 53
# Register as OpenWRT startup
./AdguardHome -s install
# Need ca-bundle & ca-certificates to make filter rule update work
opkg install ca-bundle, ca-certificates
# https://github.com/rufengsuixing/luci-app-adguardhome
# install luci-adguardhome-app
wget https://github.com/rufengsuixing/luci-app-adguardhome/releases/download/1.8-11/luci-app-adguardhome_1.8-11_all.ipk
opkg install luci-compat luci-app-adguardhome_1.8-11_all.ipk
# Configure router to use AGH as DNS server
# Advertise AGH IP address via dnsmasq in the router
# https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server
# Add "dhcp-option=6,192.168.100.3" in main router "Service" >> "dnsmasq" >> "Additional Dnsmasq Options"
# Set 192.168.100.1 as Upstream DNS servers in AGH "Setting" >> "DNS settings"
Below is the list of commands and the resulting output I recieve. I'm not sure that they have executed correctly?
login as: root
root@192.168.1.1's password:
BusyBox v1.30.1 () built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 19.07.2, r10947-65030d81f3
-----------------------------------------------------
root@STARGATE:~# opkg update
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/mvebu/cortexa9/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/mvebu/cortexa9/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/mvebu/cortexa9/kmods/4.14.171-1-a92a3f5c5bed2671533484c7ace9d5b5/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading http://downloads.openwrt.org/releases/19.07.2/targets/mvebu/cortexa9/kmods/4.14.171-1-a92a3f5c5bed2671533484c7ace9d5b5/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/telephony/Packages.sig
Signature check passed.
root@STARGATE:~# opkg install curl, wget, libmbedtls12, tar, luci-compat
Unknown package 'curl,'.
Unknown package 'wget,'.
Unknown package 'libmbedtls12,'.
Unknown package 'tar,'.
Upgrading luci-compat on root from git-20.094.46635-de52000-1 to git-20.098.26289-f3817c0-1...
Downloading http://downloads.openwrt.org/releases/19.07.2/packages/arm_cortex-a9_vfpv3/luci/luci-compat_git-20.098.26289-f3817c0-1_all.ipk
Configuring luci-compat.
Collected errors:
* opkg_install_cmd: Cannot install package curl,.
* opkg_install_cmd: Cannot install package wget,.
* opkg_install_cmd: Cannot install package libmbedtls12,.
* opkg_install_cmd: Cannot install package tar,.
root@STARGATE:~# opkg install curl
Package curl (7.66.0-1) installed in root is up to date.
root@STARGATE:~# opkg install wget
Package wget (1.20.3-2) installed in root is up to date.
root@STARGATE:~# opkg install libmbedtls12
Package libmbedtls12 (2.16.4-1) installed in root is up to date.
root@STARGATE:~# opkg install tar
Package tar (1.32-1) installed in root is up to date.
root@STARGATE:~# opkg install luci-compat
Package luci-compat (git-20.098.26289-f3817c0-1) installed in root is up to date.
root@STARGATE:~# wget https://github.com/iganeshk/AdGuardHome/releases/download/
v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz
--2020-04-08 16:22:38-- https://github.com/iganeshk/AdGuardHome/releases/download/v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz
Resolving github.com... 140.82.114.4
Connecting to github.com|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/238759547/cc862600-7764-11ea-8f91-3c0603b03894?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200408%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200408T202238Z&X-Amz-Expires=300&X-Amz-Signature=c3b621fd5cfedf9f0ec39a9bee02970c736b6180be04e9ed638d00fc38f80a19&X-Amz-SignedHeaders=host&actor_id=0&repo_id=238759547&response-content-disposition=attachment%3B%20filename%3DAdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz&response-content-type=application%2Foctet-stream [following]
--2020-04-08 16:22:38-- https://github-production-release-asset-2e65be.s3.amazonaws.com/238759547/cc862600-7764-11ea-8f91-3c0603b03894?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200408%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200408T202238Z&X-Amz-Expires=300&X-Amz-Signature=c3b621fd5cfedf9f0ec39a9bee02970c736b6180be04e9ed638d00fc38f80a19&X-Amz-SignedHeaders=host&actor_id=0&repo_id=238759547&response-content-disposition=attachment%3B%20filename%3DAdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com... 52.216.78.244
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com|52.216.78.244|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6322586 (6.0M) [application/octet-stream]
Saving to: 'AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz'
AdGuardHome_linux_a 100%[===================>] 6.03M 4.06MB/s in 1.5s
2020-04-08 16:22:40 (4.06 MB/s) - 'AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz' saved [6322586/6322586]
root@STARGATE:~# mkdir /etc/AdguardHome
root@STARGATE:~# tar -xvf AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.t
ar.gz --strip-components=1 -C /etc/AdguardHome/
AdGuardHome/AdGuardHome
AdGuardHome/README.md
AdGuardHome/LICENSE.txt
root@STARGATE:~# install luci-adguardhome-app
-ash: install: not found
root@STARGATE:~# # install luci-adguardhome-app
root@STARGATE:~# wget https://github.com/rufengsuixing/luci-app-adguardhome/rele
ases/download/1.8-11/luci-app-adguardhome_1.8-11_all.ipk
--2020-04-08 16:23:51-- https://github.com/rufengsuixing/luci-app-adguardhome/releases/download/1.8-11/luci-app-adguardhome_1.8-11_all.ipk
Resolving github.com... 140.82.113.3
Connecting to github.com|140.82.113.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/223392644/3f002380-2f34-11ea-91c3-03c1aa02d188?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200408%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200408T202351Z&X-Amz-Expires=300&X-Amz-Signature=fd76979d420a4bd626cda8a1c6ca198861736f9b9f8fbd46d9f4c8c26da8d2c3&X-Amz-SignedHeaders=host&actor_id=0&repo_id=223392644&response-content-disposition=attachment%3B%20filename%3Dluci-app-adguardhome_1.8-11_all.ipk&response-content-type=application%2Foctet-stream [following]
--2020-04-08 16:23:52-- https://github-production-release-asset-2e65be.s3.amazonaws.com/223392644/3f002380-2f34-11ea-91c3-03c1aa02d188?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200408%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200408T202351Z&X-Amz-Expires=300&X-Amz-Signature=fd76979d420a4bd626cda8a1c6ca198861736f9b9f8fbd46d9f4c8c26da8d2c3&X-Amz-SignedHeaders=host&actor_id=0&repo_id=223392644&response-content-disposition=attachment%3B%20filename%3Dluci-app-adguardhome_1.8-11_all.ipk&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com... 52.216.113.139
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com|52.216.113.139|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 91689 (90K) [application/octet-stream]
Saving to: 'luci-app-adguardhome_1.8-11_all.ipk'
luci-app-adguardhom 100%[===================>] 89.54K 577KB/s in 0.2s
2020-04-08 16:23:52 (577 KB/s) - 'luci-app-adguardhome_1.8-11_all.ipk' saved [91689/91689]
root@STARGATE:~# opkg install luci-app-adguardhome_1.8-11_all.ipk
Installing luci-app-adguardhome (1.8-11) to root...
Configuring luci-app-adguardhome.
grep: /etc/crontabs/root: No such file or directory
grep: /etc/crontabs/root: No such file or directory
grep: /etc/crontabs/root: No such file or directory
grep: /etc/crontabs/root: No such file or directory
grep: /etc/crontabs/root: No such file or directory
awk: /etc/AdGuardHome.yaml: No such file or directory
root@STARGATE:~#
Was a little absent minded regarding installation of multiple tools at once. There's no commas, so it's just like this opkg install curl wget libmbedtls12 tar luci-compat
From the outout, everything looks good. Now head to OpenWRT's administration portal (Luci) -> Services - AGH and configure it as interpreted in the image. (Enable and reboot)
After installation, you can change it back to 8000 from the luci-adguard configuration page. (This is because there is no configuration AdGuardHome.yaml at /etc/AdGuardHome/ directory. Hence when you finish installation, the file is generated and can be modified from config tab of the addon section).
So I was able to follow your instruction to the best of my abilities, but I ran into a couple of issues. I will describe them as best as I can and add pics for clarification. After finishing the last step above where I change the management port from 8000 to say 8080, then complete the adguard setup, go back and change the browser management port back to 8000, I began to run into internet connectivity issues. The computer that I was working from had sporadic internet connections, then dropped them alltogether. I could however still access my router. The adguard setup said to do the following:
This setup will automatically cover all the devices connected to your home router and you will not need to configure each of them manually.
Open the preferences for your router. Usually, you can access it from your browser via a URL (like http://192.168.0.1/ or http://192.168.1.1/). You may be asked to enter the password. If you don't remember it, you can often reset the password by pressing a button on the router itself. Some routers require a specific application, which in that case should be already installed on your computer/phone.
Find the DHCP/DNS settings. Look for the DNS letters next to a field which allows two or three sets of numbers, each broken into four groups of one to three digits.
Enter your AdGuard Home server addresses there.
So in the WRT3200AC router settings in DHCP /DNS I thought it was required to change the DNS monitoring port to 5353. I performed that step, but nothing really changed in terms of internet connectivity. In fact I have no monitoring details within the Adguard GUI at 192.168.1.1:8000. It was completely dead. So I changed back that value to "blank" as I wasn't sure if I should have touched that to begin with.
Now, the ONLY way I was able to restore internet connectivity to my computer, and my other wired computer and wi-fi devices was to change one single setting which differs from the above image you instructed me to follow. I was at a complete loss as how to even get back an internet connection so I thought I'd try it. I changed this setting in the picture below...
Once I did this all internet connectivity returned and Adguard Home GUI web interface started showing statistics and activity. But I'm worried now as to why "run as dns/masq upstream server" killed my connectivity and other clients on my network? I want to figure this out and make sure I'm doing things right.
EDIT: As a side note I installed your black theme, but it's just showing the default white theme.
EDIT2: I'm wondering if that happened becuase I hit "Update Core Version"? Would that have replaced your black theme?
If you were able access the router, I guess the DNS forwarding wasn't working hence clients lost internet access. If you require granular control, it'd fine to replace AGH with dnsmasq (the last option)
I would assume tar failed to overwrite files and did not extract the dark theme binary to /etc/AdGuardHome but instead /etc/AdGuardHome/AdGuardHome
Just execute these command
# backup the existing binary
mv /etc/AdGuardHome/AdGuardHome /etc/AdGuardHome/AdGuardHome.bak
# move the dark theme build binary above
mv /etc/AdGuardHome/AdGuardHome/AdGuardHome /etc/AdGuardHome
Reboot the router and access AGH again, should be dark.
Last time I selected: Admin Web Interface: br-lan-192.168.1.1 PORT: 8000 DNS Server: br-lan-192.168.1.1 PORT:5353
I am wondering if this is why when I selected "run as dns/masq upstream server" it then killed my connectivity and other clients on my network when configured in OpenWRT's administration portal (Luci) -> Services - AGH. Is this the part I messed up?
What interface selection are you supposed to choose?
Thanks for your patience gnashk. I'm back tracking a bit to ask questions on things I thought were the right selection initially.
EDIT: I think I would like to filter just my computer initially, take the time to get used to it, then later look at how to configure it for complete home network filtering.
mkdir /opt/ && cd /opt
wget -c https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.101.0/AdGuardHome_linux_armv5.tar.gz
tar xfvz AdGuardHome_linux_armv5.tar.gz
rm AdGuardHome_linux_armv5.tar.gz
Either just run it /opt/AdGuardHome/AdGuardHome or install it directly with /opt/AdGuardHome/AdGuardHome -s install
The web interface should run on a port other than 80, since Luci already runs on it. The DNS port should be other than 53, because the standard OpenWrt DNS server is already listening on port 53. So use 5353 and send all requests from 53 to 5353. You can do this with the firewall.user rule in my first post. Also make sure to edit the dhcp config!
Edit: I altered my first post and made things more clear.
I just wanted to take the time to thank everyone here for their help in assisting me and others with providing a great tutorial to follow to install AdGuard on an OpenWrt router. This thread has been an incredible resource to me for getting things up and running.
Cheers!
Special thanks to gnashk, WildByDesign, brokenpipe, zzzzoooo and Brickme!!!
~Dustyn~