Você está na página 1de 6

MODO PARALELO

CONFIGURAÇÕES MIKROTIK para LAN, PPPOE e HOTSPOT


Reserve uma placa para o ThomeCache

1º) IP > Address


address=201.90.0.1/30 network=201.90.0.0 interface=thomecache

• Teste o ping em Tools > Ping teste 201.90.0.2 , só faça o restante abaixo se responder.

2º) IP > Firewall > Address List Aqui você pode por as redes ou ips que passarão pelo
ThomeCache, caso tenha várias redes deve-se repetir o nome como no exemplo.
# LIST ADDRESS
CLIENTES 192.168.100.0/24
CLIENTES 10.0.2.0/24
CLIENTES 10.10.0.2-10.10.255.254

3º) IP > Firewall > NAT

;;masquerede Thome
chain=srcnat src-adress=201.90.0.2 out-interface=Link action=masquerade
;;masquerede Global- rede
chain=srcnat src-adress= ! 201.90.0.2 out-interface=Link action=masquerade

IMPORTANTE não precisa de outros masquered somente estes, um para o thomecache e o outro é
da rede Geral, Global.

4º) IP > DNS


;;Marcar “Allow Remote Requests”
Adicione o IP do thomecache nos profiles PPPOE na opção “Server DNS” e no dhcp-server como
servidor DNS primário, Secundário fique a seu critério.
5º) IP > Firewall > Filter
add action=drop chain=forward comment="==== Thome Velocimetro ====" content=HI
dst-port=8080,5060 protocol=tcp

6º) IP > Firewall > Mangle


src-address-list está na aba Advanced de cada regra.
;;; http 80 e filmes 8777p/ThomeCache
chain=prerouting action=mark-routing new-routing-mark=Thome passthrough=yes
protocol=tcp dst-port=80,8777 in-interface= ! thomecache src-address-list=CLIENTES

;;; Fluxo DNS p/ThomeCache


chain=prerouting dst-address=!201.90.0.2 protocol=udp dst-port=53 action=mark-routing
new-routing-mark=Thome passthrough=yes in-interface= ! thomecache src-address-
list=CLIENTES

chain=prerouting dst-address=!201.90.0.2 protocol=tcp dst-port=53 action=mark-routing


new-routing-mark=Thome passthrough=yes in-interface= ! thomecache src-address-
list=CLIENTES

;;; CACHE FULL


chain=postrouting dscp=12 action= mark-packet new-packet-mark=hit-thome
passthrough=no

7º) IP > Routes


dst-address=0.0.0.0/0 gateway=201.90.0.2 routing-mark=Thome scope=30 target-scope=10
distance=1
8º) Queues

VERSAO mikrotik 5.x


queue type
name=PCQ kind=pcq pcq-rate=5M pcq-classifier=dst-address

queue tree
name=Cache_full parent=global-out packet-mark=hit-thome queue=PCQ priority=8 limit-at=0
max-limit=20M burst-limit=0 burst-threshold=0 burst-time=0s

VERSAO mikrotik 6.x


queue type
name=PCQ kind=pcq pcq-rate=5M pcq-classifier=dst-address

queue simple
name=Cache_full max-limit=100M/100M packet-marks=hit-thome priority=1/1 queue=PCQ
target="0.0.0.0/0" total-priority=1

(IMPORTANTE)
System > Schedule (para deixar o cachefull sempre em primeiro da lista da queue simpe, senão não funciona)
Adicione uma regra:
name=CacheFullPrimeiro Start Time=startup Interval=00:00:10
On Event:
/queue simple move [find name="Cache_full"] [:pick [find] 0]
Caso precise desabilitar as regras do ThomeCache se ouver falta de enrgia, configure
o mikrotik para fazer isto automaticamente, siga:

8º) Tools > Netwatch

Host=201.90.0.2 interval=00:00:03 timeout=5000

UP
ip firewall mangle set [ find new-routing-mark=Thome ] disabled=no
ip route set [ find routing-mark=Thome ] disabled=no

DOWN
ip firewall mangle set [ find new-routing-mark=Thome ] disabled=yes
ip route set [ find routing-mark=Thome ] disabled=yes

Teste retirando o cabo de rede do ThomeCache e repare no Mikrotik a Desabilitação automatica


em 5s e conecte novamente o cabo e verar a abilitação das regras novamente.
CONFIGURAÇÕES NO THOMECACHE

1º) ACESSE VIA SSH


