1

I have a requirement to do a Cisco IOS-XR Route-policy to allow only routes that have a single community tagged and not allow routes with multiple community tags.

I built a lab that has two routes:

  • 10.70.151.1/32 - Has a tag of 64555:100
  • 10.70.151.2/32 - Has a tag of 64555:100 and 64555:200

I tried this policy but both routes keep getting passed and I just need the first route to pass :

route-policy ALLOW_SINGLE_COMM
  if community matches-every (ios-regex '^64555:100$') then
    pass
  else
    drop
  endif
end-policy

Below is some outputs: enter image description here enter image description here

13
  • How are you applying the policy? We need to see more of your configuration, for example, the entire BGP configuration. – Ron Maupin Jun 2 '20 at 22:12
  • Thanks for the feedback Ron..i have updated the question. – Rehaan Jun 2 '20 at 23:08
  • Does that route actually show up in the routing table? BGP is receiving the prefix, so it will be in the BGP table. Applying that outbound from the other router would prevent it from being sent and received, but I think anything received will end up in the BGP table, but not necessarily the routing table. – Ron Maupin Jun 2 '20 at 23:13
  • Also, try clearing all BGP prefixes, so that it must reload the prefixes from its peer. – Ron Maupin Jun 2 '20 at 23:15
  • Hi Ron, I have tried clearing the bgp neighbors. The route still shows up in routing table on the receiving router, even though there is an inbound route policy as per the config. – Rehaan Jun 2 '20 at 23:18
3

Logged a Case with Cisco and the RPL developer has confirmed you cannot only match a single part of a community string, it will always evaluate the whole community string, so can't be done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.