Bloqueo de Publicidad Youtube desde Mikrotik Usando Layer 7
Una manera de bloquear alguna publicidad intrusiva en youtube y de otras paginas.
Esto no es solucion final, es solo un ejemplo para testar, no los bloquea al 100 %. Las publicidades en adservice (google) actualmente negocian con el nuevo protocolo criptografíco TSL.
Otra y mejor opcion y solución es instalar Add-ons al navegador Google Chrome : uBlock Origin
==========================================================
La otra forma un ejemplo extraído de esta direccion : http://arg-wireless.com.ar/index.php?topic=1542.0
El contenido googleads.g.doubleclick.net hace referencia a las publicidades de Google Adsense y el contenido &ctier hace referencia a las publicidades de los videos de Youtube.
/ip firewall filter
add action=drop chain=forward comment="BLOCK PUBLICIDAD" content=\
googleads.g.doubleclick.net dst-port=80 protocol=tcp
add action=drop chain=forward comment="BLOCK VIDEOS PUBLICITARIOS YOUTUBE" \
content=&ctier dst-port=80 protocol=tcp
QOS para Reducir LAG en juego con Mikrotik
Fuente: https://r1ch.net/blog/routerboard
/queue tree
add limit-at=9700k max-limit=9700k name=queue1 parent=ether1-gateway queue=default
add limit-at=9300k max-limit=9300k name=prio5-streaming packet-mark=streaming parent=queue1 priority=5 queue=default
add limit-at=100k max-limit=9500k name=prio8-untagged packet-mark=no-mark parent=queue1 queue=default
add limit-at=1G max-limit=1G name=prio3-gaming packet-mark=gaming parent=queue1 priority=3 queue=default
add limit-at=1G max-limit=1G name=prio2-misc-fast packet-mark=misc-fast parent=queue1 priority=2 queue=default
add limit-at=100k max-limit=9500k name=prio6-http packet-mark=http parent=queue1 priority=6 queue=default
/ip firewall mangle
add action=mark-packet chain=postrouting connection-mark=streaming new-packet-mark=streaming passthrough=no
add action=mark-packet chain=postrouting connection-mark=gaming new-packet-mark=gaming passthrough=no
add action=mark-packet chain=postrouting new-packet-mark=misc-fast packet-size=40 passthrough=no protocol=tcp tcp-flags=ack
add action=mark-packet chain=postrouting dst-port=53 new-packet-mark=misc-fast out-interface=ether1-gateway passthrough=no protocol=udp
add action=mark-packet chain=postrouting connection-mark=http new-packet-mark=http passthrough=no
add action=mark-connection chain=postrouting comment=Streaming connection-state=new dst-port=1935 new-connection-mark=streaming out-interface=ether1-gateway protocol=tcp
add action=mark-connection chain=postrouting comment=League dst-port=5000-5500 new-connection-mark=gaming out-interface=ether1-gateway protocol=udp
add action=mark-connection chain=postrouting comment=SC2 dst-port=1119 new-connection-mark=gaming out-interface=ether1-gateway protocol=udp
add action=mark-connection chain=postrouting comment=HotS dst-port=1120,3724 new-connection-mark=gaming out-interface=ether1-gateway protocol=udp
add action=mark-connection chain=postrouting comment="BW + HotS" dst-port=6112-6113 new-connection-mark=gaming out-interface=ether1-gateway protocol=udp
add action=mark-connection chain=postrouting comment="Valve Games" dst-port=27000-27060 new-connection-mark=gaming out-interface=ether1-gateway protocol=udp
add action=mark-connection chain=postrouting comment="Web Browsing" connection-state=new dst-port=80,443 new-connection-mark=http out-interface=ether1-gateway protocol=tcp
Cómo bloquear páginas con Mikrotik Layer 7 Protocol
Esto es una idea para bloquear páginas porn se puede agregar mas dominios:
Agregamos el siguiente regex en Layer7
/ip firewall layer7-protocol
add comment="" name=Porn regexp="^.+(\bporno\b|videosxxxputas|xmujeres|{0,25}porno{0,25}|[a-z]{0,25}porno|porno[a-z]{0,25}|bingoporno|putas[a-z]+|)\.(com|org|co|net|xxx|mobi|tv|name|[a-z]{2,3,4}).*$"
y en filtro la siguiente regla:
/ip firewall filter
add action=drop chain=forward comment=block-xxx in-interface=\
all-ethernet layer7-protocol=Porn log-prefix=""
Ejemplo práctico como bloquear Mega.co.nz en mikrotik usando Layer7
Indicamos el siguiente regex en Layer7
/ip firewall layer7-protocol
add comment="" name=mega regexp=".(api|userstorage).mega.co"
y en filtro agregamos la siguiente regla:
/ip firewall filter
add action=drop chain=forward comment=block-host-descargas-mega in-interface=\
all-ethernet layer7-protocol=mega log-prefix=""