You can configure the Cisco IOS software to redistribute information from one routing protocol to another. For example, you
can configure a device to readvertise EIGRP-derived routes using RIP or to readvertise static routes using EIGRP. Redistribution
from one routing protocol to another can be configured in all IP-based routing protocols.
You can also conditionally control the redistribution of routes between routing domains by configuring route maps between
two domains. A route map is a route filter that is configured with permit and deny statements, match and set clauses, and
sequence numbers. To define a route map for redistribution, use the
route-map command in global configuration mode.
The metrics of one routing protocol do not necessarily translate into the metrics of another. For example, the RIP metric
is hop count and the EIGRP metric is a combination of five metric values. In such situations, a dynamic metric is assigned
to the redistributed route. Redistribution in these cases should be applied consistently and carefully in conjunction with
inbound filtering to avoid the creation of routing loops.
The following examples illustrate the use of redistribution with and without route maps. The following example shows how
to redistribute all OSPF routes into EIGRP:
Router(config)# router eigrp 1
Router(config-router)# redistribute ospf 101
Router(config-router)# exit
The following example shows how to redistribute RIP routes, with a hop count equal to 1, into OSPF. These routes will be
redistributed into OSPF as external LSAs with a metric of 5, metric-type of type 1, and a tag equal to 1.
Router(config)# router ospf 1
Router(config-router)# redistribute rip route-map rip-to-ospf
Router(config-router)# exit
Router(config)# route-map rip-to-ospf permit
Router(config-route-map)# match metric 1
Router(config-route-map)# set metric 5
Router(config-route-map)# set metric-type type 1
Router(config-route-map)# set tag 1
Router(config-route-map)# exit
The following example shows how to redistribute OSPF learned routes with tag 7 as a RIP metric of 15:
Router(config)# router rip
Router(config-router)# redistribute ospf 1 route-map 5
Router(config-router)# exit
Router(config)# route-map 5 permit
Router(config-route-map)# match tag 7
Router(config-route-map)# set metric 15
The following example shows how to redistribute OSPF intra-area and inter-area routes with next-hop routers on serial interface
0/0 into BGP with a metric of 5:
Router(config)# router bgp 50000
Router(config-router)# redistribute ospf 1 route-map 10
Router(config-router)# exit
Router(config)# route-map 10 permit
Router(config-route-map)# match route-type internal
Router(config-route-map)# match interface serial 0
Router(config-route-map)# set metric 5
The following example redistributes two types of routes into the integrated IS-IS routing table (supporting both IP and CLNS).
The first type is OSPF external IP routes with tag 5; these routes are inserted into Level 2 IS-IS link-state packets (LSPs)
with a metric of 5. The second type is ISO-IGRP-derived CLNS prefix routes that match CLNS access list 2000; these routes
are redistributed into IS-IS as Level 2 LSPs with a metric of 30.
Router(config)# router isis
Router(config-router)# redistribute ospf 1 route-map 2
Router(config-router)# redistribute iso-igrp nsfnet route-map 3
Router(config-router)# exit
Router(config)# route-map 2 permit
Router(config-route-map)# match route-type external
Router(config-route-map)# match tag 5
Router(config-route-map)# set metric 5
Router(config-route-map)# set level level-2
Router(config-route-map)# exit
Router(config)# route-map 3 permit
Router(config-route-map)# match address 2000
Router(config-route-map)# set metric 30
Router(config-route-map)# exit
In the following example, OSPF external routes with tags 1, 2, 3, and 5 are redistributed into RIP with metrics of 1, 1,
5, and 5, respectively. The OSPF routes with a tag of 4 are not redistributed.
Router(config)# router rip
Router(config-router)# redistribute ospf 101 route-map 1
Router(config-router)# exit
Router(config)# route-map 1 permit
Router(config-route-map)# match tag 1 2
Router(config-route-map)# set metric 1
Router(config-route-map)# exit
Router(config)# route-map 1 permit
Router(config-route-map)# match tag 3
Router(config-route-map)# set metric 5
Router(config-route-map)# exit
Router(config)# route-map 1 deny
Router(config-route-map)# match tag 4
Router(config-route-map)# exit
Router(config)# route map 1 permit
Router(config-route-map)# match tag 5
Router(config-route-map)# set metric 5
Router(config-route-map)# exit
The following example shows how a route map is referenced by using the
default-information router configuration command. Such referencing is called conditional default origination. OSPF will generate the default
route (network 0.0.0.0) with a type 2 metric of 5 if 172.16.0.0 is in the routing table.
Router(config)# route-map ospf-default permit
Router(config-route-map)# match ip address 1
Router(config-route-map)# set metric 5
Router(config-route-map)# set metric-type type-2
Router(config-route-map)# exit
Router(config)# access-list 1 172.16.0.0 0.0.255.255
Router(config)# router ospf 101
Router(config-router)# default-information originate route-map ospf-default