Tutorial load balance
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 link” 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” 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 link que entraram” connection-mark=ISP1_conn disabled=no