Generar Script para DHCP, podemos generar 4 reglas.
PARA ISP-1
:local newgw [ip dhcp-client get [find interface="ether1_ISP1"] gateway];
:local routegw [/ip route get [find comment="ruta_isp1"] gateway ];
:if ($newgw != $routegw) do={
/ip route set [find comment="ruta_isp1"] gateway=$newgw;
};
PARA ISP-2
:local newgw [ip dhcp-client get [find interface="ether2_ISP2"] gateway];
:local routegw [/ip route get [find comment="ruta_isp2"] gateway ];
:if ($newgw != $routegw) do={
/ip route set [find comment="ruta_isp2"] gateway=$newgw;
}
Aplicar en Netwatch.
/ip route
add dst-address=8.8.8.8 gateway=192.168.2.1 comment="Check-ISP1"
add dst-address=8.8.4.4 gateway=192.168.10.1 comment="Check-ISP2"
/tool netwatch
add host=8.8.8.8 interval=10s \
down-script="/ip route set [find comment=ISP1] disabled=yes" \
up-script="ip route set [find comment=ISP1] disabled=no"
add host=8.8.4.4 interval=10s \
down-script="/ip route set [find comment=ISP2] disabled=yes" \
up-script="ip route set [find comment=ISP2] disabled=no"
No hay comentarios.:
Publicar un comentario