ad-blocking with DD-WRT revisited (simple)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 8, 9, 10 ... 12, 13, 14  Next
Author Message
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Thu Mar 31, 2011 2:51    Post subject: Reply with quote
I must be doing some thing wrong .. with this setup, I can't bring up maps.google.com or the maps from bing.com.

To level set, here are the steps I followed.

1. Make sure OPTWARE is installed on the router.

2. On the ‘Services|Services’ page, enable the DNSMasq and add information as follows. Click ‘Save Changes’ when done.
DNSMasq: Enable
Local DNS: Enable
No DNS Rebind: Enable
Additional DNSMasq Options: addn-hosts=/tmp/dlhosts

3. On the ‘Administration|Commands’ page, save the following code in the ‘Command Shell’ box. Click ‘Save Startup’.
#
# Simple ad-blocking
#
_rogue=127.0.0.1
echo -e "n=1\nwhile ! wget -q -O /tmp/hsts http://www.mvps.org/winhelp2002/hosts.txt ; do\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\n\tsleep 60\ndone\ngrep \"^127.0.0.1\" /tmp/hsts | grep \"^127.0.0.1\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >/tmp/dlhosts\nrm /tmp/hsts\nkillall -HUP dnsmasq" >/tmp/wh
sh /tmp/wh &

4. Start a telnet session on the Router
5. Login with the ‘root’ credentials
6. Enable the ‘pixelserv’ OPTWARE service by entering the following commands at the prompt.

service pixelserv on
service pixelserv start

7. Reboot the Router.

Stopping the pixelserv service, seems to clear things up.

The laptop that I am using for the test has a wireless connection with a WRT610N which is a configured as a repeated bridge to the E3000 from my earlier post. The fw build on the WRT610N is the same as the E3000. OPTWARE is installed on the E3000 only. The following should help.

E3000 <- WiFi 5GHz RB -> WRT610N <- WiFi 2.4 GHz -> Test Laptop (Windows 7)

Am I doing something wrong? If you need any diagnostic information from me, let me know.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
Sponsor
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Sat Apr 02, 2011 23:00    Post subject: Reply with quote
bump .. anyone with the hanging/performance issues ?
_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
jumran
DD-WRT User


Joined: 31 Jul 2009
Posts: 492
Location: Toronto, ON, CA

PostPosted: Sun Apr 03, 2011 0:31    Post subject: Reply with quote
I have encountered hanging/performance issues with the optware version of the same script. Frater can't seem to determine exact cauuse of the issue.

ndewan wrote:
bump .. anyone with the hanging/performance issues ?

_________________
Asus RT-N16 [Build King Kong 18050M NEWD-2 K2.6 + Optware + My Page] Mr. Green
Masterman
DD-WRT Guru


Joined: 24 Aug 2009
Posts: 2070
Location: South Florida

PostPosted: Sun Apr 03, 2011 2:26    Post subject: Reply with quote
Pandora is blocked by this script (on smart-phones only so far).

Oh well, I guess I'll just use my unlimited 3G data plan.. Cool

_________________
Optware, the Right Way
Asus RT-AC68U
Asus RT-N66U
Asus RT-N10
Asus RT-N12
Asus RT-N16 x5
Asus WL520gU
Engenious ECB350
Linksys WRT600Nv1.1
Linksys WRT610Nv1
Linksys E2000
Netgear WNDR3300
SonicWall NSA220W
SonicWall TZ215W
SonicWall TZ205W
SonicWall TZ105W
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Sun Apr 03, 2011 23:49    Post subject: Reply with quote
I don't think Pandora is the problem, I think there is a site that Pandora invokes that might be blocked and there is something in the script that stops the processing for the rest of the page.

In my tests, i have noticed that as soon as I stop pixelserv, some level of normalcy returns.

For now I have reverted to using IEPro and Adblock on the browsers. That said, I am willing to test, if there are any suggestions.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
speedy71471
DD-WRT User


Joined: 13 Aug 2008
Posts: 248

PostPosted: Tue Apr 05, 2011 21:44    Post subject: Reply with quote
The problem I am running up against is I just don't have enough NVRAM to store the additional startup script. Frater, is there any way to relocate these startup scripts to somewhere on /opt, that way it would not impose an "nvram penalty"? Ideally, things should really be implemented as your services.

These big startup scripts and firewalls scripts... those strings are read exactly once from nvram in a given session. But they occupy space for the entire session.

I know examining efficiency on that level may seem anal, but unfortunately dd-wrt doesn't manage nvram well, and running out of it is really bad.

-SS

_________________
Linksys WRT600N v1.1 16758M NEWD Eko mini-usb-ftp (AP) (OTRW)
Linksys E2000 16758M NEWD-2 K.26 Eko mini (repeater bridge) (on 5GHz)
hugo19941994
DD-WRT Novice


Joined: 21 Jun 2011
Posts: 3

