Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Fri Sep 21, 2007 16:14 Post subject:
Well the script posted by speedy3k works, even when I customised it to my needs.
For the ones that complain it doesn't work. You must be doing something wrong, really :o
I don't think that dnsmasq needs to be restarted right? _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Fri Sep 21, 2007 17:11 Post subject:
Yes, some ads still show up, that's why I'm including my own host-file too :)
The "the page cannot be displayed" problem displays when a website tries to load another website into an iframe, resulting in that error. Other sites, which show ads by the <img> tag give good results.
Now I'm using FF Adblock and this way too, so IE clients have less ads to. _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Sun Sep 23, 2007 2:53 Post subject:
hello
thanks for al the info given...i have some questions, i hope anyone can give me the answers:
1)if i implement this script in my router, would it be the same than having Firefox's Adblock Plus installed on my hosts???
2)should i add the script to the router as a firewall script or a startup script?
3)do i have to reboot the router after i add the script?
4)do i have to enable DNSMasq on the router???
5)i have tried the scripts posted here but i have lots of doubts regarding the code itself? can anyone please post a working script using the code tag?
Code:
code tag
6)when i add the script to the router, the router downloads a txt file of approx. 700KB...where does this file is stored?
thanks in advance...
moreins _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod
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:]]*#.*$//' > /etc/hosts\nlogger DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
chmod 777 /tmp/dlhosts
/tmp/dlhosts
fi
cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
now to answer some of your questions
1. no..this does not work the same as firefox ad blocker. this will work with any browser since the ads (on the list) are being blocked at the router.
2. I have mine saved as a startup script
3. I do
4. yes..DNSMasq and Local DNS should be enabled
5. done...just copy and paste
6. its stored in the tmp folder as "hosts"
maybe some questions you thought of, but didn't ask
7. the cru job runs at 23:45 on friday to update the list. you can change that to whatever you want. the spot for 45 = min, 23 - hour and 5 =day of week (sun=0 Friday-5)
8. if you want to use a list from somewhere else, just change the url in the script.
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Sun Sep 23, 2007 18:17 Post subject:
dude, thanks a lot for all your help...im gonna give it a try as soon as i get home tonight...thanks a lot
i hav one last question....i already have a startup script running in my router...i was wondering how do i handle multiple startup scripts? do i just leave an empy line and add the other script or what???
another thing: regarding your script. are these 2 lines necessary???
Code:
logger WAN UP Script Executing
sleep 5
thanks again _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod
yeah...just add it to the next line.
as far as the two lines...1 is to add an entry to the log, the other just waits before starting the script for a few seconds before running the rest of the script. they don't hurt anything. I would leave them in, so if you ever enable syslog, you can see that the command are being ran.
I have a 16mb model with v24vpn installed. I don't have much free memory at the moment (around .5 to .. Am I correct in assuming that I can't do this? Any alternative ways of doing it?
I have a 16mb model with v24vpn installed. I don't have much free memory at the moment (around .5 to .. Am I correct in assuming that I can't do this? Any alternative ways of doing it?
You should go ahead and give it a try. it might work for you. worse thing that will happen is the file will be to large and wont download.
i may next weekend when I have some downtime (in case it does blow something up). I checked the file from that website and it was larger than the lowest free memory that I normally have...
guess i can always look for other services to disable?
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Mon Sep 24, 2007 9:17 Post subject:
You can also save the hosts file on, let's say an SD card and create an symbolic link in /tmp/hosts to /mmc/etc/hosts for example... Should work... _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
You can also save the hosts file on, let's say an SD card and create an symbolic link in /tmp/hosts to /mmc/etc/hosts for example... Should work...
I had that thought as well. Didn't know what kind of performance hit it would be though, since every connection is checked against the file and since the SD card is noticably slower than ram. Also, I haven't seen instructions for the G125. I could also use a network share I assume?