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]
Syntax Description
protocol Source protocol from which routes are being redistributed.
It can be one of the following keywords: bgp, egp, igrp, isis,
ospf, static [ip], connected, and rip. The keyword static [ip] is used to
redistribute IP static routes. The optional ip keyword is used
when redistributing into IS-IS. The keyword connected refers to routes which
are established automatically by virtue of having enabled IP on an interface.
For routing protocols such as OSPF and IS-IS, these routes will be redistributed
as external to the autonomous system. process-id (Optional) For bgp, egp, or igrp,
this is an autonomous system number, which is a 16-bit decimal number. level-1 For IS-IS, Level 1 routes are redistributed into
other IP routing protocols independently. level-1-2 For IS-IS, both Level 1 and Level 2 routes are
redistributed into other IP routing protocols. level-2 For IS-IS, Level 2 routes are redistributed into
other IP routing protocols independently. metric metric-value (Optional) Metric used for the redistributed route.
If a value is not specified for this option, and no value is specified
using the default-metric command, the default metric value is 0.
Use a value consistent with the destination protocol. metric-type type-value (Optional) For OSPF, the external link type associated
with the default route advertised into the OSPF routing domain. It can
be one of two values: 1—Type 1 external route 2—Type 2 external route If a metric-type is not specified, the Cisco
IOS software adopts a Type 2 external route. For IS-IS, it can be one of two values: internal—IS-IS metric which is < 63. external—IS-IS metric which is > 64 <
128. The default is internal. match {internal | external 1 |
external 2} (Optional) For OPSF, the criteria by which OSPF
routes are redistributed into other routing domains. It an be one of the
following: internal—Routes that are internal to a specific
autonomous system. external 1—Routes that are external to the autonomous
system, but are imported into OSPF as type 1 external route. external 2—Routes that are external to the autonomous
system, but are imported into OSPF as type 2 external route. tag tag-value (Optional) 32-bit decimal value attached to each
external route. This is not used by the OSPF protocol itself. It may be
used to communicate information between Autonomous System Boundary Routers.
If none is specified, then the remote autonomous system number is used
for routes from BGP and EGP; for other protocols, zero (0) is used. route-map (Optional) Route map should be interrogated to
filter the importation of routes from this source routing protocol to
the current routing protocol. If not specified, all routes are redistributed.
If this keyword is specified, but no route map tags are listed, no routes
will be imported. map-tag (Optional) Identifier of a configured route map. weight weight (Optional) Network weight when redistributing into
BGP. An integer from 0 to 65535. subnets (Optional) For redistributing routes into OSPF,
the scope of redistribution for the specified protocol.
For isis, this is an optional tag that defines
a meaningful name for a routing process. You can specify only one IS-IS
process per router. Creating a name for a routing process means that you
use names when configuring routing.
For ospf, this is an appropriate OSPF process ID from which routes
are to be redistributed. This identifies the routing process. This value
takes the form of a nonzero decimal number.
For rip, no process-id value is needed.
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 Modes
Router configuration
Command History
10.0 This command was introduced.
Release
Modification
Usage Guidelines
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 level-1-2 keyword allows both Level 1 and Level 2 routes 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. Furthermore, when the router redistributes from one OSPF process to another OSPF process on the same router, and if no default metric is specified, the metrics in one process are carried to the redistributing process.
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.
Examples
The following example causes OSPF routes to be redistributed into a BGP domain:
router bgp 109 redistribute ospf...
The following example 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 subnets
The following example configures BGP routes 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
In the following example, network 20.0.0.0 will appear as an external LSA in OSPF 1 with a cost of 100 (the cost is preserved):
interface ethernet 0 ip address 20.0.0.1 255.0.0.0 ip ospf cost 100 interface ethernet 1 ip address 10.0.0.1 255.0.0.0 ! router ospf 1 network 10.0.0.0 0.255.255.255 area 0 redistribute ospf 2 subnet router ospf 2 network 20.0.0.0 0.255.255.255 area 0
Related Commands
default-information originate (BGP) Allows the redistribution of network 0.0.0.0 into
BGP. default-information originate (IS-IS) Generates a default route into an IS-IS routing
domain. default-information originate (OSPF) Generates a default route into an OSPF routing
domain. distribute-list out (IP) Suppresses networks from being advertised in updates. route-map (IP) Defines the conditions for redistributing routes
from one routing protocol into another, or enables policy routing. show route-map Displays all route maps configured or only the
one specified.
Command
Description