Mikrotik: Tolls > Telnet > SSH
IP: 201.90.0.2
User: root
pass: 123

2º) Alterar DNS


Acesse o Menu principal
Opçao: Outros > DNS
e altere Primario e Secundario

Indicamos o programa para você verificar um DNS mais estavel


chamado DNS Benchmark neste link: https://www.grc.com/dns/benchmark.htm
Para testar, clique em "Run Benchmar k"
Ao ter minar os testes, pe gue os dois primeiros ips, e adicione no
thomecache em Outros > DNS e no mikrotik em IP > DNS

3º) ATIVANDO VELOCIMETROS UPLOAD e DOWNLOAD


No menu do T homeCache
Opçao: Outros > VELOCIMETRO > Ativar
OPCIONAL – REGRAS CACHE FULL COM VÁRIOS CONTROLE

/ppp profile
add address-list=Clientes-512k comment="==Planos 512k==" name="Plano 512k" rate-limit=512k/750k
add address-list=Clientes-750k comment="==Planos 750k==" name="Plano 750k" rate-limit=512k/750k
add address-list=Clientes-1M comment="==Planos 1M==" name="Plano 1M" rate-limit=600k/1M
add address-list=Clientes-1.5M comment="==Planos 1.5M==" name="Plano 1.5 M" rate-limit=600k/1500k
add address-list=Clientes-2M comment="==Planos 2M==" name="Plano 2M" rate-limit=600k/2M
add address-list=Clientes-3M comment="==Planos 3M==" name="Plano 3M" rate-limit=600k/3M
add address-list=Clientes-5M comment="==Planos 5M==" name="Plano 5M" rate-limit=600k/5M
add address-list=Clientes-3M comment="==Planos 4M==" name="Plano 4M" rate-limit=600k/4M

/ip firewall mangle


add action=mark-packet chain=postrouting comment="==Thome Cache Full==" disabled=yes dscp=12 dst-
address-list=Clientes-1.5M new-packet-mark=Clientes-1.5M
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-1M new-packet-
mark=Clientes-1M
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-2M new-packet-
mark=Clientes-2M
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-3M new-packet-
mark=Clientes-3M
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-4M new-packet-
mark=Clientes-4M
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-5M new-packet-
mark=Clientes-5M
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-750k new-
packet-mark=Clientes-750k
add action=mark-packet chain=postrouting disabled=yes dscp=12 dst-address-list=Clientes-512k new-
packet-mark=Clientes-512k

/queue simple
add name=Clientes-512k packet-marks=Clientes-512k queue=Clientes-512k/Clientes-512k
target="0.0.0.0/0"
add name=Clientes-750k packet-marks=Clientes-750k queue=Clientes-750k/Clientes-750k
target="0.0.0.0/0"
add name=Clientes-1M packet-marks=Clientes-1M queue=Clientes-1M/Clientes-1M target="0.0.0.0/0"
add name=Clientes-1.5M packet-marks=Clientes-1.5M queue=Clientes-1.5M/Clientes-1.5M
target="0.0.0.0/0"
add name=Clientes-2M packet-marks=Clientes-2M queue=Clientes-2M/Clientes-2M target="0.0.0.0/0"
add name=Clientes-3M packet-marks=Clientes-3M queue=Clientes-3M/Clientes-3M target="0.0.0.0/0"
add name=Clientes-4M packet-marks=Clientes-4M queue=Clientes-4M/Clientes-4M target="0.0.0.0/0"
add name=Clientes-5M packet-marks=Clientes-5M queue=Clientes-5M/Clientes-5M target="0.0.0.0/0"

/system scheduler
add interval=10s name=CacheFullPrimeiro on-event="/queue simple move [find name=\
\"Clientes-512k\"] [:pick [find] 0]\r\
\n/queue simple move [find name=\"Clientes-750k\"] [:pick [find] 1]\r\
\n/queue simple move [find name=\"Clientes-1M\"] [:pick [find] 2]\r\
\n/queue simple move [find name=\"Clientes-1.5M\"] [:pick [find] 3]\r\
\n/queue simple move [find name=\"Clientes-2M\"] [:pick [find] 4]\r\
\n/queue simple move [find name=\"Clientes-3M\"] [:pick [find] 5]\r\
\n/queue simple move [find name=\"Clientes-4M\"] [:pick [find] 6]\r\
\n/queue simple move [find name=\"Clientes-5M\"] [:pick [find] 7]" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
start-time=startup