PostPosted: Sat Jul 23, 2011 7:42    Post subject: Reply with quote
Thanks for this! I can confirm its working 100% smoothly on my setup, and on all my devices!
rmur
DD-WRT Novice


Joined: 07 Sep 2011
Posts: 1

PostPosted: Thu Sep 08, 2011 15:29    Post subject: Linksys E2000/ adblock Reply with quote
I am using linksys E2000 on dd-wrt. Adblock is not working with following settings

1. DNSMasq and Local DNS are enabled with Additional DNSMasq options 'addn-hosts=/tmp/dlhosts'.

2. Saved following script at startup.

_rogue=0.0.0.1
echo -e "#!/bin/sh\nn=1\nwhile sleep 60\ndo\n\twget -q -O - http://www.mvps.org/winhelp2002/hosts.txt | grep \"^127.0.0.1\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >/tmp/dlhosts\n" >/tmp/write_dlhosts
echo -e "\t[ \`grep -il doubleclick /tmp/dlhosts\` ] && break\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\ndone\nkillall -HUP dnsmasq" >>/tmp/write_dlhosts
chmod +x /tmp/write_dlhosts
/tmp/write_dlhosts &

After rebooting the router, "nslookup admarket.cz" shows original ip address not 0.0.0.0.

Anyhelp will be really appreciated.
biooya
DD-WRT Novice


Joined: 07 Jul 2009
Posts: 24

PostPosted: Tue Sep 20, 2011 20:12    Post subject: Reply with quote
I've been using the script for a long time now and its been working fine. I haven't changed anything in the router. Over the last few days it hasn't been working. I tried rebooting a few times to update the block list, but no improvement.


Netgear WNDR3700 v2
Firmware Version DD-WRT v24-sp2 (04/13/11) std - build 16785
zoomlink
DD-WRT User


Joined: 08 May 2011
Posts: 221

PostPosted: Wed Sep 21, 2011 20:49    Post subject: Reply with quote
You need to edit the script (/opt/etc/init.d/S45pixelserv) and change line 92 (or there about) to read:

url=http://winhelp2002.mvps.org/hosts.txt

Delete your blacks file, stop and start the service. This should fix you.
KALIROB2K6
DD-WRT User


Joined: 29 Sep 2008
Posts: 127

PostPosted: Sun Sep 25, 2011 10:04    Post subject: Reply with quote
I just found this topic Shocked, hopefully the issues are easily figured out; as this sounds amazing. I'm super hyped there's an adblocker pretty much built in router side with this.
Since assisting in this is beyond my skill set, I want to say thanks in the mean time heh.
Thinking of trying this on my WRT150N and WRT600N in the mean time, suggestions on what I need to enable or disable to avoid issues? Much appreciated. >_>b
zoomlink
DD-WRT User


Joined: 08 May 2011
Posts: 221

PostPosted: Tue Sep 27, 2011 15:01    Post subject: Reply with quote
@KALIROB2K6

I would imagine you can run pixelserv on your WRT600N if you have an external usb storage device and installed Optware TRW (http://dd-wrt.com/wiki/index.php/Optware%2C_the_Right_Way).

On the WRT150, I don't see how you would do it unless you find a way to do it without having additional storage.

Has anyone been successful at installing OTRW to run from a CIFS mount point?

I guess if this is possible then you could run pixelserv on the WRT150.
gendouhydeist
DD-WRT Novice


Joined: 28 Nov 2010
Posts: 3

PostPosted: Thu Jan 12, 2012 7:05    Post subject: Reply with quote
guys you might have already notice
http://winhelp2002.mvps.org/hosts.txt
has been removed.
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
zoomlink
DD-WRT User


Joined: 08 May 2011
Posts: 221

PostPosted: Thu Jan 12, 2012 17:39    Post subject: Reply with quote
Are you sure? comes right up for me.

http://http://winhelp2002.mvps.org/hosts.txt
anonymous9000001
DD-WRT Novice


Joined: 07 Apr 2012
Posts: 1

PostPosted: Sat Apr 07, 2012 4:33    Post subject: Reply with quote
ndewan wrote:
Frater,

I went ahead and installed the code above, added the dnsmasq entry and enables the pixelserv service.

I am noticing a performance issue and pages take ages to load. Even the dd-wrt forum page hangs. Other sites include my.yahoo.com, cnn.com, bbc.com.uk etc.

On a whim, while pages were waiting to load, I stopped the pixelserv service, and the pages loaded immediately.

By no means is this a conclusive test, but I wanted to check with the group to see if others are seeing similar issues.

If my case is isoloated, any clues as to what might be going on.

Router: e3000
Firmware: DD-WRT v24-sp2 (12/24/10) mega
(SVN revision 15962)


how do i stop the service in a way that will let me turn it back on quickly?

thanks
Goto page Previous  1, 2, 3 ... 8, 9, 10 ... 12, 13, 14  Next Display posts from previous:    Page 9 of 14
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum