Академический Документы
Профессиональный Документы
Культура Документы
Se le llama conmutacion por error o Failover cuando un enlace deja de funcionar por cualquier
motivo y automaticamente cambia al enlace de backup o redundancia.
Este es mi primer post despues de mucho años de pertenecer a Taringa! como usuario
pasivo.
Espero que esto les sea de utilidad, es un desarrollo propio asi que si lo encuentran en otra
pagina es casualidad porque lo hice esta tarde en mi casa.
Failover para 2 enlaces de internet en Mikrotik RouterOS 3.30 (No se si sirve en otras
versiones, creo yo que si)
1-Primero creamos en el NAT las salidas a internet por nuestros proveedores (Debemos tener
configurado las interfaces con las direcciones IP correspondientes)
2-Configuramos el e-mail para que se nos envie los mails de alerta cuando uno de los enlaces
ha dejado de funcionar.
/tool e-mail
set server=65.55.96.11 username="TU USUARIO DE HOTMAIL" password="TU
CONTRASEÑA" from=<MIKROTIK>
Name= ISP1-UP
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=no
/ip firewall nat set [find comment="Internet - ISP2"] disabled yes
: log info "::::::::::::::: TRAFICO SALIENDO POR ISP 1 :::::::::::::::"
Name= ISP2-UP
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=yes
/ip firewall nat set [find comment="Internet - ISP2"] disabled=no
: log info "::::::::::::::: TRAFICO SALIENDO POR ISP 2 :::::::::::::::"
Name= ISP1-DOWN
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=yes
/ip firewall nat set [find comment="Internet - ISP2"] disabled=no
: log info "::::::::::::::: TRAFICO SALIENDO POR ISP 2, ISP 1 FUERA DE SERVICIO
:::::::::::::::"
/tool netwatch set [find comment="SALIDA ISP1"] disabled=yes
/tool netwatch set [find comment="SALIDA ISP2"] disabled=no
/tool e-mail send to="TU DIRECCION DE MAIL" subject="Proveedor 1 Fuera de Servicio"
body="Proveedor 1 Dejo de funcionar"
:log info "::::::::::::::: ALERTA ENVIADA :::::::::::::::"
Name= ISP2-DOWN
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=no
/ip firewall nat set [find comment="Internet - ISP2"] disabled=yes
: log info "::::::::::::::: TRAFICO SALIENDO POR ISP 1, ISP 2 FUERA DE SERVICIO
:::::::::::::::"
/tool netwatch set [find comment="SALIDA ISP2"] disabled=yes
/tool netwatch set [find comment="SALIDA ISP1"] disabled=no
/tool e-mail send to="TU DIRECCION DE MAIL" subject="Proveedor 2 Fuera de Servicio"
body="Proveedor 2 Dejo de funcionar"
:log info "::::::::::::::: ALERTA ENVIADA :::::::::::::::"
3-Creamos las reglas de Netwatch ( Esto es lo que esta comprueba los enlaces)(La primera
direccion IP es de google.com y la segunda de yahoo.com)
/tool netwatch
add comment="SALIDA ISP1" host=74.125.47.104 down-script="ISP1-DOWN" up-
script="ISP1-UP"
add comment="SALIDA ISP2" host=98.139.183.24 down-script="ISP2-DOWN" up-
script="ISP2-UP"