*Note: 192.168.1.0/24 is my LAN ip address
1. Create Layer 7 to filter YouTube website
/ip firewall layer7-protocol
add name=youtubeL7 regexp="^.+(youtube.com).*\$
2- Create filter rule and choose layer 7 that we have created
/ip firewall filter
add action=drop chain=forward comment="Block youtube" disabled=no \
layer7-protocol=youtubeL7 protocol=tcp src-address=192.168.1.0/24
3. Create script to disable/enable the firewall rule
/system script
add name="Disable Block rule" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive source="ip fire\
wall filter disable [/ip firewall filter find comment=\"Block youtube\"]
add name="Enable Block rule" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive source="ip fire\
wall filter enable [/ip firewall filter find comment=\"Block youtube\"]
4. Create schedule to run the script (your working time can be different so please change it)
/system scheduler
add disabled=yes interval=1d name="Block YouTube 08:00" on-event=\
"Enable Block rule" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
may/22/2014 start-time=08:00:00
add disabled=yes interval=1d name="Allow YouTube 12:00" on-event=\
"Disable Block rule" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
may/23/2014 start-time=11:00:00
add disabled=yes interval=1d name="Block YouTube 14:00" on-event=\
"Enable Block rule" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
may/23/2014 start-time=13:30:00
add disabled=yes interval=1d name="Allow YouTube 17:00" on-event=\
"Disable Block rule" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=\
may/22/2014 start-time=16:30:00
5. Check your date/time on your MikroTik router that it's correct or not...good luck!..
0 komentar:
Terimakasi telah mengunjungi blog ini , semoga informasi yang terdapat dalam blog ini bermafaat bagi anda jika informasi yang kalian baca di blog ini bermanfaat silahkan di Share dan beri komentar :)
Perhatian !!!
Berkomentarlah yang baik dan sopan !
jika mengirim link aktif komentar anda akan di anggap spam !
berkomentarlah sesuai topik !