cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1781
Views
5
Helpful
22
Replies

BGP/OSPF Reditribution

inderjeet452
Level 1
Level 1

Hi Folks,

Hope all are doing good.

I need your support on one case where we are having eBGP between upstream ISP to my core router and inside my networks multiple routers are connected with my Core Routers and Running OSPF internally.

Done redistribution of OSPF to BGP and BGP to OSPF on both core routers(R2 and R5) in attached topology. As per my understanding loop will be created, but I am able to reach towards PC from R8 or any other Router. 

 

Can someone help to understand, why loop is not creating even after redistribution of protocols with each other.

22 Replies 22

R9 AS-path for ibgp path  is only 9829 and for ebgp path 9829 100 

So ebgp is longest than ibgp and hence always ibgp is select as best path and it correct and there is no loop

MHM

Check above 

This why there is no loop

MHM

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @inderjeet452 ,

issues can arise when a topology change happens. If for example you shut down one interface in one OSPF router.

For real world scenarios involving OSPF and BGP you can avoid mutual redistribution in multiple points by using network commands in BGP to advertise OSPF learned prefixes in BGP. Eventually combined with aggregate commands in BGP.

If mutual redistribution is needed appropriate route tagging or BGP community settings can be used to avoid re-injection of OSPF route from BGP in OSPF and vice versa

Route-maps need to be used with a first block with deny action like

route-map BGP-into-OSPF deny 10

match route-tag 179

route-map BGP-into-OSPF permit 10

set route tag 179

Hope to help

Giuseppe

 

srimal99
Level 1
Level 1

In addition to mentioned above, You have same As100 configured on both areas. Have you configured as-allowed or as-override ?
You can incorporate regular expression for traffic engineering and manipulation. Worth refer to link below
https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13754-26.html

inderjeet452
Level 1
Level 1

Hi All,

Thanks for your valuable responses for the mentioned query.

I have checked and done allow AS-in on both Routers(R2 and R5). Getting prefix 192.168.0.0/24 from 2 path. Output is pasted below.

R9#sh ip bgp 192.168.0.0
*Sep 11 12:58:22.703: %SYS-5-CONFIG_I: Configured from console by console
R9#sh ip bgp 192.168.0.0
BGP routing table entry for 192.168.0.0/24, version 68
Paths: (2 available, best #1, table default)
Flag: 0x820
Not advertised to any peer
Refresh Epoch 1
Local
10.10.20.1 from 10.10.20.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
100
10.10.30.2 from 10.10.30.2 (5.5.5.5)
Origin incomplete, metric 1, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
R9#

As seen in above output, one path which is valid and best is known via "IGP" and another is via redistribute "Incomplete". Hope due to these attributes, loop is not forming. Or is there any other reason, please let me know.

Thanks in advance.....!!!!

Forget incomplete, origin selection come after as-path length. 

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

As I mentioned ibgp must win because it have shortest as-path

Do show ip bgp and check this point 

MHM

Hello
When performing mutual redistribution at dual redistribution points, you could indeed incur loops in the network.

As stated by others using route tags to permit and deny is a good way of negating such issues specifically between two differing IGPs, but when you have and BGP/IGP redistribution I would say a good way would to incorporate BOTH route tags and BGP attributes.

This would mean setting route-tags to BGP redistributed routes into OSPF and  Community attributes to redistributed OSPF routes into BGP.

Example:

bgp - 179
ospf- 89

ip bgp-community new-format
ip community-list standard OSPF-TAG permit 100:89

route-map bgp-ospf deny 10
match community OSPF-TAG

route-map bgp-ospf permit 100
set tag 179

route-map ospf-bgp deny 10
match tag 179

route-map ospf-bgp permit 100
set community 100:89

router bgp xx
redsitribtue ospf route-map ospf-bgp 

router ospf
redsitribtue bgp route-map bgp-ospf subnets


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

inderjeet452
Level 1
Level 1

At last as I understood, as per @MHM Cisco World , iBGP path will win as it is having shortest AS Path and Downward on R8, it will be having multiple Paths to reach 192.168.0.0 subnet, where OSPF will win.

Thanks @paul driver @srimal99 @Giuseppe Larosa @David Ruess Everyone for your valuable comments and guidance....!!!

That was a great discussion....!!!