Page MenuHomeVyOS Platform

route-map "set community additive" not working correctly
Closed, ResolvedPublicBUG

Description

While the keyword "additive" is implemented for communities in route-maps, it is currently not usable I think:

[edit policy route-map community-test]
vyos@vyos# set rule 10 set community 6500:123 additive

  Configuration path: rule 10 set community 6500:123 [additive] is not valid
  Set failed

[edit policy route-map community-test]
vyos@vyos# set rule 10 set community additive  6500:123

  Configuration path: rule 10 set community additive [6500:123] is not valid
  Set failed

[edit policy route-map community-test]

It is only possible to specify additive without specifying any community, which isn't really useful:

[edit policy route-map community-test]
vyos@vyos# sh
+rule 10 {
+    action permit
+    set {
+        community 6500:123
+    }
+}
[edit policy route-map community-test]
vyos@vyos# set rule 10 set community additive
[edit policy route-map community-test]
vyos@vyos# sh
+rule 10 {
+    action permit
+    set {
+        community additive
+    }
+}
[edit policy route-map community-test]

FRR supports additive for large-communities as well, but it is not currently supported in vyos.

Version:

vyos@vyos# run sh version

Version:          VyOS 1.3-rolling-202009030118
Release Train:    equuleus

Built by:         [email protected]
Built on:         Thu 03 Sep 2020 01:18 UTC
Build UUID:       83c8515b-213b-4ac6-9b9a-2a0f24bbbda7
Build Commit ID:  221fd153830307

Architecture:     x86_64
Boot via:         livecd
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:     Unknown
Hardware UUID:    Unknown

Copyright:        VyOS maintainers and contributors

Details

Version
1.3-rolling-202009030118
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Tested in LTS 1.2.5 and latest rolling release, where it is not allowing to add the AA:NN along with Additive

vyos@vyos# set policy route-map test rule 5 set community 100:200 additive

  Configuration path: policy route-map test rule 5 set community 100:200 [additive] is not valid
  Set failed

The additive keyword is specified so that the new value is appended to the existing value. It should be used as prefix.

These are the following available options for "community" value:

vyos@vyos# set policy route-map test rule 5 set community
Possible completions:
   <AA:NN>      Community in 4 octet AS:value format
   local-AS     Advertise communities in local AS only (NO_EXPORT_SUBCONFED)
   no-advertise Don't advertise this route to any peer (NO_ADVERTISE)
   no-export    Don't advertise outside of this AS of confederation boundry (NO_EXPORT)
   internet     Symbolic Internet community 0
   additive     Add the community instead of replacing existing communities
   none

I tried in vtysh terminal and both of these commands worked "set community 100:200 additive" or "set community additive 100:200"

vyos@vyos:~$ vtysh
Hello, this is FRRouting (version 7.3.1-20200726-01-g0cae52083).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
vyos# configure
vyos(config)# route-map rmno-export permit 10
****These are the options, it gives*****
vyos(config-route-map)# set community
  AA:NN  Community number in AA:NN format (where AA and NN are (0-65535)) or local-AS|no-advertise|no-export|internet or additive
  none   No community attribute
vyos(config-route-map)# set community additive 100:200

Output of "show route-map"

BGP:
route-map: rmno-export Invoked: 0
 permit, sequence 10 Invoked 0
  Match clauses:
  Set clauses:
    community 100:200 additive
  Call clause:
  Action:
    Exit routemap

This file /opt/vyatta/share/vyatta-cfg/templates/policy/route-map/node.tag/rule/node.tag/set/community/node.def does not have script to contain multiple values and seems to be a wrong CLI syntax.
Reference phabricator task commit: https://phabricator.vyos.net/R12:aba26326537cca5b689e5a32f860608d2a9f8510

Thanks for testing @SrividyaA . As described in the commit you mentioned (https://phabricator.vyos.net/R12:aba26326537cca5b689e5a32f860608d2a9f8510), the additive keyword works correctly when the string is quoted, and it also works for large-communities, even though "additive" is not suggested in the tab completion for large-communities:

vyos@vyos# show policy route-map community-test |commands
set rule 10 action 'permit'
set rule 10 on-match next
set rule 10 set community '6500:123 additive'
set rule 10 set large-community '65000:12345 additive'
set rule 20 action 'permit'
set rule 20 set community '6500:456 additive'
set rule 20 set large-community '65000:6789 additive'

vyos@vyos# sh proto bgp | commands
set bgp 65000 neighbor 10.0.0.1 address-family ipv4-unicast route-map import 'community-test'
set bgp 65000 neighbor 10.0.0.1 remote-as '65001'
set bgp 65000 parameters router-id '10.0.0.0'
vyos@vyos# run show ip bgp 172.16.0.0/24
BGP routing table entry for 172.16.0.0/24
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  10.0.0.1
  65001
    10.0.0.1 from 10.0.0.1 (10.0.0.1)
      Origin IGP, metric 0, valid, external, best (First path received)
      Community: 6500:123 6500:456
      Large Community: 65000:0:6789 65000:0:12345
      Last update: Mon Sep 21 11:32:34 2020
Viacheslav claimed this task.
erkin set Issue type to Bug (incorrect behavior).Aug 29 2021, 1:11 PM
erkin removed a subscriber: Global Notifications.