What's new

[Beta] Adblock WCHFA (Closed, use AB-Solution thread).

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

thelonelycoder

Part of the Furniture
This script is out of beta and released as AB-Solution.
Thank you to all the brave testers!

Please check the Diversion website for latest version and discussion link.


The beta is no longer under development.

I've gone all the way and automated the setup of AdBlocking with combined hosts file.
Hence the (preliminary) name Adblock WCHFA, the A stands for automated.

The way it works is you put the setup script on a USB device, plug it into the router and run it from a terminal.

The script guides you through the setup steps, so far I have the following implemented:
1. Detect attached devices (ext2/ext3/ext4,fat), select where to install the files
2. Choose directory name for the files to be placed in on the device
3. Checks for previous Adblock WCHFA or the manual install of the linked thread above
4. Backup of /jffs/* before changes are made to dnsmasq.postconf and services-start files
5. Select dnsmasq logging on or off at install. If set to on, a rotation script is added to prevent large log file(s)
6. Generation of combined hosts file during setup, auto updates once a week
7. No reboot of router required to make it active

I have tested it on my two routers, RT-AC66U and RT-AC87U with each the current stable asuswrt-Merlin 378.56_2 as well as the 380.57_alpha4 build with a selection of devices attached to them.

The script will work on a vanilla install of asuswrt-Merlin, no additional software packages are needed to make it do it's magic.

Soon I will be at a stage where I need some beta testers to run the script on other Asus models and firmware versions, with a greater variety of attached USB devices.
I don't know when I will release this script to the public. But for now I'd like to have a small group only to give feedback and maybe even contribute to the code.

One other important goal I have is to find a mechanism to allow the SmallNetBuilder site and this forum to be exempt from ad-blocking. There are ways to do this but I am not there yet and need help in that regard.
In fact, this is a mandatory requirement for me to release a public version of this automated script.

If you are interested in becoming a beta tester please leave a reply and let me know why you'd like to participate and what router model(s) you have.
No PM's please, I will gently ignore them.

(intentionally no code posted in this post...)
Good news: Testing starts now! See post #7
 
Last edited:
i have an asus rt-ac66u i like the idea of being able to white-list some domains so i dont mind being a guinniepig
 
...
One other important goal I have is to find a mechanism to allow the SmallNetBuilder site and this forum to be exempt from ad-blocking. There are ways to do this but I am not there yet and need help in that regard.
In fact, this is a mandatory requirement for me to release a public version of this automated script.

...)

I hope this doesn't come across as patronising, but that's highly commendable of you.
 
I don't mind giving it a go, although it might be a difficult test because;

1) I have an N66U.
2) I'm running John's fork, not Merlin's.
3) I already have my own variation of your method already installed so it will be interesting to see how it copes with that. :)
 
I have the N66U, but I have to wait for the 380 version, I recall having issues with the dnsmasq.postconf file, it just does not get added to the dnsmasq.conf I need to use the dnsmasq.conf.add, I´m also using dnscrypt, and the logging, I dont rotate files, I just created a simple script that erases the content of the file weekly, not interested on going way back to check logs... Im also using a slight variation in the script and the host files
 
I have an RT-AC86U, and would be very interested in testing this, primarily for the blocking of seemingly irrelevant ads. My "estate" has numerous device types (mobile, tablet, tv, laptop, mac/win pc etc etc).
I have an existing firewall script enabled (from the wiki), and it works well on the firewall, but "irrelevant" ad's are pesky.
(I do recognise "irrelevant" is a personal/human trait, and technology is not quite there yet, but at the time of year, they are very pesky!)
 
AdBlock wchfa 0.9.4_beta is out for testing!

How to install it:
- Download the script
- Place adblock-setup.sh into the root directory on a ext2 or ext3 formatted USB stick (this device will remain plugged into the router)
- Plug stick into router
- Login with ssh on you router
- Navigate into the stick's root directory
- run
Code:
sh ./adblock-setup.sh
The (verbose) script will guide you through the setup process.

If you already have an ext2, ext3 or even ext4 formatted USB device plugged into the router and want to use that:
You can place adblock-setup.sh on another USB stick (however formatted) and plug it into the router (if your router has at least 2 USB ports).
Then you start the setup process from that second stick and install it on the ext* formatted stick.

Download:
0.9.4_beta Release (GitHub)
Download Source code (zip or tar.gz archive)
Unpack the archive and only place adblock-setup.sh on your USB device.

Let me know how it goes!
 
AdBlock wchfa 0.9.4_beta is out for testing!

How to install it:
- Download the script
- Place adblock-setup.sh into the root directory on a ext2 or ext3 formatted USB stick (this device will remain plugged into the router)
- Plug stick into router
- Login with ssh on you router
- Navigate into the stick's root directory
- run
Code:
sh ./adblock-setup.sh
The (verbose) script will guide you through the setup process.

If you already have an ext2, ext3 or even ext4 formatted USB device plugged into the router and want to use that:
You can place adblock-setup.sh on another USB stick (however formatted) and plug it into the router (if your router has at least 2 USB ports).
Then you start the setup process from that second stick and install it on the ext* formatted stick.

Download:
0.9.4_beta Release (GitHub)
Download Source code (zip or tar.gz archive)
Unpack the archive and only place adblock-setup.sh on your USB device.

Let me know how it goes!

working great, so I have no ads all in my Android devices, but in Windows 10 there is nothing changed. ipconfig /flushdns is done, chrome cache cleared, notebook rebooted but in windows 10 I see lots of ads. My router is AC87u with 380.57.2_HGG-FINAL. Any idea why adblocking not working in Windows 10?

For example nslookup from my router show :

[criton@rt-ac87u root]$ nslookup hu.hit.gemius.pl
Server: 127.0.0.1
Address 1: 127.0.0.1 localhost.localdomain

Name: hu.hit.gemius.pl
Address 1: 0.0.0.0 0.0.0.0


the same nslookup in windows 10:

C:\Users\Csaba>nslookup hu.hit.gemius.pl
Server: router.asus.com
Address: 192.168.2.1

Non-authoritative answer:
Name: hu.hit.gemius.pl
Addresses: 195.70.62.8
195.70.62.9
 
Last edited:
working great
Good to hear, thanks!

the same nslookup in windows 10:
What is the DNS Setting on your Win10 box? Should point to 192.168.2.1
And if you have chosen to use dnsmasq logging during the install, have a look at that.
Something like this will do if your stick is sda1:
tail -f /tmp/mnt/sda1/adblocking/logs/dnsmasq.log
 
Good to hear, thanks!


What is the DNS Setting on your Win10 box? Should point to 192.168.2.1
And if you have chosen to use dnsmasq logging during the install, have a look at that.
Something like this will do if your stick is sda1:
tail -f /tmp/mnt/sda1/adblocking/logs/dnsmasq.log

dns is obtain dns.... so its not manual entered in windows 10.

In the log I see :
Jan 23 13:32:02 dnsmasq[1132]: query[A] hu.hit.gemius.pl from 192.168.2.25
Jan 23 13:32:02 dnsmasq[1132]: /tmp/mnt/optware-ng/adblocking/hosts-adblock hu.hit.gemius.pl is 0.0.0.0

The 192.168.2.25 is my notebook with windows 10, but the ad is still there :(
 
@Benesch Csaba in chrome hit ctrl-F5 to completely refresh a page.
You are having cache isses as the scripts seem to do the job as intended.
 
Looking at your script how would this behave with a dnsmasq.postconf file that leverages dnscrypt via no-resolve switch?
 
Looking at your script how would this behave with a dnsmasq.postconf file that leverages dnscrypt via no-resolve switch?
Can't tell, never used it that way.
 
Can i use this adblock with entware?

sent from Kodi 17 Krypton
 
Can i use this adblock with entware?

sent from Kodi 17 Krypton
Sure, the setup script writes a new services-start and dnsmasq.postconf in /jffs/scripts/ but will make a backup before it does this.
Just re add any entries you have in these from the backup. The backup location will be in the adb-backup folder in the root of the USB device you choose to install Adblock to.
 
used it on my inlaws ac66u and worked as a charm:)
thank you verry much, this saved me a bit of a hassle of making the scripts manually again.
Used the advanced option.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top