10-25-2018 04:43 AM
I like to redistribute some BGP-learnd prefixes into OSPF with a route-policy filter.
The route-policy should only allow BGP prefixes with a specify BGP-community to be redistributed into OSPF.
That's the route-policy
route-policy TEST
if community matches-any (65100:123) then
done
endif
end-policy
And that's the error:
RP/0/RSP0/CPU0:a---ASR9K-LAB---a(config)#router ospf TEST
RP/0/RSP0/CPU0:a---ASR9K-LAB---a(config-ospf)#address-family ipv4 unicast
RP/0/RSP0/CPU0:a---ASR9K-LAB---a(config-ospf)#redistribute bgp 65100 route-policy TEST
RP/0/RSP0/CPU0:a---ASR9K-LAB---a(config-ospf)#commit
% Failed to commit one or more configuration items during a pseudo-atomic operation. All changes made have been reverted. Please issue 'show configuration failed [inheritance]' from this session to view the errors
RP/0/RSP0/CPU0:a---ASR9K-LAB---a(config-ospf)#show configuration failed
!! SEMANTIC ERRORS: This configuration was rejected by
!! the system due to semantic errors. The individual
!! errors with each failed configuration command can be
!! found below.
router ospf TEST
redistribute bgp 15623 route-policy TEST
!!% Could not find entry in list: Policy [TEST] uses the 'community' attribute. There is no 'community' attribute at the ospf redistribution attach point.
Under IOS and IOS-XE this is not a problem, but under IOS XR?
There is no 'community' attribute at the ospf redistribution attach point.
That doesn't make sense to me; it's redistributed FROM BGP, and in BGP I have the community atribute...
Does someone has a solution for this?
Solved! Go to Solution.
10-25-2018 10:55 AM
The issue is that the route redistribution is actually not performed from BGP, but from the BGP routes in the RIB. It is a subtle difference, but it makes a big difference when it comes to route redistribution.
The RIB doesn't hold the communities tied to the routes, hence OSPF not being able to use the community to discriminate on, which routes to redistribute or not. An enhancement has been introduced in IOS to allow this, but it is unfortunately not available in XR.
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.
Regards,
10-25-2018 10:55 AM
The issue is that the route redistribution is actually not performed from BGP, but from the BGP routes in the RIB. It is a subtle difference, but it makes a big difference when it comes to route redistribution.
The RIB doesn't hold the communities tied to the routes, hence OSPF not being able to use the community to discriminate on, which routes to redistribute or not. An enhancement has been introduced in IOS to allow this, but it is unfortunately not available in XR.
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.
Regards,
10-25-2018 12:20 PM - edited 10-25-2018 12:23 PM
Thank you very much for the explanation.
I have two routers that act as gateways and redistribute between BGP and OSPF. Like this https://community.cisco.com/t5/network-architecture-documents/preventing-route-looping-by-using-route-tagging/ta-p/3125017
That's the reason, why I need the route-policy filter based on BGP communities. With your explanation, I think I can do this, but it's more complicated then it was under IOS... Is there another, more elegant, way in IOS-XR to prevent this type of routing loops?
10-25-2018 04:06 PM
There are several ways to accomplish what you want, but without knowing the specifics of your design, it is hard to comment on what is the most elegant way is. The example you give is just a generic example of mutual redistribution between eigrp and ospf.
Regards,
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