Adguard On OPNsense
The Choice
I have used PiHole on a Raspberry Pi over the last years and it had serve me well but i wanted to use the raspberry with OpenMediaVault and i thought to use the same box that has running OPNsense, my zimaboard 832.
Installing OPNSense Community Repository
OPNsense doesn´t natively support the Adguard home plug in. So in order to add the AdGuard community plugin we need to connect the OPNsense command line. I chose to use SSH to access the CLI but you can connect a display cable as well. We have to use the option 8 for connect to the shell prompt. Now you can use the commands present on this git hub pages: https://github.com/mimugmail/opn-repo
fetch -o /usr/local/etc/pkg/repos/mimugmail.conf https://www.routerperformance.net/mimugmail.conf
pkg update
pkg search -g -r mimugmail \*
rm /usr/local/etc/pkg/repos/mimugmail.conf
pkg query -a '%R %n-%v' | grep mimugmail
Now we can go back to the opnsense web interface to enable the plugin: On system, we click on Firmware and plugins and we should see the adguard plugin on the options.
To install the plugin we just need to press the + icon on the right side of the screen.
On my case the package could not been installed because i first need to update OPNsense to the last version. So on the updates tab we need to install the updates.
After the installation and refreshing the page, we should see the Adguardhome service on the Services menu: ![AdGuard Services](/img/Pastedimage 20240627120821.png)
Enable AdGuard and Initial Setup
First we need to check the “enable” button to enable and start the service.
To configure AdGuard itself we need to go to a separate interface on the port 3000. In my case my IP address is 10.10.110.1, so my AdGuard IP is http://10.10.110.1:3000
By default AdGuard chose all interfaces to be admin interface but we can select the ones that we want to access. In my case i choose my management interface. By default as well, aAdGuard chose all interfaces to use the services as it DNS Server. In my case i choose one only one vlan. The next steps is setup an user and update adguard.
DNS Blocklists
By default Adguard has some filter configured by default to block some of the most common adds. Its on this page that we can set up block lists that we want AdGuard Home to pull down and install locally.
Update OPNsense DHCP options
To update the DHCP server on the OPNsense we need to go to “Services” –> DHCPv4 and choose our DHCP server that we want that use the AdGuard dns server, like this:
And that’s it! We have now installed AdGuard on a OPNsense machine. Must of the adds present on websites and applications are blocked with the default blocklist present on AdGuard. We can use the internet on a more debloated way.