Route redistribution is the black art of taking routes learned from one routing protocol, and injecting them into the advertisements of another routing protocol. Say you’ve got an OSPF network and and EIGRP network, side by side. The OSPF network runs 10.110.0.0/16 subnets. The EIGRP network runs 10.90.0.0/16 subnets. As is, 10.110.0.0/16 can’t get to 10.90.0.0/16, and vice-versa. To bridge the gap between the 2 networks, you can install a router that runs both routing protocols. Then, router can redistribute the OSPF-learned routes in to EIGRP, and vice-versa. In this way, 10.110.0.0/16 and 10.90.0.0/16 can route to one another.
Now as you might imagine, there’s a lot to this, and it can get sticky. For example, mutual redistribution can cause routing loops if you don’t get your metrics correct and don’t filter who’s redistributing which routes into where.
The “redistribute” command within a routing process paragraph is the key one. If, under “router ospf 23” we added the line “redistribute static”, static routes on that router would be redistributed into the OSPF 23 process. If under “router eigrp 1” we were to say “redistribute ospf 23”, OSPF routes from the OSPF process would be redistributed into EIGRP AS 1. Other redistribute command parameters follow:
- router eigrp 1
redistribute ospf 1 metric 1544 5 255 1 1500
This would redistribute routes from the OSPF 1 process into EIGRP AS 1. When these routes redistributed from OSPF hit the EIGRP topology table, they will have the metrics of 1544 bandwidth, 5 delay, 255 reliability, 1 load and 1500 MTU.
The redistributed routes will show up as external EIGRP routes with an administrative distance of 170 (D EX).
- router ospf 1
redistribute eigrp 1 subnets
This would redistribute router from EIGRP AS 1 into OSPF. The default OSPF weight of 20 will be assigned to these redistributed routes. The keyword “subnets” implies that subnets will also be redistributed (not merely classful routes). OSPF will only redistribute classful networks by default.
The redistributed routes will show up as external type 2 routes in OSPF.
- router rip
redistribute eigrp 1 metric 4
redistribute ospf 1 metric 5
This will redistribute routes from EIGRP AS 1 into RIP, assigning a RIP metric of 4. OSPF process 1 routes will be redistributed into RIP with a metric of 5.
- Note that RIP and EIGRP have no default metrics for redistribution – you need to set them, all 5 in the case of EIGRP, even when default K-values where only bandwidth and delay metrics are relevant. OSPF has 2 defaults – cost of 20 for interior gateway protocols, and 1 for BGP. (And although the book doesn’t mention it, I know from practical experience that when redistributing static routes into EIGRP, you only need to “redistribute static”, no metrics required. The book’s sort of misleading in that regard.)
Assuming you aren’t filtering what routes you will redistribute, the router will use the following logic to determine what will be redistributed:
- All routes in the routing table learned by the routing protocol that’s being redistributed.
- All connected subnets matched by that routing protocol’s network commands. Which makes sense, but might throw you as you’ll see “C” routes being redistributed.
There are 3 different ways that you can set the metrics on a redistributed route (listed in precedence order):
- From the redistribute command, call a route-map. Within the route-map, set metrics. This gives you the flexibility to change metrics per route as you see fit. Ergo, you could have multiple route-map paragraphs with different network being assigned different metrics as they are redistributed.
- Use the “metric” option on the redistribute command, as discussed above.
- Use the “default-metric” command in the router paragraph. This command will set the metric for all redistributed routes that were not set either with a route-map or “metric” option.
In addition to setting the metrics, you can set the route types for redistributed routes as follows:
- RIP has no default metric, and no concept of an internal route.
- EIGRP has no default metric, and only one type of external route (as mentioned above, D EX routes, AD of 170.)
- OSPF has a default metric of 20 for routes coming in from IGP’s, and 1 for routes redistributed from BGP. It has 2 types of external routes, E1 and E2, with E2 being the default.
- IS-IS has a default metric of 0, with external types of L1 (default), L2, L1/L2 and external.