ad-blocking with DD-WRT revisited (simple)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 10, 11, 12, 13, 14  Next
Author Message
Zaf0d
DD-WRT Novice


Joined: 11 Jul 2015
Posts: 8

PostPosted: Mon Jul 13, 2015 13:11    Post subject: Reply with quote
Sorry for the 'noobie' question guys. Embarassed

But is this code specific to Broadcom routers or will it work on a D-Link DIR 615 too?
Sponsor
ironmanlok
DD-WRT User


Joined: 16 Jul 2012
Posts: 59

PostPosted: Tue Jul 14, 2015 11:09    Post subject: Reply with quote
Depends more on the build (micro, mega, etc) you're using than on chipset.

The size of file you flashed on your router is a good indication if certain commands used on those scripts are available.

I've been able to run those scripts on a WNDR3700 v2 (atheros), which is a 8mb build, but had to rely on AWK. Now with R7000 I can use sort instead.

As a side note, since lots of people made their own versions of this script, I decided to share mine. Suggestions and critiques are welcome, specially on regex side, since it's not my forte.



gen_host.sh.txt
 Description:

Download
 Filename:  gen_host.sh.txt
 Filesize:  6.13 KB
 Downloaded:  1423 Time(s)

velos73
DD-WRT Novice


Joined: 21 Aug 2015
Posts: 8

PostPosted: Mon Sep 14, 2015 16:21    Post subject: Not working on Netgear 4300 v3.0-r27745 Reply with quote
Im new to Ad block scripting...
Iwas trying scripts but nothing runs .. dono why
I have my wan to static but i have Inet .. what im missing ?? --- Netgear 4300 v3.0-r27745

Thank you

FrancYescO wrote:
My "revision"

Code:
while ! ping 8.8.8.8 -c 1 > /dev/null ; do
logger "waiting for the internet connection to come up for starting ad-blocking script..."
sleep 5
done
echo -e "#!/bin/sh\n\twget -O - 'http://www.mvps.org/winhelp2002/hosts.txt' 'http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext' 'http://adblock.gjtech.net/?format=hostfile' 'http://www.malwaredomainlist.com/hostslist/hosts.txt' 'http://someonewhocares.org/hosts/zero/hosts' | grep -E '127.0.0.1|0.0.0.0' | sed '2,\$s/127.0.0.1/0.0.0.0/g; s/[[:space:]]*#.*$//g;' | grep -v localhost | tr ' ' '\\\t' | tr -s '\\\t' | tr -d '\\\015' | sort -u >/tmp/dlhosts\nkillall -HUP dnsmasq" >>/tmp/write_dlhosts.sh
chmod +x /tmp/write_dlhosts.sh
/tmp/write_dlhosts.sh &
seanvree
DD-WRT User


Joined: 09 Sep 2015
Posts: 92

PostPosted: Tue Sep 15, 2015 2:09    Post subject: Reply with quote
I followed all the steps on

http://www.dd-wrt.com/wiki/index.php/Ad_blocking

And I get to the very last step, in TELNET I type:

dnsmasq --conf-file=/tmp/dnsmasq.conf --addn-hosts=/tmp/hosts

I get this error: "Failed to bind DHCP server socket: Address in use".

what am I doing wrong?
seanvree
DD-WRT User


Joined: 09 Sep 2015
Posts: 92

PostPosted: Tue Sep 15, 2015 2:20    Post subject: Reply with quote
Oldschool2012 wrote:
calee4nyaboy wrote:
MKruer wrote:
Donny:
This should run on all builds.
What is does is takes any request from a system and checks it against the list of URLS. If the URL matches, it returns the IP 0.0.0.0 instead of passing it though and getting the ad.


This is incorrect information. It does NOT run on micro builds. Runs on mini or standard.


The Wiki has been updated with new instructions on ad-blocking with the DD-WRT Micro build.

http://www.dd-wrt.com/wiki/index.php/Ad_blocking#Ad_Blocking_with_Micro_build

