# Recursive routing with marking

**URL:** <https://forum.mikrotik.com/t/recursive-routing-with-marking/169122>\
**Category:** Beginner Basics\
**Created:** [August 28, 2023, 1:14am UTC](https://forum.mikrotik.com/t/recursive-routing-with-marking/169122 "2023-08-28T01:14:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Filo](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/filo/32/2918_2.png) [@Filo](https://forum.mikrotik.com/u/Filo)\
**Post date:** [August 28, 2023, 9:28am UTC](https://forum.mikrotik.com/t/recursive-routing-with-marking/169122/2 "2023-08-28T09:28:46Z")

</div>

Hi,

it’s a bit out of context but…  
Basically recursive routing is done because:

- MikroTik is able to check if a GATEWAY is alive and can handle routing based on the result (let’s say: PING OK / PING NOT OK)

This does not necessarlily mean that the INTERNET is alive on that gateway.

So what these entries are doing is set up a route to 8.8.8.8 and 8.8.8.4 in the ISP-Outbreak-Interfaces.  
The second part - as you might have seen - is missing “dst-address”, which means it will be the DEFAULT route.  
As a gateway they setup 8.8.8.8 and / or 8.8.8.4 recursively, so that only when those hosts are pingeble the route becomes active.  
Primary and Secondary ISP is then managed by the “distance” - the lower the higher the priority.

This is done mainly because it is not possible to check the route depending on hosts AFTER the gateway.

**Falling back to your question:** We need to define the routing table to make sure we can create a corresponding MANGLE-Roule (“mark routing”) in the firewall. This is the only way to make traffic to be sent over a specific route then - all has to correspond.  
  
  
Hope this helped.

If you are as confused about this and rather like to check a host BEHIND a specific gateway - why not try this method instead, I recently discovered:

[http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1](http://forum.mikrotik.com/t/simpler-failover-for-two-gateways-i-found-working/169108/1)

Best regards,  
Martin!

---

_[View the full topic](https://forum.mikrotik.com/t/recursive-routing-with-marking/169122)._
