Community discussions

 
Celsius
just joined
Topic Author
Posts: 6
Joined: Thu Oct 04, 2018 4:00 pm
Location: Germany

Script problems for multiple interfaces in global variable

Wed Oct 17, 2018 3:00 am

Hi,
I've a problem with the following script:

:global VLANBRDNAME "bridge_vlan10"
:global VPNSERVER "PPTP-FIN"
:global ROUTMARK "vpn"

/ip route vrf
add interfaces=$VLANBRDNAME, $VPNSERVER routing-mark=$ROUTMARK

After executing in terminal window, the following error message appear (red mark at comma position between $VLANBRDNAME, $VPNSERVER):
[admin@MikroTik_2] /ip route vrf> add interfaces=$VLANBRDNAME, $VPNSERVER routing-mark=$ROUTMARK
expected end of command (line 1 column 28)
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5931
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Script problems for multiple interfaces in global variable

Wed Oct 17, 2018 10:04 am

do not put space after ,
 
Celsius
just joined
Topic Author
Posts: 6
Joined: Thu Oct 04, 2018 4:00 pm
Location: Germany

Re: Script problems for multiple interfaces in global variable

Wed Oct 17, 2018 11:03 am

Hi,
thank you for support. I've remove the space between the variables, because the same error occur:

[admin@MikroTik_2] /ip route vrf> add interfaces=$VLANBRDNAME,$VPNSERVER routing-mark=$ROUTMARK
expected end of command (line 1 column 28)

If i put the values direct in the command it works:
/ip route vrf
add interfaces=bridge_vlan10,PPTP-FIN routing-mark=vpn

The not working part is part of a huge complex script and I need to find a solution. I've no idea to solve the problem.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5931
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Script problems for multiple interfaces in global variable

Wed Oct 17, 2018 11:41 am

add interfaces="$VLANBRDNAME,$VPNSERVER" routing-mark=$ROUTMARK
 
Celsius
just joined
Topic Author
Posts: 6
Joined: Thu Oct 04, 2018 4:00 pm
Location: Germany

Re: Script problems for multiple interfaces in global variable  [SOLVED]

Wed Oct 17, 2018 4:27 pm

Thank you, that is the right solution !

Who is online

Users browsing this forum: No registered users and 9 guests