Adblock for DD-WRT (version 2)

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Goto page Previous  1, 2, 3 ... 18, 19, 20, 21  Next
Author Message
boprah
DD-WRT Novice


Joined: 15 Mar 2020
Posts: 2

PostPosted: Sun Mar 15, 2020 18:32    Post subject: Reply with quote
After installing to the USB and running the script, I get stuck at this line:

Code:
Processing final mphosts/mpdomains files


PuTTY seems to freeze here and WinSCP throws up a "Host is not communicating for more than 15 seconds..." error.

Any advice? Thanks in advance!
Sponsor
0Legolas0
DD-WRT Novice


Joined: 14 Jan 2018
Posts: 16

PostPosted: Sun Mar 15, 2020 19:18    Post subject: Reply with quote
Hi Yamaraj
Have not checked your wonderful thread for a while, as things have been humming along well Smile. I was contemplating switching to Pi-hole as I heard that it can help filter YouTube videos too. Do you support or plan to support adblock.sh to block YouTube videos? Or the router CPUs cannot handle this?

https://forums.unraid.net/topic/84331-finally-a-way-to-block-youtube-ads-via-pihole-work-in-progres/

Note: This is not working on Pi-Hole either, I wanted to check if even if some basic blocking is possible.

Thanks in advance.

Yamaraj wrote:
joedow wrote:
Hi Yamaraj, good work andnplease keep it up.

Can you tell me if this list from easylist.to is
added to your adblock?
Or if i make a blacklist out of it will it work?

This script, like Pi-Hole and others, operates at domain level not on page elements and as such cannot use those lists. Although quite effective, it cannot block 100% of ads, especially those leveraging browser features like Javascript, frames etc. For that adding another layer of protection like uBlock Origin is recommended.

I recommend this script or Pi-Hole on your network anyway as not all devices have access to browser-level blocking. Besides, since this operates at network level, requests other than browsers are blocked as well.
Dr_K
DD-WRT User


Joined: 23 Mar 2018
Posts: 442

PostPosted: Mon Mar 16, 2020 13:11    Post subject: Reply with quote
boprah wrote:
I get stuck at this line:

Code:
Processing final mphosts/mpdomains files


That is NOT stuck....
It is doing what it says it is..."Processing"

It can take anywhere from a couple to 20 or more minutes to "process" depending on your chosen protection level & the hardware you are running it on....
Neither of which you have divulged, let alone firmware version...

boprah wrote:
PuTTY seems to freeze here and WinSCP throws up a "Host is not communicating for more than 15 seconds..." error.

Use Putty itself...
Not the one bundled into WinSCP...as it has limitations ¯\_(ツ)_/¯

_________________
Location 1
R6300V2- DD-WRT v3.0-r39345M kongac (04-03-19) Gateway
WNDR3400v1 DD-WRT.v3.0-r35531_mega-nv64k (03/26/18 ) Access Point
WRT160Nv3 DD-WRT ?v3?.0-r35531 mini (03/26/18 ) Access Point
WRT54GSv5 DD-WRT v24-r33555_micro_generic (10/20/17) Repeater
Location 2
R6300V2- DD-WRT v3.0-r39345M kongac (04/03/19) Gateway
R6300V2- DD-WRT v3.0-r39345M kongac (04/03/19) Access Point
WNDR3700v2 DD-WRT v3.0-r35531 std (03/26/18 ) Access Point
E1200 v2 DD-WRT v3.0-r35531 mega-nv64k (03/26/18 ) Gateway(for trivial reasons)
2 devices: SXT 5 ac (mipsbe) RB 6.46.4 (2/21/20) PTP Bridge (0.8km/0.5mi)tx/rx866.6Mbps-1GbpsLAN


Thank You BrainSlayer & <Kong> for ALL that you do & have done, also to "most" everyone here that shares their knowledge
boprah
DD-WRT Novice


Joined: 15 Mar 2020
Posts: 2

PostPosted: Mon Mar 16, 2020 23:14    Post subject: Reply with quote
Dr_K wrote:
boprah wrote:
I get stuck at this line:

Code:
Processing final mphosts/mpdomains files


That is NOT stuck....
It is doing what it says it is..."Processing"

It can take anywhere from a couple to 20 or more minutes to "process" depending on your chosen protection level & the hardware you are running it on....
Neither of which you have divulged, let alone firmware version...

boprah wrote:
PuTTY seems to freeze here and WinSCP throws up a "Host is not communicating for more than 15 seconds..." error.

Use Putty itself...
Not the one bundled into WinSCP...as it has limitations ¯\_(ツ)_/¯


Thank you! I left it for five minutes and it finished up.

However, my next issue is that I seem to lose all internet connection once the router has rebooted after finalizing the Adblock setup. No websites are accessible and Windows and Mac show No Internet Connection. If I remove the Dnsmasq options and reboot, the connection is re-established. The same thing happened using this script.

Router is Netgear R7000 with DD-WRT v3.0-r42681.
Moose
DD-WRT Novice


Joined: 03 May 2008
Posts: 7

PostPosted: Sat Mar 21, 2020 19:50    Post subject: curl errors Reply with quote
Yamaraj,

I had your old version running fine but when I upgrade to your new version of Adblock for DD-WRT I'm getting two entries stating
curl: (22) The requested URL returned error: 404 Not Found

Further down the list I get another stating:
curl: (7) Couldn't connect to server

I'm not sure what causing this or what these entries mean so hoping you could help me out.

I'm running KONG's Firmware: DD-WRT v3.0-r39855M std (05/25/19) on my NETGEAR Nighthawk X10 R9000.

Thank you
Moose
underdose
DD-WRT Novice


Joined: 12 Jun 2019
Posts: 20

PostPosted: Wed Mar 25, 2020 6:50    Post subject: Reply with quote
0Legolas0 wrote:
Hi Yamaraj
Have not checked your wonderful thread for a while, as things have been humming along well Smile. I was contemplating switching to Pi-hole as I heard that it can help filter YouTube videos too. Do you support or plan to support adblock.sh to block YouTube videos? Or the router CPUs cannot handle this?

https://forums.unraid.net/topic/84331-finally-a-way-to-block-youtube-ads-via-pihole-work-in-progres/

Note: This is not working on Pi-Hole either, I wanted to check if even if some basic blocking is possible.

Thanks in advance.


It is not the CPU's, routers are not able to separate ads from videos on YouTube since they are both served from the same domain and every ad-blocking solution running on routers (or Pi-Hole) is based on domain blocking by host files. To be able to block YouTube ads, you need to use a browser extension.
joedow
DD-WRT Novice


Joined: 11 Feb 2018
Posts: 40

PostPosted: Wed Mar 25, 2020 10:57    Post subject: Reply with quote
Old version is not working anymore? im noticing a lot more ads on my home network, or maybe is just me..
New version in installable already? (gave some strange error
with config or smth)

Update: i had to delete and rebuild/generate again. Now its working
madhits45
DD-WRT User


Joined: 20 Apr 2009
Posts: 69

PostPosted: Thu Mar 26, 2020 17:05    Post subject: Re: Why so complicated? Reply with quote
tweakradje wrote:
I only use these 3 lines in startup for blocking:


sleep 20

# get hosts file with unix EOL
wget -qO- http://www.mvps.org/winhelp2002/hosts.txt|grep "^0.0.0.0" >> /tmp/hosts

# re-read hosts file
killall -HUP dnsmasq

together with dnsmasq as local dns and dhcp. You can use any inet hosts file you like of course. Disadvantage of hosts is it need to be hosts not domains. As extra I use the dnsmasq option field. I list the domains like:


domain-needed
bogus-priv
no-negcache
address=/2mdn.net/0.0.0.0
address=/2o7.net/0.0.0.0
address=/360yield.com/0.0.0.0
address=/ad-center.com/0.0.0.0
address=/ad-inside.com/0.0.0.0
address=/adbrite.com/0.0.0.0
address=/adinfuse.com/0.0.0.0
address=/admob.com/0.0.0.0
address=/admob.mobi/0.0.0.0
...


Can you explain what your method does more?

Cheers


Thank you for posting this, this is a lil more then I do, so I plan to update mine. THANKS
0Legolas0
DD-WRT Novice


Joined: 14 Jan 2018
Posts: 16

PostPosted: Fri Mar 27, 2020 18:40    Post subject: Reply with quote
underdose wrote:


It is not the CPU's, routers are not able to separate ads from videos on YouTube since they are both served from the same domain and every ad-blocking solution running on routers (or Pi-Hole) is based on domain blocking by host files. To be able to block YouTube ads, you need to use a browser extension.


Thanks. I ended up w/ same conclusion on further reading. So, Pi-Hole can wait for now Very Happy
madhits45
DD-WRT User


Joined: 20 Apr 2009
Posts: 69

PostPosted: Sat Apr 04, 2020 21:49    Post subject: Re: Why so complicated? Reply with quote
madhits45 wrote:
tweakradje wrote:
I only use these 3 lines in startup for blocking:


sleep 20

# get hosts file with unix EOL
wget -qO- http://www.mvps.org/winhelp2002/hosts.txt|grep "^0.0.0.0" >> /tmp/hosts

# re-read hosts file
killall -HUP dnsmasq

together with dnsmasq as local dns and dhcp. You can use any inet hosts file you like of course. Disadvantage of hosts is it need to be hosts not domains. As extra I use the dnsmasq option field. I list the domains like:


domain-needed
bogus-priv
no-negcache
address=/2mdn.net/0.0.0.0
address=/2o7.net/0.0.0.0
address=/360yield.com/0.0.0.0
address=/ad-center.com/0.0.0.0
address=/ad-inside.com/0.0.0.0
address=/adbrite.com/0.0.0.0
address=/adinfuse.com/0.0.0.0
address=/admob.com/0.0.0.0
address=/admob.mobi/0.0.0.0
...


Can you explain what your method does more?

Cheers


Thank you for posting this, this is a lil more then I do, so I plan to update mine. THANKS


Actually this is still the best of the simple scripts.

Startup Script:
_rogue=0.0.0.0
echo -e "n=1\nwhile ! wget -q -O /tmp/hsts http://sbc.io/hosts/hosts ; do\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\n\tsleep 60\ndone\ngrep \"^0.0.0.0\" /tmp/hsts | grep \"^0.0.0.0\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >/tmp/dlhosts\nrm /tmp/hsts\nkillall -HUP dnsmasq" >/tmp/wh
sh /tmp/wh &

Additional DNSMasq Options:
addn-hosts=/tmp/dlhosts

Additional Cron Jobs:
0 12 * * * root /tmp/.rc_startup
Yamaraj
DD-WRT User


Joined: 25 Jan 2017
Posts: 110

PostPosted: Tue Apr 07, 2020 8:39    Post subject: Reply with quote
20200407:
Bug fixes. Scroll down for details.
Hosts-file.net (Malwarebyes) lists are no longer updated or even available. Removed from the script.
Added another list to BLITZ=3 level.

Old and new, both versions have been updated.

How to install/upgrade:
SSH into router
cd /jffs/dnsmasq
curl -o adblock.sh adblock.sh (or wget -O adblock.sh adblock.sh)
chmod + adblock.ah

Then follow instructions in the original post to set up dnsmasq and cron.

adbhostgen (old version) is still functional and will remain so for a while. No new features will be added to this, so I recommend that you upgrade and change "adbhostgen.sh" to "adblock.sh" on all the relevant config pages.




awpfab wrote:
FINAL Update: I re-ran the adblock.sh script and it appears it was not completing correctly due to an issue with curl. After getting entware installed, then curl installed, I re-ran the script and can see that it runs more completely. The network appears to now work.

Glad to hear it.

joedow wrote:
when trying to run updated version i get this:

adblock.sh: line 696: tee: not found

EDIT:
i updated adbhostgen.sh and after run it and it is working.

adblock.sh gives the error code (smth with logfile)

Strange that such a small utility as tee is not available on some firmware. Rolled back to not using tee. Not a very elegant solution, but what can you do!

