Tested in VyOS 1.4-rolling-202207160217
When trying to perform a "match" on the length of a prefix, it matches all prefixes
Simple example
To recreate:
VyOS1 config:
set interfaces dummy dum1 address '1.1.1.1/24' set interfaces dummy dum9 address '9.9.9.9/24' set interfaces ethernet eth0 address '12.12.12.1/24' set policy route-map EXT-IN rule 100 action 'permit' set policy route-map EXT-IN rule 100 match ip address prefix-len '24' set policy route-map EXT-IN rule 100 set community '100:24' set policy route-map EXT-IN rule 200 action 'permit' set policy route-map EXT-IN rule 200 match ip address prefix-len '23' set policy route-map EXT-IN rule 200 set community '100:23' set policy route-map EXT-IN rule 300 action 'permit' set policy route-map EXT-IN rule 300 match ip address prefix-len '22' set policy route-map EXT-IN rule 300 set community '100:22' set protocols bgp address-family ipv4-unicast network 1.1.1.0/24 set protocols bgp address-family ipv4-unicast redistribute connected set protocols bgp local-as '65001' set protocols bgp neighbor 12.12.12.2 address-family ipv4-unicast nexthop-self set protocols bgp neighbor 12.12.12.2 address-family ipv4-unicast route-map import 'EXT-IN' set protocols bgp neighbor 12.12.12.2 address-family ipv4-unicast soft-reconfiguration inbound set protocols bgp neighbor 12.12.12.2 remote-as '65002'
VyOS2 config:
set interfaces dummy dum2 address '2.2.2.2/24' set interfaces ethernet eth0 address '12.12.12.2/24' set protocols bgp address-family ipv4-unicast network 2.2.2.0/24 set protocols bgp address-family ipv4-unicast network 8.0.0.0/22 set protocols bgp address-family ipv4-unicast network 8.0.0.0/23 set protocols bgp address-family ipv4-unicast network 8.0.0.0/24 set protocols bgp local-as '65002' set protocols bgp neighbor 12.12.12.1 address-family ipv4-unicast nexthop-self set protocols bgp neighbor 12.12.12.1 address-family ipv4-unicast soft-reconfiguration inbound set protocols bgp neighbor 12.12.12.1 remote-as '65001' set protocols static route 8.0.0.0/22 blackhole set protocols static route 8.0.0.0/23 blackhole set protocols static route 8.0.0.0/24 blackhole
Expect to see these communities on VyOS-1:
community '100:24': 2.2.2.0/24, 8.0.0.0/24 community '100:23': 8.0.0.0/23 community '100:22': 8.0.0.0/22
However, we see these communities:
vyos@vyos:~$ sh ip bgp community 100:22 <EMPTY> vyos@vyos:~$ sh ip bgp community 100:23 <EMPTY> vyos@vyos:~$ sh ip bgp community 100:24 BGP table version is 23, local router ID is 12.12.12.1, vrf id 0 Default local pref 100, local AS 65001 Network Next Hop Metric LocPrf Weight Path *> 2.2.2.0/24 12.12.12.2 0 0 65002 i *> 8.0.0.0/22 12.12.12.2 0 0 65002 i *> 8.0.0.0/23 12.12.12.2 0 0 65002 i *> 8.0.0.0/24 12.12.12.2 0 0 65002 i