OpenWRT – Adblock

OpenWRT offers an adblock tool and extensive block lists. It blocks adds on DNS basis like a Pi-hole. The service easy to install and to configure.


Go to all articles of this series and the description of the test setup:

Test Setup
Test Setup

OpenWRT – Overview


Ad Block

Powerful adblock script to block ad/abuse domains via dnsmasq, unbound, named or kresd.

The script supports many domain blacklist sites plus manual black- and whitelist overrides.

https://github.com/openwrt/packages/tree/master/net/adblock/files

opkg install adblock luci-i18n-adblock-en luci-app-adblock luci-i18n-adblock-de tcpdump-mini

Start the adblock service after the package installation.

OpenWRT - Adblock
OpenWRT – Adblock
/etc/init.d/adblock start

A new menu will appear Services --> Adblock

OpenWRT - Adblock
OpenWRT – Adblock

General Settings

OpenWRT - Adblock
OpenWRT – Adblock

Additional Settings

OpenWRT - Adblock
OpenWRT – Adblock

The adblock files can get stored on an USB storage device.
Follow this manual to mount the external storage.

OpenWRT – USB Storage Device

Create the folders for tmp and backup on the CLI.

mkdir /mnt/sda1/adblock
mkdir /mnt/sda1/adblock/tmp
mkdir /mnt/sda1/adblock/backup
mkdir /mnt/sda1/adblock/adb_list
mkdir /mnt/sda1/adblock/reports

Advanced Settings

OpenWRT - Adblock
OpenWRT – Adblock

Advanced DNS Settings

OpenWRT - Adblock
OpenWRT – Adblock

Advanced Report Settings

OpenWRT - Adblock
OpenWRT – Adblock

Create the report directory.

mkdir /mnt/sda1/adblock/reports

Gib mir gerne einen Kaffee ☕ aus!

Wenn dir meine Beiträge gefallen und geholfen haben, dann kannst du mir gerne einen Kaffee ☕ ausgeben.

PayPal Logo


liberapay.com/strobelstefan.org


Kaffee via Bitcoin

bc1qfuz93hw2fhdvfuxf6mlxlk8zdadvnktppkzqzj


Advanced E-Mail Settings

OpenWRT - Adblock
OpenWRT – Adblock

Blocklist Sources

OpenWRT - Adblock
OpenWRT – Adblock

The lists are maintained on GitHub

https://github.com/StevenBlack/hosts

Automtic Restart

You can enter a cron to restart adblock regularly in LuCi System - Scheduled Tasks or you use the built-in Refresh Timer ....

OpenWRT - Adblock
OpenWRT – Adblock

Create your own restart job using the LuCi interface.

OpenWRT - Adblock
OpenWRT – Adblock

The Line in Scheduled Tasks looks as following.

# Adblock Reload
45 06 * * * /etc/init.d/adblock restart

You can easily create you own cron job using this web service

https://crontab.guru

AdBlock Report

You can check the adblock report for details.

OpenWRT - Adblock
OpenWRT – Adblock

In the section Lastest DNS Requests you can add websites to the black or white list.

Links

Logrotate

To avoid too many log files on the USB storage device you can use logrotate to remove the files automatically.

opkg install logrotate

No LuCi app for logrotate is available everything must be setup on CLI.

The directory where logrotate scripts are maintained is /etc/logrotate.d.

You can easily add a ne logrotate script for adblock

nano adblock-log
/mnt/sda1/adblock/reports {
rotate 4
daily
missingok
notifempty
compress
delaycompress
sharedscripts
endscript
}

See all articles of this series …

stefanstrobel - Logo

… on strobelstefan.org
Overview of all OpenWRT Articles/

© Logo material is licensed under CC0 Codeberg and the Codeberg Logo are trademarks of Codeberg e.V

… hosted on Codeberg.

https://codeberg.org/strobelstefan.org/openwrt-configuration


Gib mir gerne einen Kaffee ☕ aus!

Wenn dir meine Beiträge gefallen und geholfen haben, dann kannst du mir gerne einen Kaffee ☕ ausgeben.

PayPal Logo


liberapay.com/strobelstefan.org


Kaffee via Bitcoin

bc1qfuz93hw2fhdvfuxf6mlxlk8zdadvnktppkzqzj


Source:
– https://openwrt.org/
– https://openwrt.org/_media/docs/guide-graphic-designer/openwrt-logo-usage-guidelines.pdf

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert