Sometimes we need to block youtube or other video streaming site for specific IP at specific time schedule. I use Mikrotik router firewall to do this. Winbox, router OS v6.30.2.
(Step 1). Create layer7 rules called “youtube”.
My understanding layer7 will detect all traffic that contain wording in regexp list. Now open new Terminal winbox and copy paste this rules:
/ip firewall layer7-protocol
add name=youtube regexp=”^.*(youtube.com|youtu.be|netflix.com|vimeo.com|screen.yahoo.com|dailyMotion.com|hulu.com|twitch.tv|liveleak.com|vine.co|break.com|tv.com|metacafe.com|viewster.com).*\$”

The above code work with me.
You can experiment using this code:
/ip firewall layer7-protocol
add comment=”” name=youtube regexp=”^.*get.+\\.(c.youtube.com|cdn.dailymotion.com|metacafe.com|mccont.com).*\$”
or this code also work but it may be block all the word “video” I am still experimenting on this one. Work with my other rules to limiting youtube streaming download:
/ip firewall layer7-protocol
add comment=”” name=youtube regexp=”videoplayback|video”
(Step 2). Create mangle rules that will create blacklist IP address called “YouTube-BL”
You can open new terminal or type “/” to go to root directory and copy paste this code:
/ip firewall mangle
add chain=prerouting action=add-dst-to-address-list address-list=YouTube-BL address-list-timeout=1d layer7-protocol=youtube log=no log-prefix=””
You can check if your rules work by visit youtube sites and check your address list they should make automatic list like this:

(3). Create local computer address list to be blocked for youtube.
I do it by registering local ip target computer one by one in IP>Firewall>AddressList click Add button then type the list name. Don’t forget to put down the IP address.

To create multiple target list you have to use the exact same “name” and click add button to keep adding. In my case, I use the name “Sekolah”. The word “Sekolah” = school in Indonesia. I don’t want my kids computers browsing youtube after school before done with their homework.
(4). Create IP firewall rules with schedules.
My setup now, the filter only run from 14:00 – 18:00 Monday-Friday. :
/ip firewall filter
add chain=forward action=drop src-address-list=Sekolah dst-address-list=YouTube-BL time=14h-18h,mon,tue,wed,thu,fri log=no log-prefix=””
You must put the rules after the accept rules in your firewall list.

The rules will appear red in color if they are outside the schedule. You can set the schedule according to what you need by double clicking in the rules and go to “Extra” tab.

You can test if your rule work by browsing youtube and watch the bytes column in IP>Firewall>filter. Make sure that you are within the time schedule. It will not work if you are outside your schedule.
Collected from - https://otorbus.wordpress.com/2015/08/11/mikrotik-block-youtube-or-other-video-streaming-sites-for-specific-ip-at-specific-time-schedule/
Thanks for sharing. If you are also find sites like LiveLeak for shocking videos, here I found a post including several recommendations for help: 10 Best Sites Like LiveLeak
উত্তরমুছুন