MikroTik
How to Configure Cache Proxy on MikroTik: Step by Step
O Cache Proxy no Mikrotik é utilizado para armazenar localmente conteúdos acessados frequentemente, como páginas web, economizando largura de banda e melhorando o desempenho da rede. Ele é configurado através do recurso Web Proxy, disponível no sistema RouterOS.
Step-by-Step Guide to Configuring Cache Proxy on MikroTik
1. Ativar o Web Proxy
- Acesse o Mikrotik via Winbox.
- No menu lateral, vá em IP > Web Proxy.
- Habilite o Web Proxy marcando a opção Enabled.
- Set the proxy port (the default is 8080, but it can be changed).
- Set the storage directory if needed (this is usually configured automatically).
RouterOS
/ip proxy set enabled=yes port=80802. Configurar o Cache de Armazenamento
- No mesmo painel do Web Proxy, defina o tamanho máximo do cache:
- Max Cache Size: tamanho total do cache (ex.: 100MiB).
- Max Cache Object Size: tamanho máximo de cada arquivo armazenado.
- Set the maximum time-to-live (TTL) for cached objects.
RouterOS
/ip proxy set max-cache-size=100000KiB max-cache-object-size=4096KiB cache-on-disk=yes3. Criar Regras de Redirecionamento no Firewall
Crie uma regra para redirecionar o tráfego HTTP para o Web Proxy.- No menu lateral, vá em IP > Firewall > NAT.
- Adicione uma nova regra:
- Chain: dstnat
- Protocol: tcp
- Dst Port: 80
- Action: redirect
- To Ports: 8080
RouterOS
/ip firewall nat add chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=80804. Testar o Cache Proxy
- Browse to a regular website on the network to verify it is working.
- Confira o tráfego do Web Proxy em IP > Web Proxy > Access para garantir que os acessos estão sendo redirecionados.
RouterOS
/log print where topics=web-proxy