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.
Posted: Mon Sep 14, 2015 16:21 Post subject: Not working on Netgear 4300 v3.0-r27745
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 &
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.
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 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.
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?
Posted: Mon Dec 21, 2015 22:22 Post subject: just an update
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
Thanks for the efforts you made! The code is still working well.
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.
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.
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
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?