cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
783
Views
10
Helpful
5
Replies

OSPF - Problem with Static routes redistributed between processes

chrisc100
Level 1
Level 1

Hello
I have 4 devices connected as shown in the diagram.

 

RTRA runs OSPF processes 1+2 for each domain.

 

I am testing redistribution static routes between domain 2->1, I added a static route in RTRB 9.9.9.9 and added "redistribution static subnets" to ospf process 2.

 

This works and RTRC can see the route.

 

However if I add a static route on RTRA and add the same for OSPF process 2 (example 8.8.8.8), the route is not redistributed to OSPF process 1 and RTRC cannot see it.

 

In order for this to work I need to add "redistribute static subnets" to OSPF process 1.

 

Is there a reason why this does not work, i.e. a restriction or some documentation/best practice about it?

 

Thanks in advance.

 

Relevant configs:

RTRC#show run | se route
router ospf 1
network 192.168.10.0 0.0.0.255 area 0

RTRA#show run | se route
router ospf 1
redistribute ospf 2 subnets
network 192.168.10.0 0.0.0.255 area 0

router ospf 2
redistribute static subnets
network 192.168.20.0 0.0.0.255 area 0

ip route 8.8.8.8 255.255.255.255 192.168.20.2


RTRB#show run | se route
router ospf 2
redistribute static subnets
network 192.168.20.0 0.0.0.255 area 0
network 192.168.30.0 0.0.0.255 area 0
ip route 9.9.9.9 255.255.255.255 192.168.30.2

 

As seen 8.8.8.8 is missing from the process 1 (external route) on RTRA, only if I add redistribute static subnets to OSPF 1 this works:

RTRA#show ip ospf database

OSPF Router with ID (192.168.10.1) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
192.168.10.1 192.168.10.1 1054 0x80000006 0x001F3A 1
192.168.10.2 192.168.10.2 986 0x80000004 0x001B3F 1

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
192.168.10.2 192.168.10.2 986 0x80000002 0x00C49F

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
9.9.9.9 192.168.10.1 309 0x80000002 0x00ED19 0

 

2 Accepted Solutions

Accepted Solutions

Harold Ritter
Cisco Employee
Cisco Employee

Hi Chris,

 

This is the correct behavior. The static route is redistributed in process 2, but cannot be redistributed in process 1 via process 2, as it is not installed in the RIB as an ospf route. Using "redistribute static subnets" under ospf 1 is the right way to do it.

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Chris,

Harold is right when using redistribution between routing protocols, including two different OSPF processes, only prefixes that are installed in the IP routing table are actually redistributed ( with just an exemption for connected subnets).

So in this case prefix 8.8.8.8./32 is  installed in IP routing table as S [1/0] via 192.168.20.2.

OSPF process 2 using redistribute static subnets is able to import the route and to create an LSA type 5  for 8.8.8.8

 

OSPF process 1 using redsitribute ospf 2 subnets cannot do the same as prefix 8.8.8.8 is present in OSPF process 2 database as an LSA type 5 but it is not installed in IP routing table.

When you add redistribute static subnets under router ospf 1 it is able to create an LSA type 5 from the static route.

This is correct behaviour and expected.

 

Hope to help

Giuseppe

 

View solution in original post

5 Replies 5

Harold Ritter
Cisco Employee
Cisco Employee

Hi Chris,

 

This is the correct behavior. The static route is redistributed in process 2, but cannot be redistributed in process 1 via process 2, as it is not installed in the RIB as an ospf route. Using "redistribute static subnets" under ospf 1 is the right way to do it.

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

R-B have only one Process which is OSPF 1
R-A have only one process which is OSPF 2
R-C have two process which is OSPF 1 & 2 ?
Now your Q. is if the R-B have static route then it will forward to other process BUT same not happened in R-C??

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Chris,

Harold is right when using redistribution between routing protocols, including two different OSPF processes, only prefixes that are installed in the IP routing table are actually redistributed ( with just an exemption for connected subnets).

So in this case prefix 8.8.8.8./32 is  installed in IP routing table as S [1/0] via 192.168.20.2.

OSPF process 2 using redistribute static subnets is able to import the route and to create an LSA type 5  for 8.8.8.8

 

OSPF process 1 using redsitribute ospf 2 subnets cannot do the same as prefix 8.8.8.8 is present in OSPF process 2 database as an LSA type 5 but it is not installed in IP routing table.

When you add redistribute static subnets under router ospf 1 it is able to create an LSA type 5 from the static route.

This is correct behaviour and expected.

 

Hope to help

Giuseppe

 

Hi Friend I know you mention that this issue solve BUT 
I don't get how? if we config static route then we don't benefit from redistribute, and we need static route for all route behind process 2.

So I think and try and config LAB and finally I get the solution. 
in order to not suboptimal redistribute from the two process I think Cisco Router give a feature that we 
CAN NOT REDISTRIBUTE FROM ONE PROCESS TO OTHER AND THEN RE-REDISTRIBUTE.

the solution is simply by 

redistribute ospf 1 subnet match internal. 

try my solution and I wait your reply.

Hi Mahmood,

 

The original question was more around, why static route 8.8.8.8/32 that has been redistributed in ospf 2 is not automatically redistributed into ospf 1, since there is a "redistribute ospf 2 subnets" under router ospf 1.

 

The answer is that 8.8.8.8/32 is not going to be redistributed from ospf 2 to ospf 1, even though it is in ospf 2 lsdb, because it is not installed in the local RIB as an ospf route, but rather as a static route.

 

The solution in this specific case is to use the "redistribute static subnets" under "router ospf 1" as well.

 

Regards, 

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
Review Cisco Networking products for a $25 gift card