Cisco OSPF Route Redistribution

Date: Jul 5, 2002 By William R. Parkhurst. Sample Chapter is provided courtesy of Cisco Press.
Use this complete reference to Cisco OSPF commands next time your network needs route redistribution. Ten example scenarios clearly illustrate the purpose, syntax, and usage of each command.

14-1: redistribute routing-process process-id

14-2: redistribute routing-process process-id metric ospf-metric

14-3: redistribute routing-process process-id metric-type metric-type

14-4: redistribute routing-process process-id subnets

14-5: redistribute routing-process process-id tag tag-value

Syntax Description:

  • routing-process—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).

  • ospf-metric—The metric or cost to assign to the redistributed routes. If this option is not used, a default metric of 1 will be used for redistributed BGP routes and a default metric of 20 will be used for all other protocols. The range of values is 0–16,777,214.

  • metric-type—Routes are redistributed into OSPF as either type 1 or type 2 routes. The default is type 2.

  • tag-value—A 32-bit value that is attached to the redistributed routes. The route tag is not used by OSPF but can be referenced in a route map for making policy decisions. One possible use is to base the decision to redistribute a route based on the route tag(see Section 14-6). The default tag value is 0. The range of values for the tag is 0–4,294,967,295.

Purpose: To redistribute routes learned from another routing process into OSPF. Redistributed routes become OSPF external type 2 routes by default. The default cost or metric of a redistributed route is 1 for BGP and 20 for all other protocols. This command will redistribute classful routes into OSPF only if the subnets keyword is not used. There are three general types of classful routes:

  • A Class A address with an 8-bit subnet mask

  • A Class B address with a 16-bit subnet mask

  • A Class C address with a 24-bit subnet mask

Initial Cisco IOS Software Release: 10.0

Configuration Example 1: Redistributing Classful Routes into OSPF with the Default Type and Metric

In Figure 14-1, Router B is receiving six routes from Router C via EIGRP. Three of the EIGRP routes are classful (5.0.0.0/8, 145.5.0.0/16, 205.5.5.0/24) and three are classless (6.0.0.0/12, 146.6.0.0/20, 206.6.6.0/28). Before redistributing the EIGRP routes into OSPF on Router B, configure the routers as shown in the listing that follows.

Figure 14-1Figure 14-1 By Default, OSPF Will Redistribute Only Classful Routes

Router A
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Serial0/1
 ip address 10.1.1.1 255.255.255.252
 clockrate 64000
!
router ospf 1
 network 10.1.1.0 0.0.0.3 area 0
 
Router B
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial0
 ip address 10.1.1.2 255.255.255.252
!
interface Serial 1
 ip address 10.1.1.5 255.255.255.252
!
router eigrp 1
 network 10.0.0.0
!
router ospf 1
 network 10.1.1.0 0.0.0.3 area 0
Router C
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface Loopback1
 ip address 5.5.5.5 255.0.0.0
!
interface Loopback2
 ip address 6.6.6.6 255.240.0.0
!
interface Loopback3
 ip address 145.5.5.5 255.255.0.0
!
interface Loopback4
 ip address 146.6.6.6 255.255.240.0
!
interface Loopback5
 ip address 205.5.5.5 255.255.255.0
!
interface Loopback6
 ip address 206.6.6.6 255.255.255.240
!
interface Serial0
 ip address 10.1.1.6 255.255.255.252
!
router eigrp 1
 network 5.0.0.0
 network 6.0.0.0
 network 10.0.0.0
 network 145.5.0.0
 network 146.6.0.0
 network 205.5.5.0
 network 206.6.6.0
 no auto-summary

Verify that Routers A and B have established an OSPF neighbor relationship.

rtrA#show ip ospf neighbor
Neighbor ID   Pri  State      Dead Time  Address     Interface
2.2.2.2      1  FULL/ -    00:00:36  10.1.1.2    Serial0/1

Verify that Routers B and C have formed an EIGRP neighbor relationship.

rtrB#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H  Address         Interface  Hold Uptime  SRTT  RTO Q Seq
                    (sec)     (ms)    Cnt Num
0  10.1.1.6        Se1      11 00:25:42 308 2280 0 4

Verify that Router B is receiving the six EIGRP routes from Router C.

rtrB#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o - ODR
Gateway of last resort is not set
   2.0.0.0/32 is subnetted, 1 subnets
C    2.2.2.2 is directly connected, Loopback0
D  205.5.5.0/24 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
   206.6.6.0/28 is subnetted, 1 subnets
D    206.6.6.0 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
D  5.0.0.0/8 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
   6.0.0.0/12 is subnetted, 1 subnets
D    6.0.0.0 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
D  145.5.0.0/16 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
   10.0.0.0/30 is subnetted, 2 subnets
C    10.1.1.0 is directly connected, Serial0
C    10.1.1.4 is directly connected, Serial1
   146.6.0.0/20 is subnetted, 1 subnets
D    146.6.0.0 [90/40640000] via 10.1.1.6, 00:26:27, Serial1

Modify the configuration on Router B to redistribute the classful EIGRP routes into OSPF.

router ospf 1
 redistribute eigrp 1

When the command redistribute eigrp 1 is entered, the router will give you the following friendly reminder:

rtrB(config-router)#redistribute eigrp 1
% Only classful networks will be redistributed

Verification

Determine the routes that have been redistributed by examining the IP routing table on Router A.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
O E2 205.5.5.0/24 [110/20] via 10.1.1.2, 00:33:23, Serial0/1
O E2 5.0.0.0/8 [110/20] via 10.1.1.2, 00:33:23, Serial0/1
O E2 145.5.0.0/16 [110/20] via 10.1.1.2, 00:33:23, Serial0/1
   10.0.0.0/30 is subnetted, 1 subnets
C    10.1.1.0 is directly connected, Serial0/1

Only the EIGRP classful routes were redistributed into OSPF. As you can see in the routing table on Router A, EIGRP routes were redistributed as external type 2 with a cost or metric of 20. This information can also be found by inspecting the OSPF database on Router B.

rtrB#show ip ospf database external
    OSPF Router with ID (2.2.2.2) (Process ID 1)
        Type-5 AS External Link States
 LS age: 410
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 5.0.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000004
 Checksum: 0x642C
 Length: 36
 Network Mask: /8
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 20
    Forward Address: 0.0.0.0
    External Route Tag: 0
 LS age: 419
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 145.5.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000004
 Checksum: 0x5F9
 Length: 36
 Network Mask: /16
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 20
    Forward Address: 0.0.0.0
    External Route Tag: 0
 LS age: 435
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 205.5.5.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000004
 Checksum: 0xBEFE
 Length: 36
 Network Mask: /24
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 20
    Forward Address: 0.0.0.0
    External Route Tag: 0

Configuration Example 2: Redistributing Classful Routes into OSPF with the Default Type and Specific Metric

In the first configuration example for Figure 14-1, the EIGRP routes were redistributed into OSPF with a default metric of 20. For this example, modify the configuration on Router B to change the metric of all the redistributed EIGRP routes to 66.

Router B
router ospf 1
 redistribute eigrp 1 metric 66

Verification

Verify that the new metric has been applied to the redistributed EIGRP routes. On Router A you can look at the IP routing table and on Router B you can inspect the OSPF database.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
O E2 205.5.5.0/24 [110/66] via 10.1.1.2, 00:00:16, Serial0/1
O E2 5.0.0.0/8 [110/66] via 10.1.1.2, 00:00:16, Serial0/1
O E2 145.5.0.0/16 [110/66] via 10.1.1.2, 00:00:16, Serial0/1
   10.0.0.0/30 is subnetted, 1 subnets
C    10.1.1.0 is directly connected, Serial0/1

Configuration Example 3: Redistributing Classful Routes into OSPF as Type 1 Routes Using a Specific Metric

Routes are redistributed in OSPF as either type 1 (E1) routes or type 2 (E2) routes, with type 2 being the default. A type 1 route has a metric that is the sum of the internal OSPF cost and the external redistributed cost. A type 2 route has a metric equal only to the redistributed cost, as shown in Figure 14-2. If routes are redistributed into OSPF as type 2 then every router in the OSPF domain will see the same cost to reach the external networks. If routes are redistributed into OSPF as type 1, then the cost to reach the external networks could vary from router to router.

Figure 14-2Figure 14-2 OSPF Routes Are Redistributed as Either Type 1 or Type 2 Routes

Modify the configuration on Router B so that the EIGRP routes are redistributed as type 1 routes.

Router B
router ospf 1
 redistribute eigrp 1 metric 66 metric-type 1

Verification

Verify that the EIGRP routes have been redistributed into OSPF as type 1 routes with a metric of 66.

rtrB#show ip ospf database external
    OSPF Router with ID (2.2.2.2) (Process ID 1)
        Type-5 AS External Link States
 LS age: 149
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 5.0.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000008
 Checksum: 0xA638
 Length: 36
 Network Mask: /8
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 66
    Forward Address: 0.0.0.0
    External Route Tag: 0
 LS age: 158
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 145.5.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000008
 Checksum: 0x4706
 Length: 36
 Network Mask: /16
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 66
    Forward Address: 0.0.0.0
    External Route Tag: 0
 LS age: 168
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 205.5.5.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000008
 Checksum: 0x10B
 Length: 36
 Network Mask: /24
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 66
    Forward Address: 0.0.0.0
    External Route Tag: 0

Verify that the cost of these routes as seen by Router A is the sum of the redistributed metric and the OSPF cost to reach Router B.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
O E1 205.5.5.0/24 [110/1628] via 10.1.1.2, 00:05:36, Serial0/1
O E1 5.0.0.0/8 [110/1628] via 10.1.1.2, 00:05:36, Serial0/1
O E1 145.5.0.0/16 [110/1628] via 10.1.1.2, 00:05:36, Serial0/1
   10.0.0.0/30 is subnetted, 1 subnets
C    10.1.1.0 is directly connected, Serial0/1

Configuration Example 4: Redistributing Subnet Routes into OSPF as Type 1 Routes Using a Specific Metric

The previous configuration examples redistributed only the classful EIGRP routes into OSPF. Modify the configuration on Router B to redistribute all the EIGRP routes.

Router B
router ospf 1
 redistribute eigrp 1 metric 66 metric-type 1 subnets

Verification

Verify that the classless EIGRP routes have been redistributed into OSPF on Router B by inspecting the IP routing table on Router A.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
O E1 205.5.5.0/24 [110/1628] via 10.1.1.2, 00:22:36, Serial0/1
   206.6.6.0/28 is subnetted, 1 subnets
O E1  206.6.6.0 [110/1628] via 10.1.1.2, 00:02:37, Serial0/1
O E1 5.0.0.0/8 [110/1628] via 10.1.1.2, 00:22:36, Serial0/1
   6.0.0.0/12 is subnetted, 1 subnets
O E1  6.0.0.0 [110/1628] via 10.1.1.2, 00:02:37, Serial0/1
O E1 145.5.0.0/16 [110/1628] via 10.1.1.2, 00:22:37, Serial0/1
   10.0.0.0/30 is subnetted, 2 subnets
C    10.1.1.0 is directly connected, Serial0/1
O E1  10.1.1.4 [110/1628] via 10.1.1.2, 00:02:40, Serial0/1
   146.6.0.0/20 is subnetted, 1 subnets
O E1  146.6.0.0 [110/1628] via 10.1.1.2, 00:02:40, Serial0/1

Configuration Example 5: Redistributing Subnet Routes into OSPF as Type 1 Routes Using a Specific Metric and Route Tag

A route tag is a 32-bit value that is attached to the redistributed routes. Every route that is redistributed will be assigned the same route tag unless a route map is used (see Section 14-6). OSPF itself does not use the route tag, but you can use the tag value to implement policy decisions. For example, in Section 14-6, the tag value is used to determine which routes will be redistributed into OSPF based on their tag values. This example presents only the mechanics of assigning the tag. Modify the configuration on Router B to redistribute the EIGRP routes with a tag value of 555.

Router B
router ospf 1
 redistribute eigrp 1 metric 66 metric-type 1 subnets tag 555

Verification

The tag value can be verified by examining a particular route in the IP routing table on Router A.

rtrA#show ip route 5.0.0.0
Routing entry for 5.0.0.0/8
 Known via "ospf 1", distance 110, metric 1628
 Tag 555, type extern 1
 Last update from 10.1.1.2 on Serial0/1, 00:03:57 ago
 Routing Descriptor Blocks:
 * 10.1.1.2, from 2.2.2.2, 00:03:57 ago, via Serial0/1
   Route metric is 1628, traffic share count is 1

The tag value can also be verified by inspecting the external routes in the OSPF database on either Router A or B.

rtrA#show ip ospf database external 5.0.0.0
      OSPF Router with ID (1.1.1.1) (Process ID 1)
        Type-5 AS External Link States
 Routing Bit Set on this LSA
 LS age: 313
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 5.0.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 8000002A
 Checksum: 0x8D02
 Length: 36
 Network Mask: /8
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 66
    Forward Address: 0.0.0.0
    External Route Tag: 555
rtrB#show ip ospf database external 145.5.0.0
    OSPF Router with ID (2.2.2.2) (Process ID 1)
        Type-5 AS External Link States
 LS age: 373
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 145.5.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 8000002A
 Checksum: 0x2ECF
 Length: 36
 Network Mask: /16
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 66
    Forward Address: 0.0.0.0
    External Route Tag: 555

Troubleshooting

Verify that there is a neighbor relationship between the OSPF routers by using the show ip ospf neighbors command.

Step 1

Verify that the redistribute command is referencing the correct routing process and process number (if applicable).

Step 2

Remember the defaults: metric = 20 (1 for BGP), metric type = 2, tag = 0.


To avoid problems associated with mutual redistribution, either use a distribute list (see Sections 7-5, 7-10, and 7-15) or a route map (see Section 14-6) to allow only routes that originated in the routing process domain.

For example, if on the same router, EIGRP is redistributed into OSPF and OSPF is redistributed into EIGRP, then OSPF routes will be redistributed back into OSPF from EIGRP and EIGRP routes will be redistributed back into EIGRP from OSPF. Use a route map or distribute list to prevent this from occurring.

14-6: redistribute routing-process process-id route-map route-map-name

Syntax Description:

  • routing-process—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).

  • route-map-name—Name of the route map used to control which routes are redistributed or to set the parameters of the redistributed routes (metric, metric-type, or tag).

Purpose: To control the redistribution of routes learned from another routing process into OSPF. Redistributed routes become OSPF external type 2 routes by default. The default cost or metric of a redistributed route is 1 for BGP and 20 for all other protocols. This command will redistribute classful routes into OSPF only if the subnets keyword is not used. There are three general types of classful routes:

  • A Class A address with an 8-bit mask

  • A Class B address with a 16-bit mask

  • A Class C address with a 24-bit mask

You can use the subnets keyword to redistribute all routes. You can also use the metric, metric-type, and tag keywords. These values can also be set in the route map as shown in the examples covered in this section.

Initial Cisco IOS Software Release: 10.0

Configuration Example 6: Controlling the Routes to Be Redistributed Based on IP Address

In Figure 14-3, Router B is receiving six routes from Router C via EIGRP. Three of the EIGRP routes are classful (5.0.0.0/8, 145.5.0.0/16, 205.5.5.0/24) and three are classless (6.0.0.0/12, 146.6.0.0/20, 206.6.6.0/28). For this example, only the classless routes will be redistributed. Before redistributing the EIGRP routes into OSPF on Router B, configure the routers as shown in the listing that follows.

Figure 14-3Figure 14-3 A Route Map Is Needed to Control Which Routes Are Redistributed into OSPF from EIGRP

Router A¬
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Serial0/1
 ip address 10.1.1.1 255.255.255.252
 clockrate 64000
!
router ospf 1
 network 10.1.1.0 0.0.0.3 area 0
Router B
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial0
 ip address 10.1.1.2 255.255.255.252
!
interface Serial 1
 ip address 10.1.1.5 255.255.255.252
!
router eigrp 1
 network 10.0.0.0
!
router ospf 1
 network 10.1.1.0 0.0.0.3 area 0
Router C
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface Loopback1
 ip address 5.5.5.5 255.0.0.0
!
interface Loopback2
 ip address 6.6.6.6 255.240.0.0
!
interface Loopback3
 ip address 145.5.5.5 255.255.0.0
!
interface Loopback4
 ip address 146.6.6.6 255.255.240.0
!
interface Loopback5
 ip address 205.5.5.5 255.255.255.0
!
interface Loopback6
 ip address 206.6.6.6 255.255.255.240
!
interface Serial0
 ip address 10.1.1.6 255.255.255.252
!
router eigrp 1
 network 5.0.0.0
 network 6.0.0.0
 network 10.0.0.0
 network 145.5.0.0
 network 146.6.0.0
 network 205.5.5.0
 network 206.6.6.0
 no auto-summary

Verify that Routers A and B have established an OSPF neighbor relationship.

rtrA#show ip ospf neighbor
Neighbor ID   Pri  State      Dead Time  Address     Interface
2.2.2.2             1   FULL/ -    00:00:36      10.1.1.2      Serial0/1

Verify that Routers B and C have formed an EIGRP neighbor relationship.

rtrB#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H  Address         Interface  Hold Uptime  SRTT  RTO Q Seq
                                   (sec)                  (ms)                Cnt Num
0  10.1.1.6        Se1      11   00:25:42   308       2280       0    4

Verify that Router B is receiving the six EIGRP routes from Router C.

rtrB#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o - ODR
Gateway of last resort is not set
   2.0.0.0/32 is subnetted, 1 subnets
C    2.2.2.2 is directly connected, Loopback0
D  205.5.5.0/24 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
   206.6.6.0/28 is subnetted, 1 subnets
D    206.6.6.0 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
D  5.0.0.0/8 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
   6.0.0.0/12 is subnetted, 1 subnets
D    6.0.0.0 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
D  145.5.0.0/16 [90/40640000] via 10.1.1.6, 00:26:25, Serial1
   10.0.0.0/30 is subnetted, 2 subnets
C    10.1.1.0 is directly connected, Serial0
C    10.1.1.4 is directly connected, Serial1
   146.6.0.0/20 is subnetted, 1 subnets
D    146.6.0.0 [90/40640000] via 10.1.1.6, 00:26:27, Serial1

Modify the configuration on Router B to redistribute only the classless EIGRP routes into OSPF.

Router B
router ospf 1
 redistribute eigrp 1 subnets route-map control-eigrp
!
access-list 1 permit 6.0.0.0 0.15.255.255
access-list 1 permit 146.6.0.0 0.0.15.255
access-list 1 permit 206.6.6.0 0.0.0.15
access-list 1 permit 10.1.1.4 0.0.0.3
route-map control-eigrp permit 10
 match ip address 1

Verification

Verify that only the classless EIGRP routes have been redistributed into OSPF.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
   206.6.6.0/28 is subnetted, 1 subnets
O E2  206.6.6.0 [110/20] via 10.1.1.2, 00:02:05, Serial0/1
   6.0.0.0/12 is subnetted, 1 subnets
O E2  6.0.0.0 [110/20] via 10.1.1.2, 00:02:05, Serial0/1
10.0.0.0/30 is subnetted, 1 subnets
C    10.1.1.0 is directly connected, Serial0/1
   146.6.0.0/20 is subnetted, 1 subnets
O E2  146.6.0.0 [110/20] via 10.1.1.2, 00:02:06, Serial0/1
O E2  10.1.1.4 [110/200] via 10.1.1.2, 00:02:06, Serial0/1

Configuration Example 7: Modifying the Metric of Redistributed Routes Using a Route Map

In the first configuration example for Figure 14-3, the EIGRP routes were redistributed into OSPF with a default metric of 20. For this example, modify the configuration on Router B to change the metric of the classful routes to 100 and the metric of the classless routes to 200.

Router B
router ospf 1
 redistribute eigrp 1 subnets route-map control-eigrp
!
access-list 1 permit 6.0.0.0 0.15.255.255
access-list 1 permit 146.6.0.0 0.0.15.255
access-list 1 permit 206.6.6.0 0.0.0.15
access-list 1 permit 10.1.1.4 0.0.0.3
route-map control-eigrp permit 10
 match ip address 1
 set metric 200
!
route-map control-eigrp permit 20
 set metric 100

Verification

Verify that the new metric has been applied to the redistributed EIGRP routes. On Router A you can look at the IP routing table and the OSPF database.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
O E2 205.5.5.0/24 [110/100] via 10.1.1.2, 00:01:53, Serial0/1
   206.6.6.0/28 is subnetted, 1 subnets
O E2  206.6.6.0 [110/200] via 10.1.1.2, 00:01:53, Serial0/1
O E2 5.0.0.0/8 [110/100] via 10.1.1.2, 00:01:53, Serial0/1
   6.0.0.0/12 is subnetted, 1 subnets
O E2  6.0.0.0 [110/200] via 10.1.1.2, 00:01:53, Serial0/1
   172.16.0.0/24 is subnetted, 1 subnets
C    172.16.1.0 is directly connected, Ethernet0/0
O E2 145.5.0.0/16 [110/100] via 10.1.1.2, 00:01:54, Serial0/1
   10.0.0.0/30 is subnetted, 2 subnets
C    10.1.1.0 is directly connected, Serial0/1
O E2  10.1.1.4 [110/200] via 10.1.1.2, 00:01:55, Serial0/1
   146.6.0.0/20 is subnetted, 1 subnets
O E2  146.6.0.0 [110/200] via 10.1.1.2, 00:01:55, Serial0/1
rtrA#show ip ospf database external 5.0.0.0
      OSPF Router with ID (1.1.1.1) (Process ID 1)
        Type-5 AS External Link States
 Routing Bit Set on this LSA
 LS age: 254
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 5.0.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000002
 Checksum: 0x8BB6
 Length: 36
 Network Mask: /8
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 100
    Forward Address: 0.0.0.0
    External Route Tag: 0
rtrA#show ip ospf database external 206.6.6.0
      OSPF Router with ID (1.1.1.1) (Process ID 1)
        Type-5 AS External Link States
 Routing Bit Set on this LSA
 LS age: 297
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 206.6.6.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000003
 Checksum: 0x51C4
 Length: 36
 Network Mask: /28
    Metric Type: 2 (Larger than any link state path)
    TOS: 0
    Metric: 200
    Forward Address: 0.0.0.0
    External Route Tag: 0

Configuration Example 8: Modifying the Metric Type of Redistributed Routes Using a Route Map

In Figure 14-3, configuration example 1 for the redistribute route-map command, the EIGRP routes were redistributed into OSPF with a default metric type of 2. For this example, modify the configuration on Router B to change the metric type of the classful routes to type 1.

Router B
router ospf 1
 redistribute eigrp 1 subnets route-map control-eigrp
 network 10.1.1.0 0.0.0.3 area 0
!
access-list 1 permit 6.0.0.0 0.15.255.255
access-list 1 permit 146.6.0.0 0.0.15.255
access-list 1 permit 206.6.6.0 0.0.0.15
access-list 1 permit 
route-map control-eigrp permit 10
 match ip address 1
 set metric 200
!
route-map control-eigrp permit 20
 set metric 100
 set metric-type type-1

Verification

Verify that the classful EIGRP routes have been redistributed into OSPF as metric type 1 routes.

rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route
Gateway of last resort is not set
   1.0.0.0/32 is subnetted, 1 subnets
C    1.1.1.1 is directly connected, Loopback0
O E1 205.5.5.0/24 [110/1662] via 10.1.1.2, 00:01:38, Serial0/1
   206.6.6.0/28 is subnetted, 1 subnets
O E2  206.6.6.0 [110/200] via 10.1.1.2, 00:01:38, Serial0/1
O E1 5.0.0.0/8 [110/1662] via 10.1.1.2, 00:01:38, Serial0/1
   6.0.0.0/12 is subnetted, 1 subnets
O E2  6.0.0.0 [110/200] via 10.1.1.2, 00:01:38, Serial0/1
   172.16.0.0/24 is subnetted, 1 subnets
C    172.16.1.0 is directly connected, Ethernet0/0
O E1 145.5.0.0/16 [110/1662] via 10.1.1.2, 00:01:39, Serial0/1
   10.0.0.0/30 is subnetted, 2 subnets
C    10.1.1.0 is directly connected, Serial0/1
O E2  10.1.1.4 [110/200] via 10.1.1.2, 00:01:41, Serial0/1
   146.6.0.0/20 is subnetted, 1 subnets
O E2  146.6.0.0 [110/200] via 10.1.1.2, 00:01:41, Serial0/1

Configuration Example 9: Modifying the Tag Value of Redistributed Routes Using a Route Map

Modify the configuration on Router B (see Figure 14-3) to set the tag value for the classless routes to 1 and the classful routes to 2.

Router B
router ospf 1
 redistribute eigrp 1 subnets route-map control-eigrp
 network 10.1.1.0 0.0.0.3 area 0
!
access-list 1 permit 6.0.0.0 0.15.255.255
access-list 1 permit 146.6.0.0 0.0.15.255
access-list 1 permit 206.6.6.0 0.0.0.15
access-list 1 permit 10.1.1.4 0.0.0.3
route-map control-eigrp permit 10
 match ip address 1
 set metric 200
 set tag 1
!
route-map control-eigrp permit 20
 set metric 100
 set metric-type type-1
 set tag 2

Verification

Verify that the tags have been set on the redistributed EIGRP routes.

rtrB#show ip ospf database external 5.0.0.0
    OSPF Router with ID (2.2.2.2) (Process ID 1)
        Type-5 AS External Link States
 LS age: 164
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 5.0.0.0 (External Network Number )
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000007
 Checksum: 0x2299
 Length: 36
 Network Mask: /8
    Metric Type: 1 (Comparable directly to link state metric)
    TOS: 0
    Metric: 100
    Forward Address: 0.0.0.0
    External Route Tag: 2
rtrA#show ip route 206.6.6.0 255.255.255.240
Routing entry for 206.6.6.0/28
 Known via "ospf 1", distance 110, metric 200
 Tag 1, type extern 2, forward metric 1562
 Last update from 10.1.1.2 on Serial0/1, 00:04:40 ago
 Routing Descriptor Blocks:
 * 10.1.1.2, from 2.2.2.2, 00:04:40 ago, via Serial0/1
   Route metric is 200, traffic share count is 1

Configuration Example 10: Controlling Route Redistribution Based on Tag Values

In Figure 14-4, Router B is learning six routes via EIGRP. The EIGRP routes are redistributed into OSPF with the classful routes assigned a tag of 2 and the classless routes a tag of 1. Router A is redistributing the OSPF external routes into RIP-2. The policy is to redistribute only the classless routes into RIP-2. This can be accomplished using a route map and an IP access list. Because the external routes have been tagged, a route map can be used that redistributes only routes with a tag value equal to 1. Configure the routers as shown in the listing that follows the figure. Initially, all OSPF routes will be redistributed into RIP-2 on Router A.

Figure 14-4Figure 14-4 A Route Map Can Be Used to Control Route Redistribution Based on the Tag Value

Router A
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Serial0/0
 bandwidth 64
 ip address 10.1.1.9 255.255.255.252
 no ip mroute-cache
!
interface Serial0/1
 bandwidth 64
 ip address 10.1.1.1 255.255.255.252
 clockrate 64000
!
router ospf 1
 network 10.1.1.0 0.0.0.3 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 1
 passive-interface Serial0/1
 network 10.0.0.0
 no auto-summary
Router B
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial0
 bandwidth 64
 ip address 10.1.1.2 255.255.255.252
 no ip directed-broadcast
!
interface Serial1
 bandwidth 64
 ip address 10.1.1.5 255.255.255.252
 clockrate 64000
!
!
router eigrp 1
 network 10.0.0.0
!
router ospf 1
 redistribute eigrp 1 subnets route-map set-tags
 network 10.1.1.0 0.0.0.3 area 0
!
access-list 1 permit 6.0.0.0 0.15.255.255
access-list 1 permit 146.6.0.0 0.0.15.255
access-list 1 permit 206.6.6.0 0.0.0.15
access-list 1 permit 10.1.1.4 0.0.0.3
route-map set-tags permit 10
 match ip address 1
 set tag 1
!
route-map set-tags permit 20
 set tag 2
Router C
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface Loopback1
 ip address 5.5.5.5 255.0.0.0
!
interface Loopback2
 ip address 6.6.6.6 255.240.0.0
!
interface Loopback3
 ip address 145.5.5.5 255.255.0.0
!
interface Loopback4
 ip address 146.6.6.6 255.255.240.0
!
interface Loopback5
 ip address 205.5.5.5 255.255.255.0
!
interface Loopback6
 ip address 206.6.6.6 255.255.255.240
!
interface Serial0
 bandwidth 64
 ip address 10.1.1.6 255.255.255.252
 no ip directed-broadcast
!
router eigrp 1
 network 5.0.0.0
 network 6.0.0.0
 network 10.0.0.0
 network 145.5.0.0
 network 146.6.0.0
 network 205.5.5.0
 network 206.6.6.0
 no auto-summary

Router D
interface Serial0/1
 ip address 10.1.1.10 255.255.255.252
 clockrate 64000
!
router rip
 version 2
 network 10.0.0.0

Verify that Router D is receiving the redistributed OSPF routes from Router A.

rtrD#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o - ODR
Gateway of last resort is not set
R  205.5.5.0/24 [120/1] via 10.1.1.9, 00:00:01, Serial0/1
   206.6.6.0/28 is subnetted, 1 subnets
R    206.6.6.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
R  5.0.0.0/8 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
   6.0.0.0/12 is subnetted, 1 subnets
R    6.0.0.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
   172.16.0.0/24 is subnetted, 1 subnets
R    172.16.1.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
R  145.5.0.0/16 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
   10.0.0.0/30 is subnetted, 3 subnets
C    10.1.1.8 is directly connected, Serial0/1
R    10.1.1.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
R    10.1.1.4 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
   146.6.0.0/20 is subnetted, 1 subnets
R    146.6.0.0 [120/1] via 10.1.1.9, 00:00:05, Serial0/1

Modify the configuration on Router A so that only OSPF routes with a tag value of 1 get redistributed into RIP.

Router A
router rip
 version 2
 redistribute ospf 1 metric 1 route-map check-tags
 passive-interface Serial0/1
 network 10.0.0.0
 no auto-summary
!
route-map check-tags permit 10
 match tag 1

Verification

Verify that the only OSPF routes redistributed into RIP on Router A are those routes with a tag value of 1.

rtrD#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
    U - per-user static route, o - ODR
Gateway of last resort is not set
   206.6.6.0/28 is subnetted, 1 subnets
R    206.6.6.0 [120/1] via 10.1.1.9, 00:00:01, Serial0/1
   6.0.0.0/12 is subnetted, 1 subnets
R    6.0.0.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
   10.0.0.0/30 is subnetted, 3 subnets
C    10.1.1.8 is directly connected, Serial0/1
R    10.1.1.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
R    10.1.1.4 [120/1] via 10.1.1.9, 00:00:02, Serial0/1
   146.6.0.0/20 is subnetted, 1 subnets
R    146.6.0.0 [120/1] via 10.1.1.9, 00:00:02, Serial0/1

Troubleshooting

Step 1

Verify that the routes have been assigned the proper tags by using the command show ip ospf database external or the command show ip route ip-address mask.

Step 2

Verify that the redistribute command is referencing the correct routing process and process number (if applicable).

Step 3

Verify that the redistribute command is referencing the correct route map name.

Step 4

Verify the syntax and logic of the route map.


To avoid problems associated with mutual redistribution, use a distribute list (see Sections 7-5, 7-10, and 7-15) or a route map to allow only routes that have originated in the routing process domain. For example, if EIGRP is redistributed into OSPF and OSPF is redistributed into EIGRP on the same router, then OSPF routes will be redistributed back into OSPF from EIGRP and EIGRP routes will be redistributed back into EIGRP from OSPF. Using a route map or distribute list will prevent this from occurring.