Sorry for the late bump, but I came across this posting while searching for information on Micro build ad-blocking. (I'm stuck with a WRT54Gv2.)


what is "CRON"?
velos73
DD-WRT Novice


Joined: 21 Aug 2015
Posts: 8

PostPosted: Tue Sep 15, 2015 5:49    Post subject: Reply with quote
I test it,
first time running from telnet,
the automatic creation of the Dnsmasq didnt work so
I copy paste the addn-hosts=/tmp/hosts0
@ Services Tab -> Additional DNSMasq Options
and it worked..

Cron...

Administrator -> Router Management -> Additional Cron Jobs

Paste there = 0 12 * * * root /tmp/.rc_startup

and voila Smile all good with auto update

seanvree wrote:
Oldschool2012 wrote:
calee4nyaboy wrote:
MKruer wrote:
Donny:
This should run on all builds.
What is does is takes any request from a system and checks it against the list of URLS. If the URL matches, it returns the IP 0.0.0.0 instead of passing it though and getting the ad.


This is incorrect information. It does NOT run on micro builds. Runs on mini or standard.


The Wiki has been updated with new instructions on ad-blocking with the DD-WRT Micro build.

http://www.dd-wrt.com/wiki/index.php/Ad_blocking#Ad_Blocking_with_Micro_build

Sorry for the late bump, but I came across this posting while searching for information on Micro build ad-blocking. (I'm stuck with a WRT54Gv2.)


what is "CRON"?
seanvree
DD-WRT User


Joined: 09 Sep 2015
Posts: 92

PostPosted: Tue Sep 15, 2015 5:59    Post subject: Reply with quote
[quote="velos73"]

Cron...

Administrator -> Router Management -> Additional Cron Jobs

Paste there = 0 12 * * * root /tmp/.rc_startup

and voila Smile all good with auto update

[quote="seanvree"]
Oldschool2012 wrote:

what is "CRON"?



Thanks!
drdedus
DD-WRT User


Joined: 31 Dec 2013
Posts: 171
Location: Greece

PostPosted: Thu Sep 17, 2015 8:57    Post subject: Reply with quote
which is the best instructions I have to follow for ad blocking?
if it has to do my router is tplink 3600.
halomaster
DD-WRT Novice


Joined: 16 Oct 2014
Posts: 9

PostPosted: Thu Oct 01, 2015 13:38    Post subject: Reply with quote
I have a Netgear R7000 with DD-WRT build 27775M.

I followed the directions on https://www.dd-wrt.com/wiki/index.php/Ad_blocking to a T. From the web GUI:
1. I inputted the startup script.
2. I enabled cron and inputted its script
3. I enabled DNSMasq and Local DNS. The remaining 3 options stayed disabled.
4. I rebooted the router.

I disabled my browser adblocker, then I went on neowin.net and the ads are still there! Am I missing something?
GDixon
DD-WRT Novice


Joined: 24 Mar 2009
Posts: 10

PostPosted: Mon Dec 21, 2015 22:22    Post subject: just an update Reply with quote
Wow,

Frater I have been running your original ad redirect for literally years now and it has always worked well. It always helped relieve some of the work for the firefox ad block.

Sadly last week the original wrt-g finally fried lol
I went to the basement and found I had squirreled a couple away brand new in the box. I forgot I had them so I fixed them with dd-wrt and your code once again and yes it all works as it always has.

I have made the move to (blush) purchase some new updated N netgear equip and have one TP_link I'm playing with. But then the 2 wrt-g's I pulled from the basement may last another 8 yrs or more Smile

Thanks for the efforts you made! The code is still working well.

Greg
time2kill
DD-WRT Novice


Joined: 04 Jan 2016
Posts: 1

PostPosted: Mon Jan 04, 2016 23:39    Post subject: Frater where are you? Reply with quote
Have you abandoned this thread? Thanks for your hard work and time.
mbmalone
DD-WRT Novice


Joined: 20 Dec 2008
Posts: 23

PostPosted: Thu Jan 21, 2016 23:50    Post subject: Reply with quote
Does anybody have an updated or alternative version of ironmanlok's "gen_host.sh.txt" [Adblocking Script]

I did get it to work once, but I think there is something wrong with the script it keeps blocking my router or the wireless at least, upon bootup. I don't know why irongeeks script had no issues, but was stored in jffs.

I want blocked domain lists stored in /tmp not stored in /jffs. My router doesn't have USB, either. I also thought to add pixelserv to avoid errors. I only want jffs2 to store the scripts.

thx ...

_________________
Linksys E1200 v2 - DD-WRT v3.0-r28882 mini
Netgear WNR2000v3 - DD-WRT v3.0-
jmgraves8
DD-WRT Novice


Joined: 02 Jun 2016
Posts: 3

PostPosted: Thu Jun 02, 2016 21:41    Post subject: Reply with quote
I can't block ads at all on my Linksys WRT54G v8 router with DD-WRT v24 RC-5 (11/22/07) micro. Both DNSMasq and Local DNS are enabled, and additional options and startup commands were input properly. I rebooted the router and ran nslookup on something that should be blocked (fr.a2dfp.net), yet I'm getting a valid IP back, not 0.0.0.0. This occurs on all test sites I type in.
blaser
DD-WRT Guru


Joined: 16 Jul 2006
Posts: 525

PostPosted: Fri Jun 03, 2016 2:36    Post subject: Reply with quote
jmgraves8 wrote:
I can't block ads at all on my Linksys WRT54G v8 router with DD-WRT v24 RC-5 (11/22/07) micro. Both DNSMasq and Local DNS are enabled, and additional options and startup commands were input properly. I rebooted the router and ran nslookup on something that should be blocked (fr.a2dfp.net), yet I'm getting a valid IP back, not 0.0.0.0. This occurs on all test sites I type in.


Micro build doesn't have all the commands needed to run this utility.
Log in to the router, go to /tmp and look for the script, then run it, you will see the error messages

_________________
Netgear R9000 main router
RAX80 as AP
jmgraves8
DD-WRT Novice


Joined: 02 Jun 2016
Posts: 3

PostPosted: Fri Jun 03, 2016 14:25    Post subject: Reply with quote
blaser wrote:
jmgraves8 wrote:
I can't block ads at all on my Linksys WRT54G v8 router with DD-WRT v24 RC-5 (11/22/07) micro. Both DNSMasq and Local DNS are enabled, and additional options and startup commands were input properly. I rebooted the router and ran nslookup on something that should be blocked (fr.a2dfp.net), yet I'm getting a valid IP back, not 0.0.0.0. This occurs on all test sites I type in.


Micro build doesn't have all the commands needed to run this utility.
Log in to the router, go to /tmp and look for the script, then run it, you will see the error messages


So is there any way I can get this router to do what I'd like? Do I need to flash a different DD-WRT?
Goto page Previous  1, 2, 3 ... 10, 11, 12, 13, 14  Next Display posts from previous:    Page 11 of 14
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware 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