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