05-12-2022 02:43 PM
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
05-12-2022 03:33 PM
check the below thread :
https://community.cisco.com/t5/routing/ios-xr-route-policy-matching-community-problem/td-p/3732661
05-12-2022 03:40 PM
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
05-12-2022 03:50 PM - edited 05-12-2022 03:51 PM
try below example :
05-12-2022 03:54 PM
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,
05-12-2022 04:25 PM
Many thanks for that - it worked a treat.
Kind Regards
John
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide