add port to existing VLAN not possible?

I think I understand VLANs on the 3xx switches but I´m missing an easy way to add a new port to VLANs. In the gui, I open the VLAN in the bridge menu and add the port(s). If there would be a few, no problem. But as we have many I would appreciate a faster way in the terminal.
When I export the config, replace the add with set and add the new interface(s) it would work. But should´n add do the trick?
like

/interface bridge vlan
add bridge=bridge1 vlan-ids=11 tagged=sfp-sfpplus1,sfp-sfpplus10

Maybe with some script this would be possible but isn´t it that way in Cisco switches?

Thanks
Philipp

are you using SWoS or RoS and if using RoS are you doing vlans on the bridge newer method or the standard old switch chip method?

RouterOS. In SwOS it looks really easy to add ports to a VLAN. Also there is no terminal in SwOS.
I use the new method.
I wrote a script yesterday to get every VLANs Ports so it should be doable with a script. But I think it would be nice when the add command would do what it says.

You will use set when changing an existing line in vlan table, and add to add a new line in the vlan table

I know, but how would I add a single port to all VLANs without lots of exporting and editing?
like on Cisco:
switchport trunk allowed vlan { add | all | except | remove } vlan-list
or on Dlink DGS-1510 there is an add or change option in the weg gui.
I´m missing a port view on VLANs.
maybe I have to extend this script to get the current status and generate the set lines

:local vlans;/interface bridge vlan ;:foreach vlans in=[find vlan-ids!=0 ] do={:put [get $vlans vlan-ids];:put [get $vlans tagged]};

can you post the “pseudo code” of exactly what you are trying to achieve?

Nevermind, I think I get what you are trying to do.

Maybe the easiest will be to add comments to the vlan config lines, and then reference that when you want to amend settings via script

{
:foreach myvlan in=[/interface bridge vlan find where comment="My Vlan Comment" && vlan-ids="10"] do={
set tagged=ether1 untagged=ether3
}
}

select port → add/remove/set VLANs per port
like Dlink:
vlan_dlink.png
under Action either add or remove the inserted VLAN from the list the port is currently in. Or replace the range complete. But on a per-port base.
For now it would be a workaround when per VLAN is working as intended, should be sufficient in terminal, maybe the add command has to be adapted to either create a new VLAN or, if already exists, just update(add) the new port to the tagged list.

just to ask again, would it be possible to add a command to get/set VLANs per port?

you can do the same as per dlink with mikrotik gui
addvlanport.JPG

but in cli? not so

edit: add to a vlan yes but add vlan to a specific port?

To nitpick: can you do it on D-Link in CLI?

Look at RouterOS config, it’s a tree with collections of items and each item has some attributes. You simply add or remove whole items or set attributes for existing items. And it works great for most things. Almost all attributes are short and if you need to edit some, you need to replace it as whole anyway.

Definition of VLANs on bridge is an exception. One of the few or maybe even the only one. It’s relatively new, so they used the same kind of config as everywhere else, but it’s not the greatest fit for it. And not just CLI, WinBox too. So far I used it only on devices with few ports and it’s ok there. But the thought of configuring 24-port switch this way doesn’t sound like fun.

There’s definitely space for improvements, some higher level GUI in WinBox/WebFig and shortcut commands for editing items in CLI. You can try to invent something great and I think there’s a chance they could go with it.

yes
switchport trunk allowed vlan { add | all | except | remove } vlan-list
similar to Cisco

maybe we just have to wait, at the moment there are more important things to do(ROS7)