Posted: Mon Feb 16, 2009 18:39 Post subject: ad-blocking with DD-WRT revisited (simple)
I've been asked to start a new thread to get this add-blocking to work.
I will make 2 seperate threads. One thread is a simple one. It will resolve all those nasty domains to an IP of your choice. In my example I will use 0.0.0.0 but you can also change that to an ip on which you have pixelserv running.
I will later make another thread where I'll be using the onboard webserver to answer the webcalls.
sshot-61.png
Description:
Filesize:
8.89 KB
Viewed:
80548 Time(s)
_________________ 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
Joined: 13 Nov 2008 Posts: 5266 Location: CENTRAL Midnowhere
Posted: Mon Feb 16, 2009 21:02 Post subject:
Any limitations to running this? (Will it run on all builds?) What, in idjits terms, does this do? (How does it work?) _________________ Warning: I'm "out of my element!"
http://www.youtube.com/watch?v=MjYJ7zZ9BRw&NR=1
how often does this download the hosts file from the internet?
will it reduce the life of the nvram? (e.g. writing to it with a file every x hours/days/etc) _________________ 2x WRT54G v5, 2x WRT54G v2
1x WRT54G-TM
1x WRT54GL
1x WRT54G2 v1
2x BUFFALO WHR-G54S
2x BUFFALO WHR-G300N v2
1x BUFFLOW WHR-HP-G300N
1x La Fonera
FON Client Bridge tutorial
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.
Freonchill:
If i am reading the code correctly its runs only upon a restart.
Now that those have been answered. The one missing component is getting pixelserv running, unless you like IE telling you the page could not be found. IMO i would rather place a message like blocked by DDWRT, but thats just me.
Edit: Is there anyway or reason why we couldn't configure the DD-WRT web service to use a second IP and link that IP to a different web page other then default, instead have to go through the entire port renaming.
I investigated this already. The http server on DD-WRT binds to all IP-addresses. _________________ 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 investigated this already. The http server on DD-WRT binds to all IP-addresses.
Is there a way to get this changed? One could make the case that if you could have two web services running at the same time, you could make main internal page accessible by LAN only as another level of protection or at least making anyone trying to get access to the router from the outside, have a false lead.
also, i would like to use the hosts file to point to my lanip address port 83 so that i can host a warning page there telling the client that the site was blocked by the router.
i am running httpd on port
80 (normal web server)
81 (management GUI)
82 (accounts)
83 (warning for hosts.txt file)
please give detailed instruction as i am having trouble with this.
You can not use another port. It's merely DNS you are fiddling with. You supply a name to the DNS-server and it responds by giving you an IP. No ports involved.
That's also the reason we are changing the port of the normal webserver in the enhanced script.
It needs to run on port 80 because the websites have links to port 80. _________________ 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 tried this method, but it is not working. the /tmp/hosts file is populated with the websites from the hosts.txt file, but seems like the hosts file is not doing the job. i am still able to open all the banned sites
Maybe you forgot to enable local dns, enable dnsmasq or the dnsmasq option addn-hosts=/tmp/dlhosts?
What happens when you login to your router with ssh or telnet and issue the command nslookup a.abnad.net?
Of course you should use your router as your DNS-server. Check this by doing an nslookup on your local machine or an ipconfig /all
Can someone confirm it does work when following my instructions to the letter? _________________ 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
what i am thinking is that the router is already using the file /tmp/hosts (and /etc/hosts is a link to this file)
if i write all those hosts from hosts.txt to the /tmp/hosts file, shouldnt it work without setting the addn-hosts=/tmp/dlhosts and enabling localdns and without changing the filename to dlhosts.
please let me know if this is possible.
also, would it make a diff. if we are using static dns in the setup section. i am using opendns servers as my static dns servers on a static IP
192.168.6.1 is my router IP running on port 80 where i have a page saying that the site was blocked by our router
i had to disable static dns on the setup page to get this to work. if i use a static dns then it does not work.
You are doing something else and then tell me it isn't working?
I started a totally seperate thread because I totally didn't agree with the code as it was flawed.
Now you are introducing this code in my thread which I wanted to avoid because it confuses people.
Thanks _________________ 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