Adblock for DD-WRT (and other POSIX systems)
- DD-WRT on a router with USB port(s) and USB support enabled
- curl (for best protection)
- wget (fallback supported)
- a USB flash drive partitioned as /jffs and /opt, optionally a swap partition as well.
- On router
cd /jffs/dnsmasq
curl -o adblock.sh adblock.sh
orwget -O adblock.sh adblock.sh
chmod +x adblock.sh
- Optional: create
myblacklist
andmywhitelist
files in the same directory and populate these with domains you want to blacklist or whitelist.
- On a Linux system within the same network
mkdir adblock
curl -o adblock.sh adblock.sh
orwget -O adblock.sh adblock.sh
chmod +x adblock.sh
- Use the
--remote=
command line argument to upload the lists to your router after generating locally.
- Enable DNSMasq and local DNS for LAN and WAN. Add these lines under the additional options section.
conf-file=/jffs/dnsmasq/mpdomains
addn-hosts=/jffs/dnsmasq/mphosts
- Enter additional options for dnsmasq if required, for example:
domain-needed
bogus-priv
- Under Administration -> Cron, enter this or choose your own schedule:
0 6 * * 1,4 root /jffs/dnsmasq/adblock.sh
- Reboot after generating the lists.
<Website>
: https://adblock.sh
<DD-WRT Forum Post>
: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=307533