To redistribute routes from one routing domain into another routing domain, use the redistribute command in the appropriate configuration mode. To disable all or some part of the redistribution (depending on the protocol),
use the no form of this command. See the “Usage Guidelines” section for detailed, protocol-specific behaviors.
redistribute protocol [process-id] {level-1 | level-1-2 | level-2} [autonomous-system-number] [metric {metric-value | transparent}] [metric-type type-value] [match {internal | external 1 | external 2}] [tag tag-value] [route-map map-tag] [subnets] [nssa-only]
no redistribute protocol [process-id] {level-1 | level-1-2 | level-2} [autonomous-system-number] [metric {metric-value | transparent}] [metric-type type-value] [match {internal | external 1 | external 2}] [tag tag-value] [route-map map-tag] [subnets] [nssa-only]
Syntax Description
protocol
|
Source protocol from which routes are being redistributed. It can be one of the following keywords: application , bgp , connected , eigrp , isis , mobile , ospf , rip, or static [ip ].
The static [ip ] keyword is used to redistribute IP static routes. The optional ip keyword is used when redistributing into the Intermediate System-to-Intermediate System (IS-IS) protocol.
The application keyword is used to redistribute an application from one routing domain to another. You can redistribute more than one application to different routing protocols such as IS-IS, OSPF, Border Gateway Protocol
(BGP), Enhanced Interior Gateway Routing Protocol (EIGRP) and Routing Information Protocol (RIP).
The connected keyword refers to routes that are established automatically by virtue of having enabled IP on an interface. For routing protocols
such as Open Shortest Path First (OSPF) and IS-IS, these routes will be redistributed as external to the autonomous system.
|
process-id
|
(Optional) For the application keyword, this is the name of an application.
For the bgp or eigrp keyword, this is an autonomous system number, which is a 16-bit decimal number.
For the isis keyword, this is an optional tag value that defines a meaningful name for a routing process. Creating a name for a routing process means that you use names
when configuring routing. You can configure a router in two routing domains and redistribute routing information between these
two domains.
For the ospf keyword, 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 the rip keyword, no process-id value is needed.
For the application keyword, this is the name of an application.
By default, no process ID is defined.
|
level-1
|
Specifies that, for IS-IS, Level 1 routes are redistributed into other IP routing protocols independently.
|
level-1-2
|
Specifies that, for IS-IS, both Level 1 and Level 2 routes are redistributed into other IP routing protocols.
|
level-2
|
Specifies that, for IS-IS, Level 2 routes are redistributed into other IP routing protocols independently.
|
autonomous-system-number
|
(Optional) Autonomous system number for the redistributed route. The range is from 1 to 65535.
For more details about autonomous system number formats, see the router
bgp command.
|
metric
metric-value
|
(Optional) When redistributing from one OSPF process to another OSPF process on the same router, the metric will be carried
through from one process to the other if no metric value is specified. When redistributing other processes to an OSPF process,
the default metric is 20 when no metric value is specified. The default value is 0.
|
metric
transparent
|
(Optional) Causes RIP to use the routing table metric for redistributed routes as the RIP metric.
|
metric-type
type value
|
(Optional) For OSPF, specifies the external link type associated with the default route advertised into the OSPF routing
domain. It can be one of two values:
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:
The default is internal .
|
match
{internal | external1 | external2 }
|
(Optional) Specifies the criteria by which OSPF routes are redistributed into other routing domains. It can 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 routes.
-
external
2 —Routes that are external to the autonomous system, but are imported into OSPF as Type 2 external routes.
The default is internal .
|
tag
tag-value
|
(Optional) Specifies the 32-bit decimal value attached to each external route. This is not used by OSPF itself. It may be
used to communicate information between Autonomous System Boundary Routers (ASBRs). If none is specified, the remote autonomous
system number is used for routes from BGP and Exterior Gateway Protocol (EGP); for other protocols, zero (0) is used.
|
route-map
|
(Optional) Specifies the route map that 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.
|
subnets
|
(Optional) For redistributing routes into OSPF.
Note
|
Irrespective of whether the subnets keyword is configured or not, the subnets functionality is enabled by default. This automatic addition results in the redistribution
of classless OSPF routes.
|
|
nssa-only
|
(Optional) Sets the nssa-only attribute for all routes redistributed into OSPF.
|
Command Default
Route redistribution is disabled.
Command Modes
Router configuration (config-router)
Address family configuration (config-af)
Address family topology configuration (config-router-af-topology)
Command History
Release
|
Modification
|
Cisco IOS XE Everest 16.6.1 |
This command was introduced.
|
Using the no Form of the redistribute Command
Caution
|
Removing options that you have configured for the redistribute command requires careful use of the no form of the redistribute command to ensure that you obtain the result that you are expecting. Changing or disabling any keyword may or may not affect
the state of other keywords, depending on the protocol.
|
It is important to understand that different protocols implement the no form of the redistribute command differently:
-
In BGP, OSPF, and RIP configurations, the no redistribute command removes only the specified keywords from the redistribute commands in the running configuration. They use the subtractive keyword method when redistributing from other protocols. For example, in the case of BGP, if you configure no redistribute static route-map interior , only the route map is removed from the redistribution, leaving redistribute static in place with no filter.
-
The no redistribute isis command removes the IS-IS redistribution from the running configuration. IS-IS removes the entire command, regardless of
whether IS-IS is the redistributed or redistributing protocol.
-
EIGRP used the subtractive keyword method prior to EIGRP component version rel5. Starting with EIGRP component version rel5,
the no redistribute command removes the entire redistribute command when redistributing from any other protocol.
-
An EIGRP routing process is configured when you issue the router eigrp command and then specify a network for the process using the network sub-command. Suppose that you have not configured an EIGRP routing process, and that you have configured redistribution of
routes from such an EIGRP process into BGP, OSPF, or RIP. If you use the no redistribute eigrp command to change or disable a parameter in the redistribute eigrp command, the no redistribute eigrp command removes the entire redistribute eigrp command instead of changing or disabling a specific parameter.
Additional Usage Guidelines for the redistribute Command
A router receiving a link-state protocol 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 must be filtered by the distribute-list
out router configuration command. This guideline 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 ASBR.
However, an ASBR does not, by default, generate a default route into the OSPF routing domain.
When routes are redistributed into OSPF from protocols other than OSPF or BGP, and no metric has been specified with the
metric-type keyword and type-value argument, OSPF will use 20 as the default metric. When routes are redistributed into OSPF from BGP, OSPF will use 1 as the
default metric. When routes are redistributed from one OSPF process to another OSPF process, autonomous system external and
not-so-stubby-area (NSSA) routes will use 20 as the default metric. When intra-area and inter-area routes are redistributed
between OSPF processes, the internal OSPF metric from the redistribution source process is advertised as the external metric
in the redistribution destination process. (This is the only case in which the routing table metric will be preserved when
routes are redistributed into OSPF.)
Note
|
The show ip ospf [topology-info ] command will display subnets keyword irrespective of whether the subnets keyword is configured or not. This is because the subnets functionality is enabled by default for OSPF.
|
On a router internal to an NSSA area, the nssa-only keyword causes the originated type-7 NSSA LSAs to have their propagate (P) bit set to zero, which prevents area border routers
from translating these LSAs into type-5 external LSAs. On an area border router that is connected to an NSSA and normal areas,
the nssa-only keyword causes the routes to be redistributed only into the NSSA areas.
Routes configured with the connected keyword affected by this redistribute command are the routes not specified by the network router configuration 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 in the default-metric command.
|
The default redistribution of Interior Gateway Protocol (IGP) or Exterior Gateway Protocol (EGP) into BGP is not allowed
unless the default-information originate router configuration command is specified.
4-Byte Autonomous System Number Support
The Cisco implementation of 4-byte autonomous system numbers uses asplain—65538 for example—as the default regular expression
match and output display format for autonomous system numbers, but you can configure 4-byte autonomous system numbers in both
the asplain format and the asdot format as described in RFC 5396. To change the default regular expression match and output
display of 4-byte autonomous system numbers to asdot format, use the bgp asnotation dot command.
Examples
The following example shows how OSPF routes are redistributed into a BGP domain:
Device(config)# router bgp 109
Device(config-router)# redistribute ospf
The following example shows how to redistribute EIGRP routes into an OSPF domain:
Device(config)# router ospf 110
Device(config-router)# redistribute eigrp
The following example shows how to redistribute the specified EIGRP process routes into an OSPF domain. The EIGRP-derived
metric will be remapped to 100 and RIP routes to 200.
Device(config)# router ospf 109
Device(config-router)# redistribute eigrp 108 metric 100 subnets
Device(config-router)# redistribute rip metric 200 subnets
The following example shows how to configure BGP routes to be redistributed into IS-IS. The link-state cost is specified
as 5, and the metric type is set to external, indicating that it has lower priority than internal metrics.
Device(config)# router isis
Device(config-router)# redistribute bgp 120 metric 5 metric-type external
The following example shows how to redistribute an application into an OSPF domain and specify a metric value of 5:
Device(config)# router ospf 4
Device(config-router)# redistribute application am metric 5
In the following example, network 172.16.0.0 will appear as an external LSA in OSPF 1 with a cost of 100 (the cost is preserved):
Device(config)# interface ethernet 0
Device(config-if)# ip address 172.16.0.1 255.0.0.0
Device(config-if)# exit
Device(config)# ip ospf cost 100
Device(config)# interface ethernet 1
Device(config-if)# ip address 10.0.0.1 255.0.0.0
!
Device(config)# router ospf 1
Device(config-router)# network 10.0.0.0 0.255.255.255 area 0
Device(config-if)# exit
Device(config-router)# redistribute ospf 2 subnet
Device(config)# router ospf 2
Device(config-router)# network 172.16.0.0 0.255.255.255 area 0
The following example shows how BGP routes are redistributed into OSPF and assigned the local 4-byte autonomous system number
in asplain format.
Device(config)# router ospf 2
Device(config-router)# redistribute bgp 65538
The following example shows how to remove the connected metric 1000 subnets options from the redistribute connected metric 1000 subnets command and leave the redistribute connected command in the configuration:
Device(config-router)# no redistribute connected metric 1000 subnets
The following example shows how to remove the metric 1000 options from the redistribute connected metric 1000 subnets command and leave the redistribute connected subnets command in the configuration:
Device(config-router)# no redistribute connected metric 1000
The following example shows how to remove the subnets option from the redistribute connected metric 1000 subnets command and leave the redistribute connected metric 1000 command in the configuration:
Device(config-router)# no redistribute connected subnets
The following example shows how to remove the redistribute connected command, and any of the options that were configured for the redistribute connected command, from the configuration:
Device(config-router)# no redistribute connected
The following example shows how EIGRP routes are redistributed into an EIGRP process in a named EIGRP configuration:
Device(config)# router eigrp virtual-name
Device(config-router)# address-family ipv4 autonomous-system 1
Device(config-router-af)# topology base
Device(config-router-af-topology)# redistribute eigrp 6473 metric 1 1 1 1 1
The following example shows how to set and disable the redistributions in EIGRP configuration. Note that, in the case of EIGRP, the no form of the commands removes the entire set of redistribute commands from the running configuration.
Device(config)# router eigrp 1
Device(config-router)# network 0.0.0.0
Device(config-router)# redistribute eigrp 2 route-map x
Device(config-router)# redistribute ospf 1 route-map x
Device(config-router)# redistribute bgp 1 route-map x
Device(config-router)# redistribute isis level-2 route-map x
Device(config-router)# redistribute rip route-map x
Device(config)# router eigrp 1
Device(config-router)# no redistribute eigrp 2 route-map x
Device(config-router)# no redistribute ospf 1 route-map x
Device(config-router)# no redistribute bgp 1 route-map x
Device(config-router)# no redistribute isis level-2 route-map x
Device(config-router)# no redistribute rip route-map x
Device(config-router)# end
Device# show running-config | section router eigrp 1
router eigrp 1
network 0.0.0.0
The following example shows how to set and disable the redistributions in OSPF configuration. Note that the no form of the commands removes only the specified keywords from the redistribute command in the running configuration.
Device(config)# router ospf 1
Device(config-router)# network 0.0.0.0
Device(config-router)# redistribute eigrp 2 route-map x
Device(config-router)# redistribute ospf 1 route-map x
Device(config-router)# redistribute bgp 1 route-map x
Device(config-router)# redistribute isis level-2 route-map x
Device(config-router)# redistribute rip route-map x
Device(config)# router ospf 1
Device(config-router)# no redistribute eigrp 2 route-map x
Device(config-router)# no redistribute ospf 1 route-map x
Device(config-router)# no redistribute bgp 1 route-map x
Device(config-router)# no redistribute isis level-2 route-map x
Device(config-router)# no redistribute rip route-map x
Device(config-router)# end
Device# show running-config | section router ospf 1
router ospf 1
redistribute eigrp 2
redistribute ospf 1
redistribute bgp 1
redistribute rip
network 0.0.0.0
The following example shows how to remove only the route map filter from the redistribution in BGP; redistribution itself
remains in force without a filter:
Device(config)# router bgp 65000
Device(config-router)# no redistribute eigrp 2 route-map x
The following example shows how to remove the EIGRP redistribution to BGP:
Device(config)# router bgp 65000
Device(config-router)# no redistribute eigrp 2