What's new

[How-to] Adblock Plus filters right on router

  • 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!

VPS is down, please, try again tomorrow.

PS I'm getting tired of bluevm.com hoster, this is 7th down for the last half year:(

Take a look at Linode. Very professional support. A friend of mine has been with them for years, and I am currently in the process of migrating our dedi server at work to a Linode.
 
Take a look at Linode. Very professional support. A friend of mine has been with them for years, and I am currently in the process of migrating our dedi server at work to a Linode.

Agree. I've set up a VPN server on it and the service is quite stable.
 
Am I right assuming this ad-blocking method will not only block content loading from ad sites (same as hosts file does) but also hide ads in the page and rearrange the page? Same as ad-block plus does in pc browsers?
Thanks for the info.
 
Am I right assuming this ad-blocking method will not only block content loading from ad sites (same as hosts file does) but also hide ads in the page and rearrange the page? Same as ad-block plus does in pc browsers?
Exactly! Right.
 
Is there an adblock solution for an asus rt-ac68u?

Hey, I'm new to this forum, and have been searching around for answers to my question, but haven't found any.

Is there an adblock solution that will work on an asus rt-ac68u with Merlin WRT firmware? I realize the solution presented in this thread requires entware, which doesn't work on the rt-ac68u.

Thanks for your help!
 
This is HOW-TO for using Adblock Plus filters on router with Merlin's firmware. Better to use it with iOS/Android devices. Using with PC will slow down web surfing because of router performance limitations.
It's based on privoxy — a proxy server, which will intercept and filter all web-traffic from chosen iOS/Android device.

Requirements:
1. Asuswrt-Merlin driven RT-N16/RT-N66U/RT-AC66U router with USB-drive.
2. Working Entware environment. Please, refer to Eric's how-to for details.

Setup
1. Install necessary packages:

2. Install prepared privoxy configuration file:

3. Install script for converting AdBlock Plus rules:

4. Choose AdBlock Plus subscriptions.
Please, find "URLS=" string in privoxy-blocklist_0.2.sh and put your own subscriptions here. You may sneak subscription URLs in you favourite browser or here. The default subscriptions is a easylistgermany and easylist.
Now convert AdBlock Plus rules to privoxy format by running:

5. Choose iOS/Android/PC device where filtering needed.
Please, go to router's web interface, "LAN > DHCP Server" page, and select "Enable Manual Assignment" button.
Add your device to "Manually Assigned IP around the DHCP list". Better to do it while device is connected to router: you may select it's MAC from drop-down list and assign an IP address for it, for example "192.168.0.101". Don't forget to push "Apply" button (I did:))
6. Add web traffic interception rule to iptables.

where 192.168.0.101 is an IP address from step above.

Reboot router and check web surfing on chosen device.

If you want to change AdBlock subscriptions, please remove old ones first:

then repeat step #4 only.




I can use it on the latest software buld merlin or fork
asus RT-AC66U Thanks

not working url

login as: admin
admin@192.168.1.1's password:


