Two counters in loop

Hi all.
By this part of script:

#count config
:local start ("100");
:local stop ("250");

:global count ($start);
:for count from=$start to=$stop step=1 do={

/ip pool add name="pool$count" ranges="10.0.$count.20-10.0.$count.250"}

I will generate pools with name in range “pool100” - “pool250” and ip in range 10.0.100.20 to 10.0.250.250, right? Right :slight_smile:

I have no idea how to generate pools with different name, for example:
ip range = 10.1.100.20 to 10.1.250.250 with name range “pool800” - “pool1050”

I need two counters in one loop, but how?

Thanks in advance.

Nothing work.

Try

#count config
:global start ("0");
:global stop ("200");
:global count ($start);

:global vstart ("800");
:global vstop ("1000");
:global vcount ($vstart);

#pool
:for count from=$start to=$stop step=1 &&  vcount from=$vstart to=$vstop step=1 do={
/ip pool add name="pool$vcount" ranges="10.1.$count.20-10.1.$count.250"}



:for count from=$start to=$stop step=1 ;  vcount from=$vstart to=$vstop step=1 do={

:for count from=$start to=$stop step=1 &&  vcount from=$vstart to=$vstop step=1 do={

:for (count from=$start to=$stop step=1 &&  vcount from=$vstart to=$vstop step=1) do={

:for (count from=$start to=$stop step=1;  vcount from=$vstart to=$vstop step=1) do={

And etc., etc., etc.

I dont know how to do this right. Please help!

Just start to generate config in bash :smiley:

Forget about conf. generation on RouterOS scripting.

But if you use provisioning with MT, you will have sometimes to use mt scripting.

@flexus
#count config
:local start (“100”);
:local stop (“250”);
:local poolcount;

:global count ($start);
:for count from=$start to=$stop step=1 do={
:set poolcount ($count + 700);
/ip pool add name=“pool$poolcount” ranges=“10.0.$count.20-10.0.$count.250”}HTH,

HaPe, sure. But I just say about config generation on mt scripting.

ditonet, yay. Genius :slight_smile:
Thank you. Will take on my note.