Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

# ------ Datos del DHCP-Client ------

:global NombreInterfaz "ether3"

# ------ Datos de la Ruta Recursiva ------


:global ComentarioRutas "Ruta Recursiva - Link3"
:global IPMonitoreo "1.1.1.1"
:global DistanciaRuta "3"

/ip dhcp-client
add add-default-route=no dhcp-options=hostname,clientid disabled=no
interface=$NombreInterfaz script="{\r\
\n :local count [/ip route print count-only where (comment=\"No Tocar |
$ComentarioRutas\" and dst-address!=0.0.0.0/0)]\r\
\n :if (\$bound=1) do={\r\
\n :if (\$count = 0) do={\r\
\n /ip route add ds=$IPMonitoreo gateway=\$\"gateway-address\"
comment=\"No Tocar | $ComentarioRutas\" scope=10\r\
\n /ip route add ds=0.0.0.0/0 check-gateway=ping
distance=$DistanciaRuta gateway=$IPMonitoreo comment=\"No Tocar |
$ComentarioRutas\" scope=10\r\
\n } else={\r\
\n :if (\$count > 2) do={\r\
\n :local test [/ip route find where (comment=\"No Tocar |
$ComentarioRutas\" and dst-address!=0.0.0.0/0)]\r\
\n :if ([/ip route get \$test gateway] != \$\"gateway-address\")
do={\r\
\n /ip route set \$test gateway=\$\"gateway-address\"\r\
\n }\r\
\n } else={\r\
\n :error \"Hay demasiadas rutas.\"\r\
\n }\r\
\n }\r\
\n } else={\r\
\n /ip route remove [find comment=\"No Tocar | $ComentarioRutas\"]\r\
\n }\r\
\n}"

You might also like