r/UNIFI•
shaqfuuu

How to Block YouTube Ads with Unifi and a VPN

I love to tinker and I found some information scattered around in various subreddits and online articles on how to block YouTube ads network wide. I have a mixture of both apple and android devices and didnt want to jailbreak/ use 3rd party apps to avoid youtube ads. I currently use ProtonVPN and have routing policies based on devices and also have other wifi range rules. Importantly, Youtube does not push ads in certain countries such as Albania, Moldova or Myanmar. The easiest way to avoid ads would be to route all traffic to one of these countries on the network, but I do not want to use Albania as my VPN location 24/7.

What I wanted to accomplish:

  1. Enable Multiple VPN Clients with different countries assigned
  2. Assign Routing Rules for only Youtube domains to use Albania VPN location and then have other device rules in place to use the other U.S. based VPN location.

How to do this:

  1. Set up VPN clients for the countries you want. In my case I use a US based location for one and Albania for the other.
  2. Set routing rules. In my use case, I have two:
    1. The first is to route youtube's domain traffic to Albania. To do this create a new policy. Interface is the name of the VPN you have assigned to Albania. Source I manually checked all devices I have. Destination is domain. Last, enter all of youtube's domains in the list.
      1. A very important, but annoying, part of this is you need to create policy based rules in a specific order/priority and it cant be modified later without deleting and starting over. Another user in the Unifi forum created a great breakdown on how priority assigned for policy based rules
    2. The second is to route all other traffic to my US based VPN. Follow similar steps as above except my destination is Any.

Results:

Following the above method now allows ad free youtube on any device whether in a browser or in the official app on my network. For all other traffic, it is correctly routed to my VPN with a US location. You can also create a lot more complexity if you want, but this was a very effective way to accomplish what I wanted. This also may be very basic information, but I had to do a little bit of research to find everything. I thought it may help to consolidate this in one place!

Posted Jan 14, 2026, 8:52 PM UTC

9639
Loading comments…