cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
540
Views
0
Helpful
8
Replies

OSPF 1 -> BGP -> OSPF 2 redistribution

ldeoliveira
Level 1
Level 1

Hello Gurus....

The other day I ran into a redistribution scenario that I was surprised to find out didn't really work as expected.

I have one router R1 which runs 2 x OSPF processes as well as BGP (all BGP neighbours belong to other AS' so eBGP throughout).

The topology looks like this:

R4 ----(OSPF Process 2)----- R1 -------(eBGP)---------- R2

 |

 (OSPF Process 1)

 |

R3

Again, R1 uses OSPF process 2 to talk to R4, BGP to talk to R2 and OSPF process 1 to talk to R3.

The way I wanted redistribution to work in R1 is as below:

  • OSPF 1-> BGP
  • OSPF 2-> BGP
  • BGP -> OSPF 2
  • OSPF 1 receives only a default route as it's a stub site.

I expected OSPF 1 to redistribute the routes learned from R3 into BGP, then for BGP in turn to redistribute those routes into OSPF 2 and onwards to R4 and R2.

What I found instead is that R4 only ever received the original BGP routes from R1 and R2. The OSPF routes that were learned from R3 and redistributed to BGP never made it to R4 (OSPF 1->BGP->OSPF 2 redistribution didn't work).

However, I could see the routes that originated from R3 in both R1 and R2's routing table.

In the end, the only way I could make R4 see R2's routes was to enable redistribution between OSPF processes in R1:

  • OSPF 1 -> OSPF 2

What is the mechanism that prevented BGP from redistributing to OSPF process 2 those routes that it learned from OSPF process 1?

regards,


Leo

1 Accepted Solution

Accepted Solutions

milan.kulik
Level 10
Level 10

Hi,

as you can read here:

http://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/8606-redist.html

"The rules for redistribution on a Cisco router dictate that the redistributed route be present in the routing table. It is not sufficient that the route be present in the routing topology or database."

So when you are redistributing a prefix from OSPF1 to BGP, it's in the router RIB as an OSPF prefix, not a BGP one. That's why the BGP process can't redistribute the prefix to OSPF2.

I believe the reason for this rule is to avoid routing loops during mutual redistributions among mutliple routing protocols running on the same router.

Best regards,

Milan

View solution in original post

8 Replies 8

milan.kulik
Level 10
Level 10

Hi,

as you can read here:

http://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/8606-redist.html

"The rules for redistribution on a Cisco router dictate that the redistributed route be present in the routing table. It is not sufficient that the route be present in the routing topology or database."

So when you are redistributing a prefix from OSPF1 to BGP, it's in the router RIB as an OSPF prefix, not a BGP one. That's why the BGP process can't redistribute the prefix to OSPF2.

I believe the reason for this rule is to avoid routing loops during mutual redistributions among mutliple routing protocols running on the same router.

Best regards,

Milan

I think you're right on the money.

From the point of view of the receiving OSPF process (OSPF 2), it needs to make a decision which BGP routes to import. It will receive a bunch of candidate routes from the BGP process but only the ones that are showing up in that router's routing table as *BGP* routes will be chosen.

While I understood previously that BGP routes would only be redistributed into another routing protocol if they were in the routing table, this scenario still puzzled me as the routes were INDEED in the routing table - just not as BGP routes.

Thanks Milan!

BGP Redistribute Internal 

This command would fix other issue: Prefixes received via iBGP are not redistribuited to other routing protocols by default. BR, Milan

Actually no, because I tried that command as part of my troubleshooting and it didn't do the job.


The point is that the routes in question are not iBGP, so the "bgp redistribute-internal" command doesn't apply.

Yes, exactly.

Can you share the output of

Sh ip route

sh ip bgp summary

sh ip bgp

sh ip os ne

for R1 and R4 respectively

jarar_m01
Level 1
Level 1

Hi ,

Can you please paste your configuration and outputs respectively.

Regards.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card