Page MenuHomeVyOS Platform

Add option to append route-target when adding additional imports
Confirmed, NormalPublicFEATURE REQUEST

Description

Currently, adding additional route-target imports will overwrite the existing imports. I'd like to see the behavior of creating additional imports be an append action to existing imports instead of rewriting the existing import. This is more in line with how enterprise gear would handle this.

Someone could cause an outage if they’re not aware of how that behavior differs from what they’ve known.

For instance, if this already exists:

set vrf name red protocols bgp address-family ipv4-unicast route-target vpn import '65500:200'

And I type this:

set vrf name red protocols bgp address-family ipv4-unicast route-target vpn import '65500:300'

It should create this instead of rewriting the original import:

set vrf name red protocols bgp address-family ipv4-unicast route-target vpn import '65500:200 65500:300'

Maybe add a switch to the end of the command that allows the append behavior. Something like:

set vrf name red protocols bgp address-family ipv4-unicast route-target vpn import '65500:300' append

Performing a delete action should simply remove that route-target from the existing list, unless it is the only route-target in the list, in which case the import is removed entirely.

Details

Difficulty level
Easy (less than an hour)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)

Event Timeline

We don't need append
We should use leafNode type /multi for example https://github.com/vyos/vyos-1x/blob/4c29922cc0baa9c127391b58e82b76f69e1e2dce/interface-definitions/include/bgp/afi-l2vpn-common.xml.i#L43

Do this change here https://github.com/vyos/vyos-1x/blob/4c29922cc0baa9c127391b58e82b76f69e1e2dce/interface-definitions/include/bgp/afi-route-target-vpn.xml.i#L24-L35

And expected config

set vrf name red protocols bgp address-family ipv4-unicast route-target vpn import '65500:200'
set vrf name red protocols bgp address-family ipv4-unicast route-target vpn import '65500:300'
Viacheslav changed the task status from Open to Confirmed.Jan 12 2024, 6:18 PM
Viacheslav triaged this task as Normal priority.

This would be a great feature to have. I ran into this the other day and found out via slack single-quotes works, but only for a one-liner. ex. set route-target vpn import '65000:1 65000:2'.

Ideally we could support both the one liner and multi option?

L0crian changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
L0crian changed Version from - to - .
L0crian changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.