Codigo load balance com Marcação de pacotes !
Pessoal, eu sou meio leigo ainda em relação ao MK mas, tenho um script pronto , deixarei ele com algums parenteses para guiar melhor aonde voces deveram modificar de acordo com as configurações de seus respectivos MK. COPIEM PARA O BLOCO DE NOTAS PARA UMA MELHOR VISUALIZAÇÃO,SÓ APAGUEM O QUE ESTÁ ENTRE PARENTESES.
se houver algum erro por favor postem para um melhor funcionamento. :itsme:
====================================================
(NO IN-INTERFACE PONHA O NOME DO DA SAIDA PARA CLIENTES)
/ ip firewall mangle
add chain=prerouting in-interface=Local connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=odd passthrough=yes comment="Balanceamento de carga" disabled=no
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing new-routing-mark=odd passthrough=no comment="" disabled=no
add chain=prerouting in-interface=Local connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=even passthrough=yes comment="" disabled=no
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing new-routing-mark=even passthrough=no comment="" disabled=no
(NO TO-ADDRESSES PONHA O ENDEREÇO PONHA O Nº DO IP DA SUA SAIDA PARA CLIENTES)
/ ip firewall nat
add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.80.1.254 to-ports=0-65535 comment="Balanceamento de carga" disabled=no
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.80.1.254 to-ports=0-65535 comment="outro" disabled=no
(NA GATEWAY PONHA O ENDEREÇO DOS LINKS DE SUA INTERNET.) ("NOTA = O "COMMENT" VOCE PODE POR O NOME DO MODEM OU O QUAL DESEJAR")
/ ip route
add dst-address=0.0.0.0/0 gateway=10.15.40.254 scope=255 target-scope=10 routing-mark=odd comment="GW Planet" disabled=no
add dst-address=0.0.0.0/0 gateway=10.15.30.254 scope=255 target-scope=10 routing-mark=even comment="GW SpeedStream" disabled=no
add dst-address=0.0.0.0/0 gateway=10.15.40.254 scope=255 target-scope=10 comment="Link Principal" disabled=yes
(SE TIVER UMA REGRA NAT CRIADO DESABILITE-O EM CASO DE MAL FUNCIONAMENTO)
sofrendo pra fazer o balance
Citação:
Postado originalmente por
rps67
O Load Balance por nth requer muito conhecimento e dedicação para deixá-lo rodando tudo certim. Você terá que criar excessões nas regras pra Bancos, etc.
Faça por rotas estaticas, tipo:
link 01 default
link 02 msn, orkut, etc...
e monte o script de monitoramento pra quando um cair o outro assumir e vice versa.
amigo, to tentando fazer um load balance com 2 ADSL, achei interessante como você falou sobre link 01 default e 02 man, orkut, etc....
como faço isso? tens algum link que eu possa ver os scripts???