load (1)

Montar load balance PCC no MikroTik

ESTRUTURA:

LAN: 10.0.0.0/27
ISP1: 192.168.0.0/27
ISP2: 192.168.3.0/24

ENDERECOS:

/ip address
add address=10.0.0.1/27 broadcast=10.0.0.31 comment="" disabled=no interface=LAN network=10.0.0.0

add address=192.168.0.10/27 broadcast=192.168.0.31 comment="" disabled=no interface=ISP1 network=192.168.0.0

add address=192.168.3.1/24 broadcast=192.168.3.255 comment="" disabled=no interface=ISP2 network=192.168.3.0

ROTAS:

/ip route
add check-gateway=ping comment="Rota Saida GVT para Load Balance" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.3.20 routing-mark=ISP2_traffic scope=30 target-scope=10

add check-gateway=ping comment="Rota saida Velox para Load Balance" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.0.1 routing-mark=ISP1_traffic scope=30 target-scope=10

add check-gateway=ping comment="Rota saida Velox/GVT sem Load Balance" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=192.168.0.1,192.168.3.20 scope=30 target-scope=10

NAT:

/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=ISP1

add action=masquerade chain=srcnat comment="" disabled=no out-interface=ISP2

MANGLE:

/ip firewall mangle
add action=mark-connection chain=input comment="Marca Conexoes de entrada para que voltem pelo mesmo lugar" disabled=no in-interface=ISP1 new-connection-mark=ISP1_conn passthrough=yes

add action=mark-connection chain=input comment="" disabled=no in-interface=ISP2 new-connection-mark=ISP2_conn passthrough=yes

add action=mark-connection chain=output comment="Inicia o balance PCC" connection-state=new disabled=no dst-address=!10.0.0.0/27 new-connection-mark=ISP1_conn passthrough=yes per-connection-classifier=both-addresses:2/0

add action=mark-connection chain=output comment="" connection-state=new disabled=no dst-address=!10.0.0.0/27 new-connection-mark=ISP2_conn passthrough=yes per-connection-classifier=both-addresses:2/1

add action=mark-routing chain=output comment="Retorna as conexoes marcadas no inicio, pelo mesmo lugar que entraram" connection-mark=ISP1_conn disabled=no new-routing-mark=ISP1_traffic passthrough=yes

add action=mark-routing chain=output comment="" connection-mark=ISP2_conn disabled=no new-routing-mark=ISP2_traffic passthrough=yes

add action=mark-connection chain=prerouting comment="Load Balance (PCC)" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=ISP1_conn passthrough=yes per-connection-classifier=both-addresses:2/0

add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=ISP2_conn passthrough=yes per-connection-classifier=both-addresses:2/1

add action=mark-routing chain=prerouting comment="Conexoes do load balance para as novas tabelas do PCC" connection-mark=ISP1_conn disabled=no in-interface=LAN new-routing-mark=ISP1_traffic passthrough=yes

add action=mark-routing chain=prerouting comment="" connection-mark=ISP2_conn disabled=no in-interface=LAN new-routing-mark=ISP2_traffic passthrough=yes
Saiba mais…