Dr_K wrote:

The pause function does not appear to fully disable the script
I did clear browser cache & cookies, even rebooted pc
Nor is running the -p or -r options reflected in the script's log


1 complaint..

I would prefer the script's log to amended itself, like your last script (adbhostgen.sh) did.
Rather than overwriting the log every time the script runs?

Logging should be fixed. See above. Let me know about the pause/resume functionality.

Moose wrote:
Yamaraj,

I had your old version running fine but when I upgrade to your new version of Adblock for DD-WRT I'm getting two entries stating
curl: (22) The requested URL returned error: 404 Not Found

Further down the list I get another stating:
curl: (7) Couldn't connect to server

I'm not sure what causing this or what these entries mean so hoping you could help me out.

I'm running KONG's Firmware: DD-WRT v3.0-r39855M std (05/25/19) on my NETGEAR Nighthawk X10 R9000.

Thank you
Moose

Should be fixed. If not, provide a more detailed info and a screenshot if possible.

_________________

Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)

Scripts
Adblock.sh on DD-WRT (v2) -- Github | Website
Ad-blocking on DD-WRT (v1) -- Github
Jay461
DD-WRT Novice


Joined: 18 Jul 2018
Posts: 35
Location: Texas

PostPosted: Wed Apr 08, 2020 16:57    Post subject: HBOGO app on Roku player Reply with quote
@Yamaraj appreciate all the work you have put in including your quick and detailed response.

I am a novice but after some trial and error I was able to implement your adblock last night successfully (I think). Since I use windows 10, I used WinSCP through out.

Question: The HBOGO app on my Roku player (connected to old Samsung smart TV) does not work/play. Although, Netflix, Prime etc. are fine.

Can you or any of the experts assist with this issue? TIA
Jay461
DD-WRT Novice


Joined: 18 Jul 2018
Posts: 35
Location: Texas

PostPosted: Thu Apr 09, 2020 16:43    Post subject: Reply with quote
=RESOLVED=

I was able to get HBOGO working again by whitelisting telegraph.api.hbo.com

Code

./adbhostgen.sh --wl=telegraph.api.hbo.com
Moose
DD-WRT Novice


Joined: 03 May 2008
Posts: 7

PostPosted: Fri Apr 10, 2020 17:31    Post subject: curl: (28) Connection timed Reply with quote
Yamaraj,

I tried the new VERSION: 20200407 on the the old Kong Firmware: DD-WRT v3.0-r39855M std (05/25/19) and still had the problom curl: (2Cool. Since Kong stopped doing DD-WRT Firmware I switched over to Firmware: DD-WRT v3.0-r40559 std (08/06/19) thinking maybe this would fix it but still getting: curl: (2Cool Connection timed out after 300469 milliseconds.

I'm a NOOB to all this so sorry for the question just not sure what the curl does. I've attached a pictures.

Thank you for all your help.
Moose



20200410_131313.jpg
 Description:
 Filesize:  429.46 KB
 Viewed:  6438 Time(s)

20200410_131313.jpg



20200410_131351.jpg
 Description:
 Filesize:  481.79 KB
 Viewed:  6438 Time(s)

20200410_131351.jpg


kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 7209
Location: Texas, USA

PostPosted: Fri Apr 10, 2020 18:26    Post subject: Reply with quote
@ Moose: I re-sized your pictures. Per forum rules and guidelines:

When posting pictures, please make sure the maximum width is not more than 800 pixels. 800x600 or 600x800 is ideal. You can also upload your image to an image hosting site and link the image in your post and the forum software will automatically re-size it so it doesn’t skew the forum page format.

_________________
Official Forum Rules, Guidelines, and Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware?
DON'T use Chromium-based browsersRTFM/STFW - TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is?
Please DO NOT PM me with questions; Ask in the forum.

---------------------------------------------------------

Linux User #377467 counter.li.org / linuxcounter.net
Goto page Previous  1, 2, 3 ... 18, 19, 20, 21  Next Display posts from previous:    Page 19 of 21
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum