TENHO 8 MODENS PRECISO FAZER O LOADBALANCE COM ESSES LINKS,
HÁ UM TUTORIAL NO FÓRUM COMO FAZER COM ATÉ 16 LINKS,
SÓ QUE NO TUTORIAL MOSTRA COM 3 LINKS.
MONTEI AS REGRAS COM OS 8 MODENS GOSTARIA QUE ME DIGAM SE ESTA CORRETA ESSAS REGRAS..
DESDE JÁ AGRADEÇO..
VERSAO 3.X
EthLinkA = Interface do primeiro link
EthLinkB = Interface do segundo link
EthLinkC = Interface do terceiro link
EthLinkD = Interface do quarto link
EthLinkE = Interface do quinto link
EthLinkF = Interface do sexto link
EthLinkG = Interface do setimo link
EthLinkH = Interface do oitavo link
EthClientes = Interface dos clientes
Quando em modo roteado:
10.1.10.129 = Ip do modem A
10.1.10.161 = Ip do modem B
10.1.10.193 = Ip do modem C
10.1.10.171 = Ip do modem D
10.1.10.182 = Ip do modem E
10.1.10.131 = Ip do modem F
10.1.10.141 = Ip do modem G
10.1.10.151 = Ip do modem H
Endereços das interfaces no Mikrotik ROS
10.1.10.130/27 = Ip da interface EthLinkA
10.1.10.162/27 = Ip da interface EthLinkB
10.1.10.194/27 = Ip da interface EthLinkC
10.1.10.172/27 = Ip da interface EthLinkD
10.1.10.183/27 = Ip da interface EthLinkE
10.1.10.132/27 = Ip da interface EthLinkF
10.1.10.142/27 = Ip da interface EthLinkG
10.1.10.152/27 = Ip da interface EthLinkH
=========
Vamos as regras e explanações sobre o sistema PCC
Em mangle
add action=accept chain=prerouting comment="SEM BALANCE" disabled=no dst-address-list=sem_balance in-interface=EthClientes
esta primera regra aceita as conexões para todos os ips de destino que se encontrarem na lista 'sem_balance' que irão sair pela rota padrão
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkA new-connection-mark=conn_na passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkB new-connection-mark=conn_nb passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkC new-connection-mark=conn_nc passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkD new-connection-mark=conn_na passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkE new-connection-mark=conn_na passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkF new-connection-mark=conn_na passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkG new-connection-mark=conn_na passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=EthLinkH new-connection-mark=conn_na passthrough=yes
cria as marcas (conn_na, conn_nb, conn_nc) para novas conexões em cada uma das interfaces (EthLinkA, EthLinkB, EthLinkC)
add action=mark-routing chain=output comment="" connection-mark=conn_na disabled=no new-routing-mark=to_ra passthrough=no
add action=mark-routing chain=output comment="" connection-mark=conn_nb disabled=no new-routing-mark=to_rb passthrough=no
add action=mark-routing chain=output comment="" connection-mark=conn_nc disabled=no new-routing-mark=to_rc passthrough=no
utiliza as marcações (conn_na, conn_nb, conn_nc) para criar as marcações das respectivas rotas (to_ra, to_rb, to_rc)
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=EthClientes new-connection-mark=conn_ma0 passthrough=yes per-connection-classifier=both-addresses:8/0
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=EthClientes new-connection-mark=conn_mb1 passthrough=yes per-connection-classifier=both-addresses:8/1
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=EthClientes new-connection-mark=conn_mc2 passthrough=yes per-connection-classifier=both-addresses:8/2
agora utilizando os classificadores (0,1,2 e portanto são 3) na interface de clientes criamos novas marcas de conexão (conn_ma0, conn_mb1, conn_mc2), notem que se tivessemos 4 links seria aquie que fariamos as alterações para (0,1,2,3 e portanto são 4) ficando 4/0, 4/1, 4/2, 4/3 ou ainda se tivessemos links assimétricos onde por exemplo:
LinkX de 512k
LinkY de 1024k
LinkZ de 2048k
somariamos todos os links e dividiriamos pelo valor do menor link então teriamos 3584k/512k=7 então teriamos 7 marcações de pcc indo de 7/0 até 7/6 das quais devemos direcionar a primeira pro link X, a segunda e terceira pro link Y e as quatro restantes para o link Z fazendo nosso sistema perfeitamente equilibrado, vale resaltar que sistemas do tipo ADSL não garantem a banda e portanto devemos fazer testes em cada um dos links para aferir as velocidades possíveis em cada um, já vi muitos casos onde um link desse tipo de 2Mb era melhor do que o de 4Mb da mesma operadora instalada no mesmo local, também se deve criar as marcações para input e output.
add action=mark-routing chain=prerouting comment="" connection-mark=conn_ma0 disabled=no in-interface=EthClientes new-routing-mark=to_nra passthrough=no
add action=mark-routing chain=prerouting comment="" connection-mark=conn_mb1 disabled=no in-interface=EthClientes new-routing-mark=to_nrb passthrough=no
add action=mark-routing chain=prerouting comment="" connection-mark=conn_mc2 disabled=no in-interface=EthClientes new-routing-mark=to_nrc passthrough=no
utilizando das novas marcações (conn_ma0, conn_mb1, conn_mc2) criamos uma nova marcação de rota na interface de clientes como (to_nra, to_nrb, to_nrc)
============================== ============================== ==========
Em nat
add action=masquerade chain=srcnat comment="MASCARAMENTO PCC" disabled=no out-interface=EthLinkA
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkB
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkC
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkD
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkE
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkF
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkG
add action=masquerade chain=srcnat comment="" disabled=no out-interface=EthLinkH
vale resaltar que o mascaramento pode ser feito de várias formas, indicando por exempo o ip da interface em src-nat, pela range de ips dos clientes e pela interface do link como acima.
========
Em rotas
add comment="" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=10.1.10.129 scope=30 target-scope=10
add comment="" disabled=no distance=3 dst-address=0.0.0.0/0 gateway=10.1.10.161 scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=10.1.10.193 scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=10.1.10.171 scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=10.1.10.182 scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=10.1.10.131 scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=10.1.10.141 scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=10.1.10.151 scope=30 target-scope=10
definimos 3 rotas padrão sendo que cada uma tem um custo diferente e portanto a primeira terá a preferencia, caso venha a faltar a segunda assume, em seguida a terceira
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.129 routing-mark=to_nra scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.161 routing-mark=to_nrc scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.193 routing-mark=to_nrb scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.171 routing-mark=to_nrb scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.182 routing-mark=to_nrb scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.131 routing-mark=to_nrb scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.141 routing-mark=to_nrb scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.1.10.151 routing-mark=to_nrb scope=30 target-scope=10
em seguida todas as 3 rotas que utilizam marca de rotas (to_nra, to_nrb, to_nrc) dividem a carga que foi previamente marcada pelo mangle
==============
Ainda é possível fazer com que o próprio Mikrotik ROS disque as conexões do tipo ADSL aumentando a eficiência do sistema (MODENS EM BRIDGE), sendo que neste caso é recomendado fazer o mascaramento por range de ips e não por interface e a indicação dos gateways por interface e não por ip, no caso de links dedicados é recomendável fazer a indicação do ip do gateway e não da interface.
Em nat
add action=masquerade chain=srcnat src-address=10.0.0.0/24 comment="MASCARAMENTO PCC" disabled=no
Em rotas
add comment="" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=EthLinkA scope=30 target-scope=10
add comment="" disabled=no distance=3 dst-address=0.0.0.0/0 gateway=EthLinkB scope=30 target-scope=10
add comment="" disabled=no distance=4 dst-address=0.0.0.0/0 gateway=EthLinkC scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=EthLinkA routing-mark=to_nra
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=EthLinkB routing-mark=to_nrb
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=EthLinkC routing-mark=to_nrc