Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hsantosdias/69eaefe12e3386f8924c9c2b28ca6981 to your computer and use it in GitHub Desktop.
Save hsantosdias/69eaefe12e3386f8924c9c2b28ca6981 to your computer and use it in GitHub Desktop.
# 2024-10-07 00:00:01 by RouterOS 7.15.3
# software id =
#
# model = RB433AH
# serial number = xxxxx
/ip firewall layer7-protocol
add name=YOUTUBE regexp="^.*(youtube\\.|ytimg\\.|googlevideo\\.com|youtu\\.be).*\$ \r\
\n"
add name=YOUTUBEweb regexp="^.*(youtube|o-o\\.preferred\\.pttelkom-|a\\.youtube\\.com|b\\.youtube\\.com|c\\.youtu\
be\\.com|d\\.youtube\\.com|e\\.youtube\\.com|f\\.youtube\\.com|g\\.youtube\\.com|h\\.youtube\\.com|i\\.youtub\
e\\.com|j\\.youtube\\.com|l\\.youtube\\.com|googlevideo\\.com|facebook\\.com).*\r\
\n"
add name=YOUTUBEapp regexp="^.*(youtube\\.com|www\\.youtube\\.com|m\\.youtube\\.com|ytimg\\.com|s\\.ytimg\\.com|y\
timg\\.l\\.google\\.com|youtube\\.l\\.google\\.com|i\\.google\\.com|googlevideo\\.com|youtu\\.be).*\r\
\n"
add name=block_youtube regexp="^.*(youtube\\\\.com|youtu\\\\.be|ytimg\\\\.com|googlevideo\\\\.com).*\$"
/ip firewall address-list
add address=192.168.51.121 list=IPS_SEMIBLOQUEADOS
/ip firewall connection tracking
set enabled=yes tcp-established-timeout=5h udp-timeout=10s
/ip firewall filter
add action=drop chain=forward comment="Bloqueio do YouTube" layer7-protocol=YOUTUBEweb protocol=tcp src-address-list=IPS_SEMIBLOQUEADOS
add action=drop chain=forward comment="Bloquear YouTube" dst-port=443 protocol=tcp src-address-list=IPS_SEMIBLOQUEADOS tls-host=*youtube.com*
add action=drop chain=forward comment="Bloquear GoogleVideo" dst-port=443 protocol=tcp tls-host=*googlevideo.com*
add action=drop chain=forward comment="Bloquear YouTube Image Server" dst-port=443 protocol=tcp src-address-list=IPS_SEMIBLOQUEADOS tls-host=*ytimg.com*
add action=drop chain=forward comment="Bloquear Youtu.be" dst-port=443 protocol=tcp src-address-list=IPS_SEMIBLOQUEADOS tls-host=*youtu.be*
#add address=192.168.51.121 list=IPS_SEMIBLOQUEADOS
Blok Youtube Web
^.*(youtube|o-o\.preferred\.pttelkom-|a\.youtube\.com|b\.youtube\.com|c\.youtube\.com|d\.youtube\.com|e\.youtube\.com|f\.youtube\.com|g\.youtube\.com|h\.youtube\.com|i\.youtube\.com|j\.youtube\.com|l\.youtube\.com|googlevideo\.com|facebook\.com).*
Blok Youtube App
^.*(youtube\.com|www\.youtube\.com|m\.youtube\.com|ytimg\.com|s\.ytimg\.com|ytimg\.l\.google\.com|youtube\.l\.google\.com|i\.google\.com|googlevideo\.com|youtu\.be).*
@hsantosdias
Copy link
Author

This text will serve as a basis for blocking specific websites such as Youtube, for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment