Community discussions

MikroTik App
 
User avatar
Splash
Member Candidate
Member Candidate
Topic Author
Posts: 206
Joined: Fri Oct 16, 2015 10:09 am
Location: Johannesburg, South Africa

Feature request: Append values to configuration

Wed Sep 21, 2016 11:48 am

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
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Feature request: Append values to configuration

Wed Sep 21, 2016 2:53 pm

/ip route vrf set [find routing-mark=EXAMPLE] interfaces="$[get [find routing-mark=EXAMPLE] interfaces],vlan4,vlan5"
 
User avatar
Splash
Member Candidate
Member Candidate
Topic Author
Posts: 206
Joined: Fri Oct 16, 2015 10:09 am
Location: Johannesburg, South Africa

Re: Feature request: Append values to configuration

Fri Sep 23, 2016 3:46 pm

Interesting workaround :)
Thanks!
 
TheD
just joined
Posts: 10
Joined: Mon Jan 30, 2017 2:12 am

Re: Feature request: Append values to configuration

Wed Jun 12, 2019 12:58 am

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

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.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Feature request: Append values to configuration

Wed Jun 12, 2019 10:10 am

One of the interfaces you are trying to add does not exist, so you get an error.
 
TheD
just joined
Posts: 10
Joined: Mon Jan 30, 2017 2:12 am

Re: Feature request: Append values to configuration

Wed Jun 12, 2019 10:36 pm

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
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Feature request: Append values to configuration

Thu Jun 13, 2019 10:57 am

Post /ip route vrf print output
 
TheD
just joined
Posts: 10
Joined: Mon Jan 30, 2017 2:12 am

Re: Feature request: Append values to configuration

Thu Jun 13, 2019 11:20 pm

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.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7054
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Feature request: Append values to configuration

Fri Jun 14, 2019 12:43 pm

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.
 
TheD
just joined
Posts: 10
Joined: Mon Jan 30, 2017 2:12 am

Re: Feature request: Append values to configuration

Sat Jul 20, 2019 6:26 pm

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.
 
User avatar
greek
Member Candidate
Member Candidate
Posts: 118
Joined: Thu Nov 04, 2010 11:37 pm
Location: Russia, 78rus

Re: Feature request: Append values to configuration

Thu Dec 26, 2019 2:41 pm

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.
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> 
 
User avatar
greek
Member Candidate
Member Candidate
Posts: 118
Joined: Thu Nov 04, 2010 11:37 pm
Location: Russia, 78rus

Re: Feature request: Append values to configuration

Thu Dec 26, 2019 4:29 pm

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.

Who is online

Users browsing this forum: Bing [Bot], gindich, hajb, m3das, nescafe2002, samsonwilliams and 120 guests