Feature request: Append values to configuration

Example:

When adding additional interfaces to a VRF on the CLI, one has to ‘set’ the current list with the additional interfaces rather than just appending the new interfaces to the existing list.

Current:
/ip route vrf set [find routing-mark=EXAMPLE] interfaces=vlan1,vlan2,vlan3



Requested:
/ip route vrf append [find routing-mark=EXAMPLE] interfaces=vlan4,vlan5

/ip route vrf set [find routing-mark=EXAMPLE] interfaces=“$[get [find routing-mark=EXAMPLE] interfaces],vlan4,vlan5”

Interesting workaround :slight_smile:
Thanks!

I’ve tried this workaround, but only works if the data from the retrieved variable is added to the interfaces command. For example:

/ip route vrf set [find routing-mark=EXAMPLE] interfaces="$[get  [find routing-mark=EXAMPLE] interfaces]"

if I try to add another interface, I get the following error.

input does not match any value of interface

Any idea why? I’ve tried everything I could think of.

One of the interfaces you are trying to add does not exist, so you get an error.

As much as I wish that was true, it unfortunately isn’t. Please see configuration below:

/interface vlan
add comment="L2VPN - CVID 4" interface=bo1v400 name=bo1v400v4 vlan-id=4
add comment="Customer VRF" interface=bo2v900 name=bo2v900v1204 vlan-id=1204
add comment="IRL" interface=bo2v951 name=bo2v951v1204 vlan-id=1204

/ip route vrf set [ find routing-mark=customer1 ] interfaces="$[ get [ find routing-mark=customer1] interfaces ],bo1v400v4"

bo2v900v1204 and bo2v951v1204 are already in the VRF and I would like additional interface added to the VRF, which is in this case interface bo1v400v4. If I run the following command, the command is accepted and already existing interfaces are still in the VRF:

/ip route vrf set [ find routing-mark=customer1 ] interfaces="$[ get [ find routing-mark=customer1] interfaces ]"

… but if I try to apply the following command. I get the error that follows.

/ip route vrf set [ find routing-mark=customer1 ] interfaces="$[ get [ find routing-mark=customer1 ] interfaces ],bo1v400v4"
input does not match any value of interface

Post /ip route vrf print output

Here it is:

 routing-mark=customer1 interfaces=bo2v951v1204,bo2v900v1204 route-distinguisher=65000:1204 import-route-targets=65000:1204,65000:999 export-route-targets=65000:1204,65000:1000

I’ve omitted the output of other VRFs for security purposes. Interface bo1v400v4 is not assigned to any other VRF.

Works for me, if in your script you try to add new interface to the VRF right after it is created, then make sure that you add some delay or check if interface exist. Interface may not appear right away if CPU has some load.

The VRF is already present before the script execution, also the CPU is running on 1%, it’s barely used CCR1036, so there’s definitely enough processing power. I wish Mikrotik would just add “append” command rather than just set/unset. This solution unfortunately (and surprisingly) doesn’t work for me.

No, it’s not working. I have same problem.

/ip route vrf
add interfaces=pptp-001,vlan28p1 routing-mark=clientVRF
[admin@FinalFantasy-2(bkp)] /ip route vrf> :global inn "$[get [find routing-mark=clientVRF] interfaces]"                                                        
[admin@FinalFantasy-2(bkp)] /ip route vrf> :put $inn
pptp-001;vlan2833p1
[admin@FinalFantasy-2(bkp)] /ip route vrf> :set inn "$inn;pptp-002"
[admin@FinalFantasy-2(bkp)] /ip route vrf> :put $inn
pptp-001;pptp-002;vlan2833p1;pptp-002

^^^^^^^^^^^^^^^^^----------------
How it can be ??

[admin@FinalFantasy-2(bkp)] /ip route vrf> /ip route vrf set [find routing-mark=clientVRF] interfaces="$[get [find routing-mark=clientVRF] interfaces],pptp-002"
;              
input does not match any value of interface
[admin@FinalFantasy-2(bkp)] /ip route vrf>

Right answer is:

/ip route vrf set [find routing-mark=clientVRF] interfaces=([get [find routing-mark=clientVRF] interfaces], “newVlan”);

It’s because [get [find routing-mark=clientVRF] interfaces] is array, not string.