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?
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Wed Sep 26, 2007 3:53 Post subject:
hello
well, after a couple days of testing, the script has been working like a charm...is very effective...
i have a couple of questions though:
*my router gets the internet from a adsl modem. after, for example, a power outage, the adsl modem takes between 90 and 120 seconds to get a valid ip address from the ISP. By that time, the router has already tried to get the HOSTS file but since there is no internet, the router will have no HOSTS file whatsoever and the ad filter will not work. and i believe, after the adsl modem gets an ip address, the router will not recheck for the hosts file....
Is there any way to delay the script in the router, so it can download the hosts file after a couple minutes???
*using the router's gui or telnet, is there any way to check if the ad filter is working ok??? i dont mean to actually browse the internet and see if the ad's show or not. i mean to just log in to the router's telnet and see if the hosts file is loaded and the router is filtering ad sites...
thanks for the info!
moreins _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod
* Good point. Sure there is a way to make the script to wait some minutes. A count down maybe. There are certainly many ways to implement it, but I'm not able to do it. Maybe some adaption from somewhere...
* I don't know how to see if it's running without seeing if the file has been downloaded or opening the browser to see if it's really working... But wouldn't it be enough??
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Wed Sep 26, 2007 12:45 Post subject:
cyberde wrote:
What about calling the script, created at boot on wanup?
hmmm...nice idea...
you got me on that one though... how do i do that? _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod
*using the router's gui or telnet, is there any way to check if the ad filter is working ok??? i dont mean to actually browse the internet and see if the ad's show or not. i mean to just log in to the router's telnet and see if the hosts file is loaded and the router is filtering ad sites...
moreins
cd /etc
ls -l hosts
this will show the size of the hosts file
tail -n 25 hosts
this will show the last 25 lines of the hosts file
head -n 25 hosts
this will show the first 25 lines of the hosts file
hello
well, after a couple days of testing, the script has been working like a charm...is very effective...
i have a couple of questions though:
*my router gets the internet from a adsl modem. after, for example, a power outage, the adsl modem takes between 90 and 120 seconds to get a valid ip address from the ISP. By that time, the router has already tried to get the HOSTS file but since there is no internet, the router will have no HOSTS file whatsoever and the ad filter will not work. and i believe, after the adsl modem gets an ip address, the router will not recheck for the hosts file....
Is there any way to delay the script in the router, so it can download the hosts file after a couple minutes???
*using the router's gui or telnet, is there any way to check if the ad filter is working ok??? i dont mean to actually browse the internet and see if the ad's show or not. i mean to just log in to the router's telnet and see if the hosts file is loaded and the router is filtering ad sites...
thanks for the info!
moreins
using the script that I posted, change the sleep 5 to sleep 180. (or whatever) this will delay the script from running for 3 min after startup. (the number is in seconds)
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Wed Sep 26, 2007 15:56 Post subject:
moreins wrote:
cyberde wrote:
What about calling the script, created at boot on wanup?
hmmm...nice idea...
you got me on that one though... how do i do that?
Well the script posted by speedy3k, is set as a startup script... This scripts creates /tmp/dlhosts
So all you need to do is enter /tmp/dlhosts in the wanup script in the gui (Administration -> Commands -> Save as firewall script) _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
Posted: Wed Sep 26, 2007 16:13 Post subject: Cron Job
I´m not running DD-Wrt, but a similar one in my Asus.
I use a Cron Job for downloading updated hosts.
It checks each 5´th minute if "hosts" is updated at all,
Update script puts in a unique entry in my host
which will be looked after when check if hosts are updated
if not, it will be updated.
Each week it will be forced updated to keep it up to date
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Wed Sep 26, 2007 16:34 Post subject:
cyberde, speedy3k, HowardZ, thanks for all the info...ill give it a try _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod
I'm still struggling with this. I got it working, but I didn't like the script download every time the router starts. So I changed the script to save the file "hosts" to /mmc, then it survives reboot, but I can't get it working this way. What am I missing?
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:]]*#.*$//' > /mmc/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 "30 6 * * 1 /tmp/dlhosts"
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Fri Sep 28, 2007 13:42 Post subject:
infusion wrote:
cyberde wrote:
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 want to keep "hosts"in /mmc. How can I create a "symbolic link"? And Why to do it, since you can save it directly to the /mmc folder?
You want to do that because you actually need /etc/hosts to contain the information. Since /etc/hosts is a symbolic link to /tmp/hosts you need to create a symbolic link from /tmp/hosts to /mmc/hosts. Otherwise DNSMasq doesn't know where to look ;)
So you could try this:
Code:
rm /tmp/hosts
ln -s /tmp/hosts /mmc/hosts
Note that I havn't tried it yet. _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N