redistribute
To redistribute routes from one routing domain into another routing domain, use the redistribute router configuration command. To disable redistribution, use the no form of this command.
redistribute protocol [process-id] {level-1 | level-1-2 | level-2} [metric metric-value]
[metric-type type-value] [match {internal | external 1 | external 2}]
[tag tag-value] [route-map map-tag] [weight weight] [subnets]
no redistribute protocol [process-id] {level-1 | level-1-2 | level-2} [metric metric-value]
[metric-type type-value] [match {internal | external 1 | external 2}]
[tag tag-value] [route-map map-tag] [weight weight] [subnets]
Syntax Description
Defaults
Route redistribution is disabled.
protocol---No source protocol is defined.
process-id---No process ID is defined.
metric metric-value---0
metric-type type-value---Type 2 external route
match internal | external---internal, external 1, external 2
external type-value---internal
tag tag-value---If no value is specified, the remote autonomous system number is used for routes
from BGP and EGP; for other protocols, the default is 0.
route-map map-tag---If the route-map argument is not entered, all routes are redistributed; if no
map-tag value is entered, no routes are imported.
weight weight---No network weight is defined.
subnets---No subnets are defined.Command Mode
Router configuration
Usage Guidelines
This command first appeared in Cisco IOS Release 10.0.
Changing or disabling any keyword will not affect the state of other keywords.
A router receiving a link-state protocol (LSP) with an internal metric will consider the cost of the route from itself to the redistributing router plus the advertised cost to reach the destination. An external metric only considers the advertised metric to reach the destination.
Routes learned from IP routing protocols can be redistributed at level-1 into an attached area or at level-2. The keyword level-1-2 allows both in a single command.
Redistributed routing information should always be filtered by the distribute-list out router configuration command. This ensures that only those routes intended by the administrator are passed along to the receiving routing protocol.
Whenever you use the redistribute or the default-information router configuration commands to redistribute routes into an OSPF routing domain, the router automatically becomes an Autonomous System Boundary Router (ASBR). However, an ASBR does not, by default, generate a default route into the OSPF routing domain.
When routes are redistributed between OSPF processes, no OSPF metrics are preserved.
When routes are redistributed into OSPF and no metric is specified in the metric keyword, the default metric that OSPF uses is 20 for routes from all protocols except BGP route, which gets a metric of 1.
When redistributing routes into OSPF, only routes that are not subnetted are redistributed if the subnets keyword is not specified.
The only connected routes affected by this redistribute command are the routes not specified by the network command.
You cannot use the default-metric command to affect the metric used to advertise connected routes.
Note The metric value specified in the redistribute command supersedes the metric value specified using the default-metric command.
Default redistribution of IGPs or EGP into BGP is not allowed unless default-information originate is specified.
When routes are redistributed into OSPF and no metric is specified in the metric keyword, the default metric that OSPF uses is 20 for routes from all protocols except BGP route, which gets a metric of 1.
Examples
The following are examples of the various configurations you would use to redistribute one routing protocol into another routing protocol.
The following example configuration causes OSPF routes to be redistributed into a BGP domain:
router bgp 109 redistribute ospf...The following example configuration causes IGRP routes to be redistributed into an OSPF domain:
router ospf 110 redistribute igrp...The following example causes the specified IGRP process routes to be redistributed into an OSPF domain. The IGRP-derived metric will be remapped to 100 and RIP routes to 200.
router ospf 109 redistribute igrp 108 metric 100 subnets redistribute rip metric 200 subnetsIn the following example, BGP routes are configured to be redistributed into IS-IS. The link-state cost is specified as 5, and the metric type will be set to external, indicating that it has lower priority than internal metrics.
router isis redistribute bgp 120 metric 5 metric-type external