I’m having the same type of issue with deleting communities in a route.
Here is a received route with a large community
[zuul@rtr-core-01.v7.ipa.dev] > routing/route/print det where dst-address=0.0.0.0/0 && bgp
Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, y - copy; H - hw-offloaded; + - ecmp, B - blackhole
AbH afi=ip4 contribution=active dst-address=0.0.0.0/0 routing-table=main gateway=100.127.1.1 immediate-gw=100.126.1.1%vlan3100 distance=200 scope=40 target-scope=30
belongs-to="bgp-IP-100.127.1.1"
bgp.peer-cache-id=*B000002 .as-path="65102" .communities=1016:0 .large-communities=1016:65102:4 .local-pref=100 .atomic-aggregate=yes .origin=igp
debug.fwp-ptr=0x202C2AE0
When I apply this filter:
add chain=ipv4-remove-isp-origin-community-2 rule="if ( bgp-large-communities equal 1016:65102:4 ) { delete bgp-large-communities all; accept;}"
The community is deleted as shown
[zuul@rtr-core-01.v7.ipa.dev] > routing/route/print det where dst-address=0.0.0.0/0
Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, y - copy; H - hw-offloaded; + - ecmp, B - blackhole
AbH afi=ip4 contribution=active dst-address=0.0.0.0/0 routing-table=main gateway=100.127.1.1 immediate-gw=100.126.1.1%vlan3100 distance=200 scope=40 target-scope=30
belongs-to="bgp-IP-100.127.1.1"
bgp.peer-cache-id=*B000002 .as-path="65102" .communities=1016:0 .local-pref=100 .atomic-aggregate=yes .origin=igp
debug.fwp-ptr=0x202C2AE0
However when I apply this filter
/routing filter community-large-list
add communities=1016:65102:4 list=bgp-community-large-1016-65102-4
routing/filter/rule/
routing/filter/rule/set rule="if ( bgp-large-communities equal-list bgp-community-large-1016-65102-4 ) { delete bgp-large-communities all; accept;}"
The large community is not deleted:
[zuul@rtr-core-01.v7.ipa.dev] > routing/route/print det where dst-address=0.0.0.0/0 && bgp
Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, y - copy; H - hw-offloaded; + - ecmp, B - blackhole
AbH afi=ip4 contribution=active dst-address=0.0.0.0/0 routing-table=main gateway=100.127.1.1 immediate-gw=100.126.1.1%vlan3100 distance=200 scope=40 target-scope=30
belongs-to="bgp-IP-100.127.1.1"
bgp.peer-cache-id=*B000002 .as-path="65102" .communities=1016:0 .large-communities=1016:65102:4 .local-pref=100 .atomic-aggregate=yes .origin=igp
debug.fwp-ptr=0x202C2AE0