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

IOS XR route-policy matching community problem

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?

1 Accepted Solution

Accepted Solutions

Harold Ritter
Cisco Employee
Cisco Employee

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,

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

View solution in original post

3 Replies 3

Harold Ritter
Cisco Employee
Cisco Employee

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,

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

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?

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,

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
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