Route redistribution (route redistribution) is a special and beloved Cisco exam subject. The properties of technologies are such that in addition to well-known routing loops within one domain / zone, there are also loops between several zones in the case of OSPF, as well as loops between domains in case of redistribution of routes from a domain with a single routing protocol to a domain with to others.

I have not found a definition for them in any standard, so I will call them inter-domain routing loops. Until recently, this feature was a mandatory element of the CCIE Lab Exam, but after the update, CCNP became part of the Route course.
The essence of the matter is that at the border of two domains, in order to avoid the formation of single point of failure, at least two routers can and must exist. But then the route injected into the OSPF domain by one Autonomous System Boarder Router (ASBR) gets to the second one, and it injects it back, into the EIGRP domain, forming a “long route” at best, and a routing loop at worst.
')
There are three ways to prevent the formation of such a loop:
- Using a larger metric
- Using Administrative Distance
- Using route filtering
I propose to talk about each of them, without going very deeply into the configuration. Traditionally, the understanding of technology - the key to a successful configuration.
Greater metric method
The method is to announce a route with a high metric value, obviously larger than the maximum metric of internal routes, to the appropriate domain. Then, having two identical routes with different metrics, the router will install the one that will have a smaller metric in the marshalling table — internal in concept.
The disadvantage of the method is that we choose this “obviously big metric” by ourselves. And if for some reason a route with a larger internal metric appears in the domain, the very loop that we are trying to get rid of will arise.
The illustration shows an example of using this method, in which EIGRP routes are advertised in the OFPS domain with metric 41026560, while OSPF domain routes are advertised in the EIGRP domain with metric 500.

As long as there are no internal metrics above 500 in the OSPF domain, and above 41026560 in the EIGRP domain, the method will work. After - no. The most difficult thing, of course, is to notice this moment.
The metrics for redistributing routes can be set using default metric:
router eigrp 1 default-metric 1500 10 255 1 1500 redistribute ospf 1
After that, all routes that are injected into the EIGRP from the OSPF domain receive a metric based on the values ​​of four of the five specified parameters:
Bandwidth: 1500
Delay: 10
Reliability: 255
Load: 1
MTU: 1500
If we go to allow redistribution of only part of the routes, we need to use the route map:
ip prefix-list match-ospf seq 5 permit 172.16.102.0/23 ge 25 le 26 ip prefix-list match-ospf seq 10 permit 172.16.106.0/23 ge 29 le 30 ! route-map set-metric permit 10 match ip address prefix-list match-ospf set metric 100 4444 255 1 1500 ! router eigrp 1 redistribute ospf 1 route-map set-metric
Administrative Distance Method
Administrative Distance (AD) is a value that determines which source of route information takes precedence if a route is announced from several such sources. When getting a route, before comparing the metrics, the router looks at the value of AD. If it is smaller, the route will be set to the routing table, even if its metric is larger.
Our goal is to make the router choose the internal route. In addition to the unreliable metric, this can be done by manipulating the values ​​of AD.

This is how the AD table looks for different sources of route information:
Connected | 0 |
Static | one |
EIGRP summary route | five |
eBGP | 20 |
EIGRP (internal) | 90 |
IGRP | 100 |
Ospf | 110 |
IS-IS | 115 |
Rip | 120 |
On-Demand Routing (ODR) | 160 |
EIGRP (external) | 170 |
iBGP | 200 |
Unreachable | 255 |
Note the various ADs for external and internal EIGRP routes. This protocol is beautiful! By designing it, Cisco has already taken care to protect against the formation of such loops, and by default external EIGRP routes have an AD equal to 170.
In this case, the behavior of routers in the EIGRP domain will be as follows:

Therefore, engineers serving the EIGRP domain can forget about this problem at all - it has already been solved for them.
In the case of a neighborhood with EIGRP, OSPF domain engineers also have nothing to worry about - AD also protects their network. When the OSPF route passes through the EIGRP zone and returns to the second ASBR, it will be injected (fu, you have a word, but excuse me - nothing better comes to mind) to the OSPF domain as the External EIGRP route with AD equal to 170. About ASBR knows the same route via OSPF protocol (it enters both zones at the same time), and AD for OSPF is 110. Therefore, an internal OSPF route will be installed in the routing table and no loop will be formed.
If you need to specify AD imperatively (neighborhood with a RIP domain, for example), in OSPF you can do it like this:
router ospf 1 distance ospf external 150 redistribute rip
Now all external routes that are injected into the OSPF domain from the RIP will have AD equal to 150, which is more than internal AD for OSPF. Loop formation is prevented.
Route filtering method
The essence of the method is to filter on the second ASBR routes that the first ASBR injects into the domain, and not to announce them in the source domain.

This can be done by “tagging” routes. When injected into the domain, the first ASBR assigns a label to the route. The second ASBR, when injecting routes into the source domain, filters out the "marked" routes and does not announce them.
Configuring the solution looks like this:
ASBR 1 configuration:
route-map set-tag-100 permit 10 set tag 100 ! router ospf 1 redistribute eigrp 1 subnets route-map set-tag-100
ASBR 2 configuration:
route-map stop-tag-100 deny 10 match tag 100 route-map stop-tag-100 permit 20 ! router eigrp 1 redistribute ospf 2 metric 1000 200 255 1 1500 route-map stop-tag-100 no auto-summary
Upon completion of the configuration, routes labeled 100 will be filtered by ASBR 2 when redistributed to the OSPF domain. And again, inter-domain routing loops are defeated.