16

Is it possible to block or remove ads (graphical as well as textual like Google text ads) on the level of the router? I have a Cisco Linksys WRT54GL with Tomato Firmware v1.28.1816.

Basically I want a functionality as implemented by the AdBlock Lite add-on for Firefox, or Privoxy, but not on the level of the browser or individual computer, but on the level of the router.

The motivation is, there are several devices (laptops, PS3, PSP...) connected via one router to the internet. And I want one point to block the ads.

2
  • Interesting idea, but I'm afraid your router and the firmware don't go that up on the IP stack. This looks like the application level.
    – user127350
    Jul 26, 2012 at 12:07
  • 1
    Not sure about Tomato, but you can run Privoxy in DD-WRT Kong Mod. Alternatively, with any firmware you could modify the hosts file, but I won't recommend that.
    – lupincho
    Jul 26, 2012 at 12:26

5 Answers 5

10

Lucky for you lifehacker have an article on how to do exactly this.

http://lifehacker.com/5060053/set-up-universal-ad-blocking-through-your-router

  1. Open the Tomato Admin Scripts interface You'll need to login with the user name and password you set in your instructions for installing Tomato. Once you're logged in, make sure to click on the WAN Up tab.

  2. Copy the ad-block script to Tomato. I'd recommend going directly to the source, since the author of the script updates it regularly.

You should paste the script into the blank text area in the WAN Up tab

3 . Save the script by clicking the Save button.

4.Reboot your router to enable the script. That's all there is to it. Next time you visit a web site, you should notice a conspicuous lack of ads. The same should be true from any computer, as long as it's connected to your Tomato router. There are some unfortunate bits and pieces about this method versus the Adblock extension that you might want to take into consideration before setting it up on your router. First, if you want to whitelist a site, you have to manually edit the script by changing the following section:

## remove/whitelist websites ## removes 3 websites (aa.com, bb.com, cc.com) ## remove the # and edit the website urls. sed -i -e '/aa.com/d' $GENFILE

...replacing aa.com with the site you wanted to whitelist. Keep in mind that whitelisting does not work for whitelisting all ads on a specific site—instead, if you're having trouble opening a site you want to look at because it's on a blacklist, whitelisting that site will let you access that one specific site.

Unfortunately the script doesn't allow you to whitelist all ads on specific sites.

2
  • 2
    Can you write a summary of the link in your answer? should the link go dead, your answer would be made useless, but if you summarize the context of the link, the general idea of what you are trying to convey will always remain.
    – MaQleod
    Jul 26, 2012 at 16:29
  • I like this method very much. One problem I see though, this can not block Google text ads or similar, can it? I find the text ads actually more intrusive than the graphical ones...
    – user50105
    Jul 28, 2012 at 5:24
5

What you want to use is OpenDNS. Then you can set the DNS settings of your router or computers to point to their DNS. A small utility on any computer can update the IP address if it changes every few weeks, but if it's static all the better. They have an account settings section where you can block things. You just need to search the web for a black list of things to block (ad networks). You might find one by searching for a hosts file for this purpose.

1
  • I love and use OpenDNS, but OP and I are looking for AdBlock type rule-based internet filtering at the router level.
    – Baodad
    Mar 8, 2014 at 22:55
2

In order to achieve your goal you need something with a little more intelligence. In my home I run an a piece of software called Untangle. Its a Debian Linux distribution that has a full featured web interface for controlling the software.

Untangle runs on a standard x86/x64 based computer that has 2 network cards in it. You need one for the Internet traffic (WAN) and one for your network traffic (LAN).

There are many modules included for free with Untangle including an Ad Blocker that is actually based on the code from Firefox's AdBlock Plus add-on.

Some of the other free modules include:

  • Spam Filter
  • Spyware Blocker
  • Virus Blocker (Based on Clam AV)
  • Website Blocker
  • VPN (based on OpenVPN)
  • etc...

They also offer a handful of premium apps which have costs associated with them, this was mainly for business users but you may find some of them useful like the enhanced Virus Blocker which is NOT based on Clam AV.

Untangle has the ability to act as a router or a pass through (bridge) device which can sit in-line with your network and allow you to run it without replacing your current router.

2
  • I might have to experiment with that at some point. Is there a considerable performance slowdown? what sort of hardware would I need to use?
    – VBwhatnow
    Jul 26, 2012 at 14:44
  • 1
    The original version (5.x) could run on an 800mhz P3 and 512MB of RAM. The current releases (9.x) require a dual core and 2GB of memory for a small box. The question is a little hard to pin down. It mainly has to do with scale you are running at. Think of it like this, more users = more power. For some recomendations check out forums.untangle.com. My current box is running on an Intel Core2 E6750 with 4GB of ram, but that is because it was a spare box I had. Also higher quality NICs will make a huge difference on performnce. Jul 26, 2012 at 14:56
1

I set up access restriction list. It is a bit draconian, but it works and i can decide which devices it applies to. It is easy enough to disable by logging in. But, you have to enter sites manually. I have to use two lists because my list is large.

getclicky.com doubleclick.net ad.nozonedata.com ads.pointroll.com us.ard.yahoo.com us.a1.yimg.com us.js2.yimg.com ad.doubleclick.net view.atdmt.com a.tribalfusion.com ad.ca.doubleclick.net ads.deviantart.com pagead2.googlesyndication.com ad.nozonedata.com cdn.fastclick.net cdn5.tribalfusion.com adblade.com media.fastclick.net pixel.quantserve.com tribalfusion.com ads.yahoo.com mf.sitescout.com sitescout.com clicks.beap.bc.yahoo.com comparisons.org sitescout.com vibrantmedia.com adsupply.com taboola.com analytics.twitter.com googleadservices.com smartadserver.com

There are many many more, but thats all i could post

4
  • getclicky.com doubleclick.net ad.nozonedata.com ads.pointroll.com us.ard.yahoo.com us.a1.yimg.com us.js2.yimg.com ad.doubleclick.net view.atdmt.com a.tribalfusion.com ad.ca.doubleclick.net ads.deviantart.com pagead2.googlesyndication.com ad.nozonedata.com cdn.fastclick.net cdn5.tribalfusion.com adblade.com media.fastclick.net pixel.quantserve.com tribalfusion.com ads.yahoo.com mf.sitescout.com sitescout.com clicks.beap.bc.yahoo.com comparisons.org sitescout.com vibrantmedia.com adsupply.com taboola.com analytics.twitter.com googleadservices.com smartadserver.com
    – J. Honak
    May 4, 2015 at 23:54
  • There are many many more, but thats all i could post
    – J. Honak
    May 4, 2015 at 23:55
  • You can block the entire domain or a specific dns name
    – J. Honak
    May 4, 2015 at 23:56
  • 1
    Can you say a bit more about how to do this? May 5, 2015 at 1:47
-1

For those who don't have Tomato or any advanced router, it is still possible to do that with a run-of-the-mill router. I explain this in details in this Medium post. Essentially, create a free account with OpenDNS and set this as the default DNS in your router. You can block entire categories (e.g. Gambling or Weapons) and whitelist or blacklist up to 25 specific domains. One great feature is that they act as wildcards, so blocking taboola.com will block *.taboola.com.

2
  • Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
    – DavidPostill
    Dec 29, 2020 at 18:02
  • Thanks David, I just clarified my answers. These 2 questions are very similar but not identical. I would suggest adding that this question is for routers running Tomato in the title though.
    – Nico
    Dec 31, 2020 at 16:42

You must log in to answer this question.