How to block Youtube App for Android and Ipad

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page 1, 2  Next
Author Message
vi6s
DD-WRT Novice


Joined: 07 Jun 2011
Posts: 7

PostPosted: Wed Dec 04, 2013 20:02    Post subject: How to block Youtube App for Android and Ipad Reply with quote
Hello,

Here is my problem. I got a 3-4 years old kid who love watching video content on a tablet. We have both Ipad and Android devices at home. He has figured out how to use Youtube and love to go online and watched random video. Youtube is a great media platform, but it has absolutely no language filter. I will see him watch some videos that filled with profanity and rage. I can't protect him forever from these kinds of content, but at least I want him to grow older before he are exposed to these behaviors and learn not to act like it.

I have no problems blocking youtube and its domain on youtube. However, I am having difficulty figuring out how to block the Youtube app on Ipad/Android. I can't seem to figure out which domain/ip that Youtube used for streaming.

I have tried com.android.google.youtube as a domain and it still won't work. I don't want to uninstall Youtube from the devices, since my wife will be using it. I just want to be able to block him from accessing that app during certain time block while he is awake. The only solution I can come up with is to block internet access to the device while he is awake, but it is kind of counter-intuitive.

Please let me know if anybody has a solution to this.
Sponsor
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Wed Dec 04, 2013 20:31    Post subject: Reply with quote
Not so easy cause YT uses https as well... did you tried out http://www.dd-wrt.com/wiki/index.php/Access_Restrictions
vi6s
DD-WRT Novice


Joined: 07 Jun 2011
Posts: 7

PostPosted: Thu Dec 05, 2013 1:31    Post subject: Reply with quote
I think you misunderstand my problem. The problem is not learning how to block Youtube app on Ipad/Android. The problem is knowing what to block. I don't know what port, what domain, or what domain I should use to block the app. Please remember this is for the Youtube app on Ipad/Android only. Blocking the website youtube.com is a piece of cake.
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Thu Dec 05, 2013 8:48    Post subject: Reply with quote
If you wan't to block YT app on Android/iOS don't use blocking by URL/Keyword (webstr) but blocking by service because there is a L7 youtube pattern... In short, you can do it Layer7 filter. DDWRT supports L7 filtering... Simply, save this to your firewall (x.x.x.x=Static lease of your tablet, bind MAC with IP)...
Code:
iptables -t filter -I FORWARD -s x.x.x.x/32 -m layer7 --l7proto youtube -j DROP


Quote:
I just want to be able to block him from accessing that app during certain time block while he is awake.

For this you must use AR (Access Restrictions) because it has to do with cron or iptables time module wich I couldn't find (it depends on kernel compiling)...
excuse me for my bad English. I hope this could help you to start from...
vi6s
DD-WRT Novice


Joined: 07 Jun 2011
Posts: 7

PostPosted: Fri Dec 13, 2013 4:59    Post subject: Reply with quote
Mile-Lile wrote:
If you wan't to block YT app on Android/iOS don't use blocking by URL/Keyword (webstr) but blocking by service because there is a L7 youtube pattern... In short, you can do it Layer7 filter. DDWRT supports L7 filtering... Simply, save this to your firewall (x.x.x.x=Static lease of your tablet, bind MAC with IP)...
Code:
iptables -t filter -I FORWARD -s x.x.x.x/32 -m layer7 --l7proto youtube -j DROP


Quote:
I just want to be able to block him from accessing that app during certain time block while he is awake.

For this you must use AR (Access Restrictions) because it has to do with cron or iptables time module wich I couldn't find (it depends on kernel compiling)...
excuse me for my bad English. I hope this could help you to start from...


Finally, I did it. After a lot of tweaking in DD-WRT, I decide to flash my router with tomato firmware. There is an option in the Access Restriction of tomato for Layer7 blocking. It is just a few click and setup and I was able to block youtube based on IP and time period. I would love to try it on DD-WRT but all the tinkering with cron and iptables did not work for me. Thank you for your suggestion.
tomcheng
DD-WRT Novice


Joined: 04 Nov 2014
Posts: 2

PostPosted: Tue Nov 04, 2014 14:24    Post subject: Reply with quote
Sir,
I also have a require that to block YouTube APP on Android devices, and my router has flashed with Tomoto Shibby firmware. Could you please give more information that how to setting in "Access distriction"??

Thanks a lot.

vi6s wrote:
Mile-Lile wrote:
If you wan't to block YT app on Android/iOS don't use blocking by URL/Keyword (webstr) but blocking by service because there is a L7 youtube pattern... In short, you can do it Layer7 filter. DDWRT supports L7 filtering... Simply, save this to your firewall (x.x.x.x=Static lease of your tablet, bind MAC with IP)...
Code:
iptables -t filter -I FORWARD -s x.x.x.x/32 -m layer7 --l7proto youtube -j DROP


Quote:
I just want to be able to block him from accessing that app during certain time block while he is awake.

For this you must use AR (Access Restrictions) because it has to do with cron or iptables time module wich I couldn't find (it depends on kernel compiling)...
excuse me for my bad English. I hope this could help you to start from...


Finally, I did it. After a lot of tweaking in DD-WRT, I decide to flash my router with tomato firmware. There is an option in the Access Restriction of tomato for Layer7 blocking. It is just a few click and setup and I was able to block youtube based on IP and time period. I would love to try it on DD-WRT but all the tinkering with cron and iptables did not work for me. Thank you for your suggestion.
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Wed Nov 05, 2014 20:03    Post subject: Reply with quote
Follow numbers on the image I posted...
tomcheng
DD-WRT Novice


Joined: 04 Nov 2014
Posts: 2

PostPosted: Thu Nov 06, 2014 14:47    Post subject: Reply with quote
Thanks Mile-Lile provided setting for block Youtube with DD-WRT firmware. But DD-Wrt has wifi signal problem with Asus rt-n18u, my router only flash Tomoto Shibby. I saw "vi6s" to block youtube with tomoto firmware successfully, so I follow this thread here.

I noted the setting options with DD-Wrt, but steel need Tomoto options.
Sultan Brunei
DD-WRT Novice


Joined: 22 Feb 2015
Posts: 5

PostPosted: Sun Feb 22, 2015 11:04    Post subject: Reply with quote
I've spent the whole day trying to figure out how to insert the iptables command you mentioned here, and after a whole lot of research, I was able to use Putty for SSH, gained access, and put the iptables command line into the router. Not forgetting my iPad ip replacing the x.x.x.x

NOTHING HAPPENED. It just didn't work.

I also tried to insert the command line into "Command Shell" in DD-WRT administration. Tried to save it as firewall, startup, shutdown, custom script. All with no avail.

The youtube app in the iPad still works !

Did I miss something here ??
thamossop
DD-WRT Novice


Joined: 12 Aug 2009
Posts: 2

PostPosted: Sat Mar 28, 2015 8:01    Post subject: Reply with quote
Ok, I'm in a similar position to the original poster and I've tried running the iptables command to block youtube, as stated, firstly on my own mobile to see if it works, where I've given my device a static IP, but like the last post, nothing happens. I've tried adding the drop rule without the '-t filter' part and also to the INPUT instead of the FORWARD rule list but nothing makes a difference.

I also note that when I run iptables -L the rule doesn't seem to be listed so it doesn't look like it's even taking the rule, yet it displays no errors after issuing the command. Something I checked by adding random characters to various arguments in attempt to break the command, yet I still get no errors. I can enter 'iptables -#' and get no errors. iptables --help doesn't output anything either.

So it seems the command is not working on our routers but why not and how can we fix this? Please, can anyone help?
Sultan Brunei
DD-WRT Novice


Joined: 22 Feb 2015
Posts: 5

PostPosted: Sat Apr 25, 2015 15:06    Post subject: Reply with quote
So let me cut to the point, ARE THERE ANY SINGLE WAY TO BLOCK YOUTUBE FOR IPAD OR ANDROID ???
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Sat Apr 25, 2015 19:17    Post subject: Reply with quote
Some ddwrt routers uses nDPI instead of l7 filters... I think (but not sure) it is kernel depended. There is module called xt_nDPI... about nDPI you can read here http://www.ntop.org/products/ndpi/ and abput https (SSL) they stated:

Quote:
The trend of Internet traffic is going towards encrypted content often using SSL. In order to let nDPI support encrypted connections, we have added a decoder for SSL (both client and server) certificates, thus we can figure out the protocol using the encryption certificate.


Shortly: If you have xt_nDPI module and youtube nDPI pattern, you can block youtube very efficiently. I can confirm that with my unit 842ndV2 and latest public build 26653 this is working.
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Sat Apr 25, 2015 20:13    Post subject: Reply with quote
forget about my last post. With latest build 26653 it is not possible to block youtube with l7,nDPI filters. Devs are working on it, I reported problem... there are some missing filters... only URL blocking with webstr matching...
TDave00
DD-WRT Novice


Joined: 17 May 2009
Posts: 14

PostPosted: Sun Apr 26, 2015 2:33    Post subject: Reply with quote
I just use an app locker to control which apps the kids can use. You simply put an app in the locker and they can't use it without the password. You can also block them from system settings, browsers, etc.

Or, if you can find the api domain for youtube, you can block it with dnsmasq like this: address=/api.youtube.com/127.0.0.1
(You'll need to make sure the primary dns that dhcp hands out is that of your router.)
TDave00
DD-WRT Novice


Joined: 17 May 2009
Posts: 14

PostPosted: Sun Apr 26, 2015 2:36    Post subject: Reply with quote
BTW, in the browser, this dnsmasq setting will lock them to youtube's safe search.
address=/www.youtube.com/216.239.38.120
(This option will enforce it on your whole network through the browser. Although you can exempt certain hosts if you choose to.)

If they are using a seperate google account on the tablet, you can also just turn on safesearch for that particular account. I think that covers search, and youtube.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum