Community discussions

MikroTik App
 
smhorvath
just joined
Topic Author
Posts: 9
Joined: Thu May 21, 2009 8:44 pm

number range

Fri Apr 09, 2021 10:15 am

Is there a way to add / set / edit a command to a number range using the cli?
With the introduction of 24/48 port switches this is now needed more than before.
Say I want to add 36 ports or perhaps an arbitrary range of ports like 0-12, 15, 17, 20-35 to vlan 101
Doing
/interface bridge port set 0,1,2,3..etc..etc..34,35 pvid=101
is just not practical.
it would be nice to be able to do.
/interface bridge port set 0-35 pvid=101
or
/interface bridge port set 0-12,15,17,20-35 pvid=101

I found this:
https://wiki.mikrotik.com/wiki/Using_sc ... mmand_line
Which is a cut and paste work around for a range but it's still not ideal
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: number range

Fri Apr 09, 2021 2:47 pm

There is a shorter command:
:for i from=0 to=12 do={/interface bridge port set $i pvid=101}
 
smhorvath
just joined
Topic Author
Posts: 9
Joined: Thu May 21, 2009 8:44 pm

Re: number range

Fri Apr 09, 2021 3:10 pm

Thanks. that is very helpful.
Having the cli accept ranges would be a nice addition though

Who is online

Users browsing this forum: GoogleOther [Bot], johnson73 and 93 guests