Community discussions

MikroTik App
 
speaksandeep
newbie
Topic Author
Posts: 26
Joined: Sat Jul 12, 2014 1:02 pm

Usermanager: block youtube access for some users

Thu Jan 30, 2020 5:40 pm

Hello,
I am using Rb3011 as a hotpspot device with builtin usermanager.
My user manager is programmed for only users with id and password.
With usermanager I can create different profiles with different speed limitations and upload/download limit.
but I want to block Youtube access for some users. I am using DHCP server so everytime user gets a different IP.
So how can we program Mikrotik device for my requirement of blocking Youtube for some particular users.

I already have rule of Layer7 protocol to block torrent traffic; but this rule applies to all users.

Please help
Regards,

Sandeep Baral
 
albaraa
just joined
Posts: 2
Joined: Sun Mar 01, 2020 4:04 pm

Re: Usermanager: block youtube access for some users

Sun Mar 01, 2020 4:44 pm

fristly for dhcp : to make users take the same ip every time , type this script in new terminal
"/system scheduler add disabled=no interval=30m name=schedule1 on-event=\
"ip dhcp-server lease make-static [find dynamic=yes]" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensit
start-date=mar/01/2020 start-time=14:12:59 "
secodly
to block youtube for some users , you can do that using regural expression to difine youtube connections and block them.
this is youtube regexp
"(GET \/videoplayback\?|GET \/crossdomain\.xml)"
if you'r aware about firewall , you can do it
. but if not, just follow :

1- type the following script in new terminal

"/ip firewall layer7-protocol
add name=youtube regexp="(GET \\/videoplayback\\\?|GET \\/crossdomain\\.xml)"

/ip firewall filter add action=drop chain=forward disabled=no layer7-protocol=youtube src-address-list=\
yt-block"
2- in winbox path Ip>Firewall>Address Lists : add an item . for name , sellect "yt-block"
& for address , type the ip address of the client , then press ok
3- congratulations!
Last edited by albaraa on Sun Mar 01, 2020 4:53 pm, edited 2 times in total.

Who is online

Users browsing this forum: Semrush [Bot] and 4 guests