How to setup adblocker on OpenWrt router

In this quick guide we will see how to setup adblocker on OpenWrt router. I tested this on PandoraBox (OpenWrt based firmware for Xiaomi Mi3 router) and it works beautifully.

Installing necessary packages

We need to install some packages before setting up adblocker. First SSH into your router then execute the below commands (execute those commands one by one)

wget --no-check-certificate
chmod +x

Setting up adblocker

Execute those below commands to download my custom adblocker script into /etc directory. The script will block ads and porn sites. You can modify the script if you want

cd /etc

Now give proper permission to script and execute

chmod +x

Done! If you need to add a website to whitelist, simply open /etc/white.list file and add your website. Then execute the below command.



2 thoughts on “How to setup adblocker on OpenWrt router

  1. makima

    nice! thank you!

    1. Kamrul

      Glad it helped. Thanks for reading

Leave a Reply

Your email address will not be published.