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, 02:53 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 47
Thanks: 1
Thanked 1 Time in 1 Post
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 03:03 PM.
Reply With Quote
  #2  
Old 01-10-2013, 08: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, 11:11 PM
mromero mromero is offline
Member
 
Join Date: Nov 2012
Posts: 80
Thanks: 52
Thanked 8 Times in 5 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, 02:25 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 47
Thanks: 1
Thanked 1 Time in 1 Post
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, 03:31 PM
ryzhov_al's Avatar
ryzhov_al ryzhov_al is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Smolensk, Russia
Posts: 417
Thanks: 48
Thanked 289 Times in 146 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 03:34 PM.
Reply With Quote
The Following User Says Thank You to ryzhov_al For This Useful Post:
  #6  
Old 01-12-2013, 04:24 PM
AnthonyArmato AnthonyArmato is offline
Very Senior Member
 
Join Date: Apr 2012
Posts: 249
Thanks: 1
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, 06:11 PM
RogerSC RogerSC is offline
Very Senior Member
 
Join Date: Oct 2009
Posts: 1,416
Thanks: 21
Thanked 202 Times in 179 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, 02:00 AM
ryzhov_al's Avatar
ryzhov_al ryzhov_al is online now
Very Senior Member
 
Join Date: Jul 2012
Location: Smolensk, Russia
Posts: 417
Thanks: 48
Thanked 289 Times in 146 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 07:17 AM.
Reply With Quote
  #9  
Old 01-13-2013, 12:33 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 47
Thanks: 1
Thanked 1 Time in 1 Post
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 02:44 PM.
Reply With Quote
  #10  
Old 01-14-2013, 07:01 PM
Txdk Txdk is offline
Member
 
Join Date: Dec 2012
Posts: 47
Thanks: 1
Thanked 1 Time in 1 Post
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 09:43 AM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  428
azazel1024  125
john9527  96
L&LD  95
htismaqe  78
ColinTaylor  73
stevech  71
hggomes  58
sfx2000  55
Anzaia  49
RMerlin  6276
john9527  448
stevech  353
ryzhov_al  289
TeHashX  252
L&LD  242
RogerSC  202
sinshiva  146
sfx2000  136
joegreat  127
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  50071
Old RT-AC68 -...  23013
Old Moderate Nat...  5022
Old ASUS RT-N66U...  4477
Old iOS 8.1...  4035
Old RT-AC87U -...  2529
Old WiFi...  2461
Old RT-AC68P QOS...  2039
Old AC68U,...  1845
Old Ruckus...  1731
Old Asuswrt-Merli...  226
Old RT-AC68 -...  137
Old Review: 24...  35
Old iOS 8.1...  33
Old Moderate Nat...  32
Old WiFi...  27
Old RT-AC87U -...  26
Old RT-AC68P QOS...  24
Old How to flash...  24
Old Linksys...  21


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