la no dhcp client marque a distancia como 1 ou 2 ou 3 e assim por diante
Versão Imprimível
la no dhcp client marque a distancia como 1 ou 2 ou 3 e assim por diante
Tente isso aqui... mais preste bem atenção.
www.youtube.com/watch?v=AdvS3opT5ug
Talvez seja os gateway que são iguais... Tenta isso aqui https://youtu.be/AdvS3opT5ug me ajudou, pode ser que te ajude. Se ajudar ou não comenta ai.
Senhores, estava pesquisando por balance com link dinamico e achei esse escript que ensina como fazer achei bom e bem simples apenas a questão final e um script para pesquisar os gatway a cada 2 segundos. então a questão toda se resume ao script no final do texto .
2 WAN DYNAMIC DHCP-CLIENT LOAD BALANCE
Mikrotik Dynamic Dhcp-Client Load balance script.
Kindly do change the following as mention below.
ether1 = ether1-gateway
ether2 = ether2-gateway
ether3 = ether3
Ether3 is a Lan Interface you can rename after complete 7 steps .
Step 1.
Add dynamic client on ether1 & ether2 (WAN1 & WAN2)
/ip dhcp-client
add add-default-route=no dhcp-options=hostname,clientid disabled=no interface=ether1-gateway use-peer-dns=no use-peer-ntp=no
add add-default-route=no dhcp-options=hostname,clientid disabled=no interface=ether2-gateway use-peer-dns=no use-peer-ntp=no
Step 2: Add Lan Interface IP . ( ether3 )
/ip address
add address=192.168.88.1/24 interface=ether3 network=192.168.88.0
Step 3: Add Firewall Nat rule.
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-gateway
add action=masquerade chain=srcnat out-interface=ether2-gateway
Step 4: Add firewall Mangle Rules
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Load Balance" connection-state=new in-interface=ether1-gateway new-connection-mark=ether1_conn
add action=mark-connection chain=prerouting connection-state=new in-interface=ether2-gateway new-connection-mark=ether2_conn
add action=mark-routing chain=output connection-mark=ether1_conn new-routing-mark=to_ether1
add action=mark-routing chain=output connection-mark=ether2_conn new-routing-mark=to_ether2
add action=mark-connection chain=prerouting connection-state=new dst-address-type=!local in-interface=ether3 new-connection-mark=ether1_conn per-connection-classifier=both-ports:2/0
add action=mark-connection chain=prerouting connection-state=new dst-address-type=!local in-interface=ether3 new-connection-mark=ether2_conn per-connection-classifier=both-ports:2/1
add action=mark-routing chain=prerouting connection-mark=ether1_conn in-interface=ether3 new-routing-mark=to_ether1
add action=mark-routing chain=prerouting connection-mark=ether2_conn in-interface=ether3 new-routing-mark=to_ether2
Step 5: Add Routes ( Setting temporary gateway)
/ip route
add check-gateway=ping comment="Ether1-Wan routing gateway" distance=1 gateway=192.168.0.1 routing-mark=to_ether1
add check-gateway=ping comment="Ether2-Wan routing gateway" distance=1 gateway=192.168.1.1 routing-mark=to_ether2
add comment=Ether1-Wan distance=1 gateway=192.168.0.1
add comment=Ether2-Wan distance=2 gateway=192.168.1.1
step 6: Create New Script with name ChangeGateways and copy below lines.
:global newgw [/ip dhcp-client get [find interface="ether1-gateway" ] gateway ]
:global activegw [/ip route get [/ip route find comment="Ether1-Wan"] gateway ]
:if ($newgw != $activegw) do={
/ip route set [find comment="Ether1-Wan"] gateway=$newgw
/ip route set [find comment="Ether1-Wan routing gateway"] gateway=$newgw
}
:global newgw [/ip dhcp-client get [find interface="ether2-gateway" ] gateway ]
:global activegw [/ip route get [/ip route find comment="Ether2-Wan"] gateway ]
:if ($newgw != $activegw) do={
/ip route set [find comment="Ether2-Wan"] gateway=$newgw
/ip route set [find comment="Ether2-Wan routing gateway"] gateway=$newgw
}
Step 7: Final Step.
Now add schedule to run this script with 2 seconds timmer ..
Best Regard’s
Abubaker Siddiq Lasania
Virtual IT Support
Se você tem 2 gateways IGUAIS (mesmo endereço de IP) em 2 interfaces DIFERENTES, e se esse gateway é sempre o mesmo, então é só ir la nas configurações do DHCP Client e na opção de "Add default route" coloca "no", e cria rotas nomeadas com o <ip>%<interface> para cada link.
Por exemplo, digamos que o gateway é sempre 200.200.200.200, para 2 links diferentes. Um deles na ether1, e outro na ether2. Como você escolhei não adicionar rota padrão pelo DHCP client, você agora vai adicionar elas manualmente, e la no "Gateway" da rota, para a rota nomeada do link da ether1, coloca assim "200.200.200.200%ether1" e na rota nomeada do link da ether2 coloca "200.200.200.200%ether2".
Agora pode fazer o balance PCC do jeito que quiser pelo mangle, pois ja tem as rotas nomeadas para usar nas marcações.