Redistribution Configuration

This section reviews the command that is used to configure redistribution on a Cisco router. Note that the redistribute command can be used in any routing protocol, not just OSPF.

Redistributing routes into OSPF from other routing protocols or from static routes causes these redistributed routes to be labeled in the routing tables as OSPF external routes. This makes sense if you recall the external route discussion in Chapter 5, "Routing Concepts and Configuration." Because these routes are from outside the OSPF process, they are considered to be external.

344 Chapter 6: Redistribution

To redistribute routes into OSPF, use the following command syntax in router configuration mode:

redistribute routing-process [process-id] [metric ospf-metric-value] [metric-type ospf-metric-type-value] [route-map map-tag-value] [subnets]

This syntax is an abbreviated example of the full redistribution command, which is much more complex, as you will see at the end of this section.

Ensure that you consider the golden rules and read this section prior to activating redistribution. Of the following command options, only routing-process is required. Each of the following fields, shown in italics, requires a decision and input from you when configuring redistribution:

• routing-process—Identifies the routing process to redistribute into OSPF. The routing process can be BGP, Connected, EGP, EIGRP, IGRP, ISIS, ISO-IGRP, Mobile, ODR, OSPF, RIP, or Static.

• process-id—The process ID of the routing process (if applicable). For example, if you were redistributing EIGRP into OSPF, the autonomous system number used by EIGRP would be used as its process ID when redistributing.

• ospf-metric-value—The metric or cost to assign to the redistributed routes when they are placed into OSPF. If this option is not used, a default metric of 1 is used for redistributed BGP routes and a default metric of 20 is used for all other protocols. The range of values is 0 to 16,777,214. You should set the metric value here that is applicable to your network. For example, a network based on 10-Mbps Ethernet would need a different metric for routes than a network based on Frame Relay.

• ospf-metric-type-value—Routes are redistributed into OSPF as either an OSPF external Type 1 or Type 2 route. The default is Type 2; if you want to change the type of redistributed routes, you can do that here. However, changing the metric type here affects all routes.

• map-tag-value—A numerical value that is attached to the redistributed routes. The route tag is not specifically used by OSPF. However, the presence of a route tag can be used as a basis for making policy decisions as defined in a route map. For example, one use is to base the decision to redistribute a route based on the value present in the route-tag field. The default tag value is 0. The range of values for the tag is 0 to 4,294,967,295 (32 bits).

• subnets—If this command is not used when redistributing, only classful networks are redistributed into OSPF. With OSPF, the keyword subnets is typically used when redistributing more then one network into OSPF. When redistributing routes into OSPF, only routes that are not subnetted are redistributed if the subnets keyword is not specified.

A route map is a method used to control the redistribution of routes between routing domains. The format of the command to configure a route map is as follows:

route-map map-tag [[permit I deny] I [sequence-number]]

route-map map-tag [[permit I deny] I [sequence-number]]

The next section discusses the various methods of filtering routing information between different routing algorithms.

To configure redistribution between routing protocols, use the following command under the routing process configuration:

redistribute protocol [process-id] {level-1 I level-1-2 I level-2} [as-number] [metric metric-value] [metric-type type-value] [match {internal I external 1 I external 2}] [tag tag-value] [route-map map-tag] [weight number-value] [subnets]

Table 6-2 explains the redistribution command syntax in further detail.

Table 6-2 Command Syntax for Redistribution

Command

Description

protocol

Source protocol from which routes are being redistributed. It can be one of the following keywords: bgp, connected, egp, igrp, isis, mobile, ospf, static [ip], or rip.

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 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 are redistributed as external to the autonomous system.

process-id

(Optional) For the bgp, egp, or igrp keyword, this is an autonomous system number, which is a 16-bit decimal number.

For the ospf keyword, this is an appropriate OSPF process ID from which routes are to be redistributed.

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.

as-number

Autonomous system number for the redistributed route.

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.

continues continues

346 Chapter 6: Redistribution

Table 6-2 Command Syntax for Redistribution (Continued)

Command

Description

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 either a Type 1 or 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 that is less than 63

• external: IS-IS metric that is between 64 and 128 The default is internal.

match

{internal 1 external 1 1 external 2}

(Optional) 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.

tag tag-value

(Optional) A 32-bit decimal value attached to each external route. This is not used by OSPF itself. It can 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 Border Gateway Protocol (BGP) and Exterior Gateway Protocol (EGP); for other protocols, 0 is used.

route-map

(Optional) 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 are imported.

map-tag

(Optional) Identifier of a configured route map.

weight number-value

(Optional) Network weight when redistributing into BGP. The value is an integer from 0 to 65,535.

subnets

(Optional) For redistributing routes into OSPF, the scope of redistribution for the specified protocol.

Was this article helpful?

0 0

Post a comment