ASUSWRT-Merlin RT-AC66U_3.0.0.4 Sun Aug 17 20:10:42 UTC 2014
admin@RT-AC66U-8AB0:/tmp/home/root# wget -O - http://entware.wl500g.info/binarie
s/entware/installer/entware_install.
Connecting to entware.wl500g.info (81.4.122.163:80)
wget: server returned error: HTTP/1.1 404 Not Found
admin@RT-AC66U-8AB0:/tmp/home/root# echo "#!/bin/sh" > /jffs/scripts/services-st
art
-sh: can't create /jffs/scripts/services-start: nonexistent directory
admin@RT-AC66U-8AB0:/tmp/home/root# echo "sleep 20" >> /jffs/scripts/services-st
art
-sh: can't create /jffs/scripts/services-start: nonexistent directory
admin@RT-AC66U-8AB0:/tmp/home/root# echo "/opt/etc/init.d/rc.unslung start" >> /
jffs/scripts/services-start
-sh: can't create /jffs/scripts/services-start: nonexistent directory
admin@RT-AC66U-8AB0:/tmp/home/root# echo "#!/bin/sh" > /jffs/scripts/services-st
op
-sh: can't create /jffs/scripts/services-stop: nonexistent directory
admin@RT-AC66U-8AB0:/tmp/home/root# echo "/opt/etc/init.d/rc.unslung stop" >> /j
ffs/scripts/services-stop
-sh: can't create /jffs/scripts/services-stop: nonexistent directory
admin@RT-AC66U-8AB0:/tmp/home/root# chmod a+rx /jffs/scripts/*
chmod: /jffs/scripts/*: No such file or directory
admin@RT-AC66U-8AB0:/tmp/home/root# opkg list
-sh: opkg: not found
admin@RT-AC66U-8AB0:/tmp/home/root#
 
Last edited:
login as: admin
admin@192.168.1.1's password:

admin@RT-AC66U-8AB0:/tmp/home/root# entware-setup.sh
Info: This script will guide you through the Entware installation.
Info: Script modifies only "entware" folder on the chosen drive,
Info: no other data will be touched. Existing installation will be
Info: replaced with this one. Also some start scripts will be installed,
Info: the old ones will be saved to .entwarejffs_scripts_backup.tgz

Info: Looking for available partitions...
*** Error: No ext2/ext3 partition available. Exiting...
admin@RT-AC66U-8AB0:/tmp/home/root#
 
Last edited:
The firewall-start script seems to break some of the buttons on the web configuration page of the router. The apply buttons on the pages no longer work. Removing the script entirely and rebooting fixes the problem, but is there another way to fix this? I want to be able to filter and configure my router at the same time.

I also see that, through the console in "Inspect Element" in Firefox, that everytime I click the apply button the error "ReferenceError: showLoading is not defined" pops up. I do not know what this means, but it may be a clue as to what causes the issue.
 
Last edited:
Hi Folks,

Today, privoxy was not able to start:

Code:
Nov  5 19:02:38 routeur admin: Failed to start privoxy from .

Trying to start it manually:
Code:
/opt/etc/init.d/S24privoxy start
 Starting privoxy...              failed.

Cleaning logs and looking for new errors but seems nothing is written
Code:
ls -l /opt/var/log/privoxy
-rw-rw-rw-    1 admin    root             0 Nov  5 18:47 /opt/var/log/privoxy

Any idea?

Thanks
 
/opt/sbin/privoxy: can't load library 'libpcre.so.0'

# opkg install --force-reinstall libpcre
Removing package libpcre from root...
Installing libpcre (8.35-3) to root...
Downloading http://entware.wl500g.info/binaries/entware/libpcre_8.35-3_entware.ipk.
wget: can't load library 'libpcre.so.1'
Collected errors:
* opkg_download: Failed to download http://entware.wl500g.info/binaries/entware/libpcre_8.35-3_entware.ipk, wget returned 16.
* opkg_install_pkg: Failed to download libpcre. Perhaps you need to run 'opkg update'?
* opkg_install_cmd: Cannot install package libpcre.
# opkg update
Downloading http://entware.wl500g.info/binaries/entware/Packages.gz.
wget: can't load library 'libpcre.so.1'
Collected errors:
* opkg_download: Failed to download http://entware.wl500g.info/binaries/entware/Packages.gz, wget returned 16.
# opkg install wget
Package wget (1.15-1) installed in root is up to date.
# opkg install --force-reinstall wget
Removing package wget from root...
Installing wget (1.15-1) to root...
Downloading http://entware.wl500g.info/binaries/entware/wget_1.15-1_entware.ipk.
Installing libpcre (8.35-3) to root...
Downloading http://entware.wl500g.info/binaries/entware/libpcre_8.35-3_entware.ipk.
Configuring libpcre.
Configuring wget

opkg install libpcre_8.35-3_entware.ipk
Installing libpcre (8.35-3) to root...
Configuring libpcre.
# /opt/sbin/privoxy
/opt/sbin/privoxy: can't load library 'libpcre.so.0'
 
Last edited:
Issue solved with a symlink:

Code:
# ln -s libpcre.so.1.2.3 libpcre.so.0
# ls -l libpcr*
lrwxrwxrwx    1 admin    root            16 Nov  5 19:34 libpcre.so.0 -> libpcre.so.1.2.3
lrwxrwxrwx    1 admin    root            16 Nov  5 19:25 libpcre.so.1 -> libpcre.so.1.2.3
-rwxr-xr-x    1 admin    root        272244 Oct 15 10:16 libpcre.so.1.2.3
lrwxrwxrwx    1 admin    root            21 Nov  5 19:25 libpcreposix.so.0 -> libpcreposix.so.0.0.2
-rwxr-xr-x    1 admin    root          6212 Oct 15 10:16 libpcreposix.so.0.0.2
 
Thanks, solved my issue
 
Any chance of tweaking the shell scripts to work on the newer ARM based routers (with Optware instead of Entware support)?
 
Any chance of tweaking the shell scripts to work on the newer ARM based routers (with Optware instead of Entware support)?
Shell script can be used on any platform. You need to find privoxy package for ARM platform.
 
Low RAM for Privoxy

Privoxy on N66U gives the "Max connections reached" message quite often. The only thing that has worked somewhat for me so far is the suggestion in http://sourceforge.net/p/ijbswa/feature-requests/571/ . After I set ulimit -s 1024, things seem relatively stable. Is anyone else facing this ? I'm not even using privoxy for ad filtering really. I'm just using it to do some url based forwarding to a parent proxy. Privoxy is probably an overkill for this, but I couldn't find anything simpler. I tried tinyproxy, but that seems slower.
 
D'ya reckon the new ac87u is powerful enough to implement this for the entire network (family home)?
 

Latest threads

Sign Up For SNBForums Daily Digest

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