Redirección Cloud DDNS

You might also like

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

Hi everyone, I have a situation.

In my setup, I have two links with internet and


need choose one of those to be my cloud ip. How I make this ?

Thanks

dynamic address list:


/ip firewall address-list
add address=cloud.mikrotik.com list=mikrotik-cloud
add address=cloud2.mikrotik.com list=mikrotik-cloud
An address-list configured this way is automatically updated with dynamic entries
representing all the IP numbers to which these fqdns resolve.

Then, use a mangle rule to assign a routing-mark to all packets the router itself
sends towards these destinations:
/ip firewall mangle
add chain=output dst-address-list=mikrotik-cloud action=mark-routing new-routing-
mark=via-wan-x

The next thing is to add a route to actually use the routing-mark assigned:
/ip route
add routing-mark=via-wan-x gateway=ip.of.wan-x.gw

The above seems to be all, but nope, two more points come into play that are not
obvious:
if wan-x goes down, no active route with routing-mark=via-wan-x will remain, and
the routing will fall back to the main routing table in such case. You can prevent
this by adding
either a type=blackhole default route with routing-mark=via-wan-x and distance=10
or a routing rule:
/ip route rule
add routing-mark=via-wan-x action=lookup-only-in-table table=via-wan-x
the routing in chain output (packets originated by the router itself) is done
before the packets pass through the mangle table, so the source address is chosen
according to the default route currently active. If a routing-mark is assigned in
the output chain of mangle, the routing is repeated but the source address of the
packet doesn't change. So you have to add a src-nat or masquerade rule to change
this:
/ip firewall nat
add chain=srcnat action=masquerade routing-mark=via-wan-x src-address-type=local

You might also like