MikroTik
How to Configure Layer 7 Protocols on MikroTik: Step by Step
VPS 8GB RAM + 75GB NVMe — R$59/mês4 vCPUs · Tráfego ilimitado · Ubuntu Server LTS · Suporte para instalação incluso
Contratar agoraStep by Step to Configure Layer 7 Protocols on MikroTik
1. Access the MikroTik
- Conecte-se ao dispositivo via WinBox, SSH, ou interface Web.
2. Create a Layer 7 Expression
- Adicione uma expressão para identificar o tráfego que deseja filtrar. Por exemplo, para bloquear o YouTube:
RouterOS
/ip firewall layer7-protocol add name=block_youtube regexp="^.+(youtube.com|ytimg.com).*$"
3. Configure a Firewall Rule with Layer 7
- Adicione uma regra no firewall utilizando o protocolo Layer 7 criado:
RouterOS
/ip firewall filter add chain=forward layer7-protocol=block_youtube action=drop comment="Bloquear YouTube"
4. Monitor Blocked Traffic
- Acompanhe as estatísticas do firewall para verificar se a regra está funcionando:
RouterOS
/ip firewall filter print stats
5. Configure Limits or Priorities (optional)
- Em vez de bloquear, você pode limitar a largura de banda de um aplicativo identificado pelo Layer 7:
RouterOS
/queue simple add target=192.168.1.0/24 max-limit=1M/1M layer7-protocol=block_youtube
6. Test the Configuration
- Access the target application or website from a device on the network and verify that it is being filtered correctly.
7. Tune Performance (if necessary)
- Como o Layer 7 consome recursos do roteador, certifique-se de aplicá-lo apenas quando necessário, e restrinja-o a redes ou dispositivos específicos:
RouterOS
/ip firewall filter add chain=forward src-address=192.168.1.0/24 layer7-protocol=block_youtube action=drop