SmallNetBuilder Forums
Go Back   SmallNetBuilder Forums > Wireless Networking > ASUS Wireless > Asuswrt-Merlin

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-07-2013, 01:53 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Txdk is just starting out
Default ad blocking on the router

something like this tutorial

is it possible to get some one to write a tutorial about how to do it on asuswrt-merlin as i dont know anything about linux commands or systems at all

or might it be possible to intergrate the function in the firmware so you only need to activate it if you want to use it

Last edited by Txdk; 01-07-2013 at 02:03 PM.
Reply With Quote
  #2  
Old 01-10-2013, 07:53 PM
Apex Apex is offline
New Member
 
Join Date: Nov 2012
Location: UK
Posts: 10
Thanks: 4
Thanked 1 Time in 1 Post
Apex is just starting out
Default

Quote:
Originally Posted by Txdk View Post
something like this tutorial

is it possible to get some one to write a tutorial about how to do it on asuswrt-merlin as i dont know anything about linux commands or systems at all

or might it be possible to intergrate the function in the firmware so you only need to activate it if you want to use it
Have you thought about using OpenDNS in order to block ad-sites etc ? (It's my own choice over any other method)
Reply With Quote
  #3  
Old 01-10-2013, 10:11 PM
mromero mromero is offline
Member
 
Join Date: Nov 2012
Posts: 30
Thanks: 5
Thanked 5 Times in 3 Posts
mromero is just starting out
Default

Quote:
Originally Posted by Apex View Post
Have you thought about using OpenDNS in order to block ad-sites etc ? (It's my own choice over any other method)
But don't they also serve up their own ads when the URL is wrong?

Also, unless you are located in the country where it operates it may make the lookup even longer I think.
Reply With Quote
  #4  
Old 01-12-2013, 01:25 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Txdk is just starting out
Default

OpenDNS is not an option as they serve there own ads and redirect you if you type wrong and they are slow as hell and blocks access to some pages that they are forced to block.

i don't want that.
why do that if what i want is no ads when surfing the net as it stands now im using ad-block plus on all my computers but it would be more easy if it was done by the router
Reply With Quote
  #5  
Old 01-12-2013, 02:31 PM
ryzhov_al's Avatar
ryzhov_al ryzhov_al is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Smolensk, Russia
Posts: 365
Thanks: 36
Thanked 258 Times in 133 Posts
ryzhov_al is just starting out
Default Hosts-based blacklist, resolved to 127.0.0.1

Quote:
Originally Posted by Txdk View Post
something like this tutorial

is it possible to get some one to write a tutorial about how to do it on asuswrt-merlin as i dont know anything about linux commands or systems at all

or might it be possible to intergrate the function in the firmware so you only need to activate it if you want to use it
The ad blocking method from tutorial is based on hosts blacklist. I'll describe how to do it, but IMHO, it's a simplest and worst one. Later I tell you why.

You'll need to create two files. A first one is /jffs/scripts/wan-start:
Quote:
#!/bin/sh
wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | sed '2,$s/127.0.0.1/0.0.0.0/g; s/[[:space:]]*#.*$//g;' | grep -v localhost | tr ' ' '\t' |tr -s '\t' | tr -d '\015' | sort -u > /tmp/hosts0
killall dnsmasq && dnsmasq --log-async
The second one is /jffs/configs/dnsmasq.conf.add with this content:
Quote:
addn-hosts=/tmp/hosts0
Make first one executable:
Quote:
chmod +x /jffs/scripts/wan-start
and reboot router.
__________________
The Entware. A modern Optware replacement.

Last edited by ryzhov_al; 01-12-2013 at 02:34 PM.
Reply With Quote
The Following User Says Thank You to ryzhov_al For This Useful Post:
  #6  
Old 01-12-2013, 03:24 PM
AnthonyArmato AnthonyArmato is offline
Very Senior Member
 
Join Date: Apr 2012
Posts: 247
Thanks: 0
Thanked 8 Times in 8 Posts
AnthonyArmato is just starting out
Default

If I can figure out how to do this it would be great considering I have several iPads and a MacBook on my network.

Any chance you could create the files and attach them in a zip ? Then I assume we just run those commands ?
Reply With Quote
  #7  
Old 01-12-2013, 05:11 PM
RogerSC RogerSC is offline
Very Senior Member
 
Join Date: Oct 2009
Posts: 1,336
Thanks: 19
Thanked 187 Times in 164 Posts
RogerSC is just starting out
Default

Quote:
Originally Posted by AnthonyArmato View Post
If I can figure out how to do this it would be great considering I have several iPads and a MacBook on my network.

Any chance you could create the files and attach them in a zip ? Then I assume we just run those commands ?
It looks like the wan-start command that goes out on the internet and downloads the host blacklist gets run when the router boots (assuming that you put it where it is suggested to put it).

Seems like it'll be fun to play with, might give it a go and see if can improve things for devices that don't have ad blocking, like my Android phone. Curious if it'll slow things down much.

Anthony, I did get the "Atomic" browser for my iPad that does have an ad blocker, cost $0.99 as I recall *smile*. Works well for that, the only problem is that when you click on a URL in email, etc., it brings up Safari. But when I read this forum on my iPad, or go looking for stuff, I use the "Atomic" browser, and it blocks most all ads. I don't know if Safari for MacBook has an ad blocker or not, but it might.
Reply With Quote
  #8  
Old 01-13-2013, 01:00 AM
ryzhov_al's Avatar
ryzhov_al ryzhov_al is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Smolensk, Russia
Posts: 365
Thanks: 36
Thanked 258 Times in 133 Posts
ryzhov_al is just starting out
Default

Quote:
Originally Posted by RogerSC View Post
Seems like it'll be fun to play with, might give it a go and see if can improve things for devices that don't have ad blocking, like my Android phone.
As for me, I redirect all http traffic from Android tablet to privoxy transparent proxy on router with original AdBlock rules.
For what? The embedded browser is real fast but can't use plugins, a firefox got AdBlock plugin but it's slow as hell.

If someone interested, I'll write How-to about that. This solution is quite universal: no matter iOS or Android devices will be used.

Quote:
Originally Posted by RogerSC View Post
Curious if it'll slow things down much.
Yes, all DNS "improvements" needs to be benchmarked. As for DD-WRT variant above, there is
Quote:
# wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | wc -l
...
14316
strings in blacklist. It will not slow down dnsmasq. But if blacklist will be greater, taken from adsuck for example:
Quote:
$ wc -l /opt/etc/adsuck/Hosts.pub
130063 /opt/etc/adsuck/Hosts.pub
then dnsmasq will consume +8MB RAM and will add delays to DNS resolving.

The second disadvantage of dnsmasq + hosts blacklist is following: every time browser "asks" for blacklisted domain, dnsmasq returns "127.0.0.1", which means "this PC" so every time browser will wait for answer from local PC, where no web server is installed.

There is another solution for hosts-based blacklists: adsuck. Adsuck is a DNS server which immediately returns NXDOMAIN (non existent domain) answer for black listed domains. So browser caches it's answer and not trying to get blocked elements again and again.
__________________
The Entware. A modern Optware replacement.

Last edited by ryzhov_al; 01-13-2013 at 06:17 AM.
Reply With Quote
  #9  
Old 01-13-2013, 11:33 AM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Txdk is just starting out
Default

Quote:
Originally Posted by ryzhov_al View Post
The ad blocking method from tutorial is based on hosts blacklist. I'll describe how to do it, but IMHO, it's a simplest and worst one. Later I tell you why.

You'll need to create two files. A first one is /jffs/scripts/wan-start:

The second one is /jffs/configs/dnsmasq.conf.add with this content:

Make first one executable:

and reboot router.

i cant make that work

first of all i dont think that wan-start is even run when the router boots
in the log it says that there is no file or folder /tmp/hosts0

and if i run wan-start manually it downloads the hostfile and then says something about wrong paramaters for dnsmasq and to look in --help

im a total noob dealing with linux but i did what you said these is the files i created adblock
do i need to create the files on the router with the vi editor.
i created them under windows and notepad with copy paste.


if there is i better way to block ads i dont mind if you post a how to for that

adsuck sounds promising

Last edited by Txdk; 01-13-2013 at 01:44 PM.
Reply With Quote
  #10  
Old 01-14-2013, 06:01 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Txdk is just starting out
Default

it seens adblock can be installed from entware so a toturial about how to do that at set it up would be great
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 04:39 PM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  390
sm00thpapa  204
stevech  191
azazel1024  166
KGB7  149
jim769  86
philmiami  75
AcostaJA  73
htismaqe  69
damir  60
RMerlin  5139
stevech  315
ryzhov_al  258
TeHashX  211
RogerSC  187
L&LD  186
joegreat  123
jlake  122
sinshiva  114
sfx2000  112
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  11791
Old Switched...  8781
Old NEW RT-AC68R...  7916
Old ASUS...  7025
Old 3.0.0.4.376.1...  7000
Old ASUS...  5271
Old ASUS RTAC68U...  3897
Old ASUS RT-AC87...  3728
Old Netgear...  3688
Old ASUS...  3593
Old Asuswrt-Merli...  131
Old ASUS...  73
Old Switched...  66
Old NEW RT-AC68R...  57
Old Overclock...  50
Old N66U daily...  47
Old [Q] How to...  47
Old ASUS...  45
Old How many of...  44
Old Which router...  41


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2006-2014 Pudai LLC All Rights Reserved.