Is it possible to block ads from the router level and not by application level? I'd like to filter ads for all devices connected to my home wifi.

Googling I found that there is the possibility to change the firmware of some router to install "Tomato" and run an ad blocking script on it.

Is there some other possibility?

  • 1
    I wouldn't do that even if it were possible. The latency simply would be crazy, especially when there are many clients accessing the Web at the same time. – Larssend Nov 23 '15 at 0:29

For a router to do this, it would have to be more than a router. To truly filter ads, you have to sit at the application level, layer 7. Routers sit at layer 3 and 4. To a router, ads and legit website traffic can come from the same IP address, making it impossible to differentiate between the two.


This is not an entirely self-contained solution, but you could get a Raspberry Pi and install pi-hole. https://pi-hole.net/ Then you make the Raspberry Pi your router's DNS server and the Pi does all the add blocking. It should block ads across your entire Wifi network.

  • Might want to add some of the background such as also is in @moses's answer. Basically you are using the pri as a cheap asa. – Hennes Mar 25 '16 at 14:53

surfasb pointed out that a basic router can't do this because they normally don't look at application layer traffic.

While there are scripts for open-source router firmware available, they aren't foolproof and require a good knowledge of what you're doing. Even then, they don't work all the time, and introduce latency (see below). Doing it wrong could brick the router.

You would need an appliance that can inspect traffic and block the things you specify. One example that I use is Untangle. You would place an appliance like this between your router and your devices. Untangle could also work as a router itself, in which case you could eliminate your current router.

Another option is getting a router/firewall that can inspect application traffic, which are usually pretty expensive. Cisco offers some options, though, in it's ASA line of firewalls.

Be aware that unless you plan on spending a lot of money, technology that could do what you are asking is going to make the internet slow (latency). The better solution would be to simply install ad-blocking software on your client machines.


You may want to consider changing the Router's DNS configuration to a DNS Service that blocks ads networks. This way, when any device on your network loads a page (or an app) that includes ads, the DNS service will send it to the wrong place, and it won't be able to download the ad. I don't do this, so I can't recommend a specific ad blocking DNS service. If you search for them, there are several options to choose from.

  • This is really a comment and not an answer to the original question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Please read Why do I need 50 reputation to comment? What can I do instead? – DavidPostill Jul 1 '16 at 20:54
  • This is an answer that helped me. I would tell the dns that worked for me but can't because of NPV, "we don't advertise tools, etc". – Stepan Sep 18 '16 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.