I didn't know about mini_httpd, but AdServer can only run on Windows, so it'll be up to someone else to code a new program.
-----------
Thanks to the mvps hosts file and AdServer, I see that my network tries to load over 20,000 "ads" from 418 hosts every week. (www.google-analytics.com is leader at 3266 hits)
Hopefully, this becomes a part of DD-WRT in the future.
I do hope not.
Some posts ago I wrote that the local hosts file is getting overwritten but somehow nobody cares.
There's no need for selfish scripts on DD-WRT. _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Posted: Sat Sep 06, 2008 13:13 Post subject: Re: This is a 'must have' code for unwanted traffic
kardzzz wrote:
Guys,
My WRT54GL is running DD-WRT v24 RC-5 (11/22/07) std.
I have read through this whole thread and went with the code nick696 posted and it works perfectly.
Full instructions below. I hope he doesn't mind me re-posting.
This is my in the startup section:
Code:
logger WAN UP Script Executing
sleep 5
test -s /tmp/dlhosts
if [ $? == 1 ] ; then
echo -e "#!/bin/sh\nwget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | tr -d '\015\032' | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /tmp/hosts\nlogger DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
chmod 777 /tmp/dlhosts
/tmp/dlhosts
fi
ln -s /tmp/hosts /etc/hosts
echo "45 23 * * 5 root /tmp/dlhosts" >> /tmp/crontab
this is the script in the firewall section:
Code:
/tmp/dlhosts
I have:
1. In Basic Setup.
Use DNSMasq for DHCP - ENABLED
Use DNSMasq for DNS - ENABLED
DHCP-Authoritative - ENABLED
2. In services.
DNSMasq - Enable
Local DNS - Enable
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Tue Sep 09, 2008 7:34 Post subject:
frater wrote:
darthn wrote:
Hopefully, this becomes a part of DD-WRT in the future.
I do hope not.
Some posts ago I wrote that the local hosts file is getting overwritten but somehow nobody cares.
There's no need for selfish scripts on DD-WRT.
It's not overwritten but appended, so that wouldn't cause any problems.
There's is ofcourse the problem that some hosts may be blocked which you don't want to be blocked.
That's why I created my own hosts-file on my webserver where I can remove and add hosts, based on the official one. _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
After I ran the script, none of my local hosts were able to resolve. This corresponds with what I'm reading in the script. _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
I didn't know about mini_httpd, but AdServer can only run on Windows, so it'll be up to someone else to code a new program.
Did you try Pixelserv? It's perl so you can run it either with free version of ActivePerl or compile it with perl2exe. I used v1.0 on Windows but use the one that works best for you.
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Thu Sep 11, 2008 6:38 Post subject:
Has anyone gotten Pixelserv to run on DD-WRT? That would be the ultimate solution ofcourse _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
Posted: Wed Oct 08, 2008 19:59 Post subject: ad block - tried everything
Hey all,
I've read all 12 pages of this topic several times, and have tried everything to no avail. I still have ads and can ping doubleclick.com through telnet. I have some questions that might clear things up for me and some other people who are also still having issues.
First, my specs:
WRT54GS v6 running dd-wrt 2.4sp1 MICRO
Static DNS 1 & 2 - OpenDNS servers
Use DNSMasq for DHCP - Enabled
Use DNSMasq for DNS - Enabled
DHCP-Authoritative - Enabled
So the message from syslogd shows that the script runs, or at least tries to.. there's no error messages in the log, so I'm pretty confused how this works for so many people and yet not for so many others.
Question 1: Does the ad blocking script work on all builds of dd-wrt? If not, which ones are compatible? The micro build has 2 megs of ram, and the mvps hosts file is about 650k.
Question 2: Are there more problems running the script with the sp1 release of 2.4? Some people have said it hasn't worked for them since they upgraded.
Question 3: I don't know much unix. Whats the difference between the two different versions of code posted? One version has "tr -d", another doesn't.
snippet from code 1:
Question 4: For those who use OpenDNS (or another DNS service), are there any settings which need to be different? I've had the WinXP DNS client disabled, since thats being done in the router. But should any setting be different if someone isn't using their default ISP DNS servers?
Thanks in advance. I know not to expect much from the micro builds, but it's worth a shot.
**edit: I found this, which might explain why the script doesn't work with micro version:
Quote:
Micro versions have a stripped down version of BusyBox, so it might not include the ln command
Micro versions also seem to be missing tr, sed, and nget.
Last edited by es1013 on Thu Oct 09, 2008 12:35; edited 2 times in total
Hey all,
I've read all 12 pages of this topic several times, and have tried everything to no avail. I still have ads and can ping doubleclick.com through telnet.
Nothing is blocked with this script. DD-WRT's DNS-server is used to resolve all those nasty hostnames to 0.0.0.0
It will only work if your DD-WRT is your DNS-server
If you can resolve doubleclick.net to 216.73.93.8 then this script is not stopping you to get to them.
Now about this script. It needs just a little modification to work properly, but I'm not going to do it.
/etc/hosts is a symbolic link to /tmp/hosts
This file is filled with all your local hosts.
This file gets overwritten by the file that gets downloaded....
This means /etc/hosts doesn't contain the local hostnames anymore.
I have reported this before, but with a mixture of arrogance and ignorance nothing is done with this info..
The idea is good, but the implementation isn't
A hint.... use >> to concatenate the data to the host and leave out the whole cron-idea... It's just a reasonably static blacklist and it only needs to be freshened on startup, really... _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge