OSPF IPv4 - Redistribution

Redistribution

OSPF (Open Shortest Path First) for IPv4 redistribution is a mechanism employed to share routing information between OSPF and other routing domains, allowing for the integration of diverse routing protocols within a network. In OSPF, redistribution typically occurs at an Autonomous System Border Router (ASBR) where routes from external sources, such as other OSPF areas, RIP, EIGRP, or BGP, are injected into the OSPF routing table. Careful consideration is required during redistribution to ensure that routes maintain accuracy and consistency across the different routing domains. Route tags and metrics may be manipulated to influence the path selection process within OSPF. Redistribution plays a crucial role in enabling interoperability between OSPF and other routing protocols, facilitating seamless communication and routing in complex heterogeneous networks. However, proper planning and configuration are essential to mitigate potential issues like routing loops and suboptimal path selection that can arise from redistribution.

Lab:

Disclaimer

This Configuration Guide is designed to assist members to enhance their skills in particular technology area. While every effort has been made to ensure that all material is as complete and accurate as possible, the enclosed material is presented on an Dzas isdz basis. Neither the authors nor Forum assume any liability or responsibility to any person or entity with respect to loss or damages incurred from the information contained in this guide. This configuration guide was developed by Forum. Any similarities between material presented in this configuration guide and any other material is completely coincidental.

Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.2(4)M1, DEVELOPMENT TEST SOFTWARE

Task 1: Configure IPv4 OSPF Redistribution

Step 1: In the configuration mode of router configure 4 loopbacks with network address in sequence

R2:
interface loop100
ip address 100.0.0.2 255.255.255.0
interface loop101
ip address 100.0.1.2 255.255.255.0
interface loop102
ip address 100.0.2.2 255.255.255.0
interface loop103
ip address 100.0.3.2 255.255.255.0
exit

Step 2: Redistribute these connected network in OSPF process (External Type 2)

R2:
router ospf 2
redistribute connected subnet
exit

Redistributed connected will redistribute its connected network. Subnet will allow classless routes in OSPF process

R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - OSPF, EX - OSPF 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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      11.0.0.0/32 is subnetted, 3 subnets
C        11.0.0.0/24 is directly connected, Loopback0
L        11.0.0.1/32 is directly connected, Loopback0
C        11.0.1.0/24 is directly connected, Loopback1
L        11.0.1.1/32 is directly connected, Loopback1
C        11.0.2.0/24 is directly connected, Loopback2
L        11.0.2.1/32 is directly connected, Loopback2
C        11.0.3.0/24 is directly connected, Loopback3
L        11.0.3.1/32 is directly connected, Loopback3
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.0.0.0/24 is directly connected, Serial2/0
L        12.0.0.1/32 is directly connected, Serial2/0
      22.0.0.0/22 is subnetted, 1 subnets
O IA     22.0.0.0 [110/65] via 12.0.0.2, 00:29:48, Serial2/0
      23.0.0.0/24 is subnetted, 1 subnets
O IA     23.0.0.0 [110/74] via 12.0.0.2, 02:02:25, Serial2/0
      33.0.0.0/32 is subnetted, 3 subnets
O IA     33.0.1.3 [110/75] via 12.0.0.2, 02:02:25, Serial2/0
O IA     33.0.2.3 [110/75] via 12.0.0.2, 02:02:25, Serial2/0
O IA     33.0.3.3 [110/75] via 12.0.0.2, 02:02:25, Serial2/0
      34.0.0.0/24 is subnetted, 1 subnets
O IA     34.0.0.0 [110/138] via 12.0.0.2, 02:02:25, Serial2/0
      44.0.0.0/32 is subnetted, 3 subnets
O IA     44.0.1.4 [110/139] via 12.0.0.2, 02:02:25, Serial2/0
O IA     44.0.2.4 [110/139] via 12.0.0.2, 02:02:25, Serial2/0
O IA     44.0.3.4 [110/139] via 12.0.0.2, 02:02:25, Serial2/0
      100.0.0.0/24 is subnetted, 4 subnets
O E2     100.0.0.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.1.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.2.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.3.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0

E2 means External route type 2, in which will not change cost after every hop throughout the OSPF.

Step 3: Redistribute these connected network in OSPF process (External Type 1)

R2:
router ospf 2
redistribute connected subnet metric-type 1
exit

Redistributed connected will redistribute its connected network. Subnet will allow classless routes in OSPF process Metric type 1 means will redistribute in the form of E1, in which will change cost after every hop.

R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - OSPF, EX - OSPF 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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

           11.0.0.0/32 is subnetted, 3 subnets
C        11.0.0.0/24 is directly connected, Loopback0
L        11.0.0.1/32 is directly connected, Loopback0
C        11.0.1.0/24 is directly connected, Loopback1
L        11.0.1.1/32 is directly connected, Loopback1
C        11.0.2.0/24 is directly connected, Loopback2
L        11.0.2.1/32 is directly connected, Loopback2
C        11.0.3.0/24 is directly connected, Loopback3
L        11.0.3.1/32 is directly connected, Loopback3
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.0.0.0/24 is directly connected, Serial2/0
L        12.0.0.1/32 is directly connected, Serial2/0
      22.0.0.0/22 is subnetted, 1 subnets
O IA     22.0.0.0 [110/65] via 12.0.0.2, 00:33:04, Serial2/0
      23.0.0.0/24 is subnetted, 1 subnets
O IA     23.0.0.0 [110/74] via 12.0.0.2, 02:05:41, Serial2/0
      33.0.0.0/32 is subnetted, 3 subnets
O IA     33.0.1.3 [110/75] via 12.0.0.2, 02:05:41, Serial2/0
O IA     33.0.2.3 [110/75] via 12.0.0.2, 02:05:41, Serial2/0
O IA     33.0.3.3 [110/75] via 12.0.0.2, 02:05:41, Serial2/0
      34.0.0.0/24 is subnetted, 1 subnets
O IA     34.0.0.0 [110/138] via 12.0.0.2, 02:05:41, Serial2/0
      44.0.0.0/32 is subnetted, 3 subnets
O IA     44.0.1.4 [110/139] via 12.0.0.2, 02:05:41, Serial2/0
O IA     44.0.2.4 [110/139] via 12.0.0.2, 02:05:41, Serial2/0
O IA     44.0.3.4 [110/139] via 12.0.0.2, 02:05:41, Serial2/0
      100.0.0.0/24 is subnetted, 4 subnets
O E1     100.0.0.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
O E1     100.0.1.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
O E1     100.0.2.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
O E1     100.0.3.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0

E1 means External route type 1, in which will change cost after every hop throughout the OSPF.

Task 2: Verification:

Step 1: Analyze network type as E1 or E2 and its cost of redistribution route in neighbor router

External Type 2:

R1#show ip route
O E2     100.0.0.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.1.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.2.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.3.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
R3#show ip route
O E2     100.0.0.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.1.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.2.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0
O E2     100.0.3.0 [110/20] via 12.0.0.2, 00:03:30, Serial2/0

R1 router receives redistributed 100 network with metric (cost) 20 and R3 router receives redistributed 100 network with metric (cost) 20 Hence External type 2 (E2) cost remains constant after every hop

Step 2: Analyze network type as E1 or E2 and its cost of redistribution route in neighbor router

External Type 1:

O E1     100.0.0.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
O E1     100.0.1.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
O E1     100.0.2.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
O E1     100.0.3.0 [110/84] via 12.0.0.2, 00:00:16, Serial2/0
R3#show ip route
O E1     100.0.0.0 [110/30] via 23.0.0.2, 00:03:36, Ethernet0/0
O E1     100.0.1.0 [110/30] via 23.0.0.2, 00:03:36, Ethernet0/0
O E1     100.0.2.0 [110/30] via 23.0.0.2, 00:03:36, Ethernet0/0
O E1     100.0.3.0 [110/30] via 23.0.0.2, 00:03:36, Ethernet0/0

R1 router receives redistributed 100 network with metric (cost) 84 and R3 router receives redistributed 100 network with metric (cost) 30 Hence External type 1 (E1) allows to change cost after every hop