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

Cisco IOS XR - redistribute from BGP to OSPF filtering on community.

jvoorend
Level 1
Level 1

I am wanting to filter routes from BGP to OSPF based on the BGP community:

 

Have the following setup:

 

community-set GLF_Local_910

  910:910

end-set

route-policy BGP-To-CMN

  if community matches-any GLF_Local_910 then

    pass

  else

    drop

  endif

end-policy

 

When I apply the following to the ospf process:

 

redistribute bgp 4288888888 tag 660 route-policy BGP-To-CMN

 

I get the following:

 

router ospf 10
redistribute bgp 4288888888 tag 660 route-policy BGP-To-CMN
!!% Could not find entry in list: Policy [BGP-To-CMN] uses the 'community' attribute. There is no 'community' attribute at the ospf redistribution attach point.
!

Is there a way under IOS XR to filter from BGP to OSPF based on the community ?

 

Kind Regards

 

John

 

 

5 Replies 5

balaji.bandi
Hall of Fame
Hall of Fame

jvoorend
Level 1
Level 1

Thank you for that - I actually saw that thread however:

 

Mention is made of the below as a solution:

 

"You could set a tag based on the community using a table-policy under the proper address-family and then use this tag to conditionally redistributed the routes in OSPF"

 

What is a "table-policy" and do you have an example of this ?

 

Kind Regards

Hi @jvoorend ,

 

The table-policy is configured to filter routes from the BGP local rib to the routing table. What you want to achieve would look something like this.

 

route-policy bgp2rib
if community matches-any (xxx:xxx) then
set tag 999
endif
end-policy

!

route-policy rib2ospf
if tag eq 999 then
pass
endif
end-policy
!

router ospf xxx

redistribute bgp xxx route-policy rib2ospf

!

router bgp xxx
address-family ipv4 unicast
table-policy bgp2rib
!

 

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

jvoorend
Level 1
Level 1

Many thanks for that - it worked a treat.

 

Kind Regards

 

John

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