add/ remove interface from bridge vlan

Hi guys,

let’s assume I setup a bridge and configured a couple of vlans on it:

/interface bridge vlan
add bridge=bridge1 tagged=ether3,ether4,bond_edge2 vlan-ids=2
add bridge=bridge1 tagged=ether3,ether4,ether5,bond_edge2 vlan-ids=4

How can I add/remove a single interface to/from a specific vlan? I tried with the following command but it fails:

/interface bridge vlan
add bridge=bridge1 tagged=ether99 vlan-ids=2
=> failure: vlan already added

Thank you :slight_smile:

You can do:

/interface bridge vlan set [find vlan-ids=2] tagged=ether3,ether4,bond_edge2,ether99

But I don’t know if there’s any simple way how to only add/remove one interface without having to list all others that were there before.

/export hide-sensitive file=anynameyouwish

There is conflict somewhere,

Obviously, there’s already entry with vlan-ids=2. The question was how to add another interface to it.

Thank you @Sob. It’s very bad one has to list all vlans again that there’s no simple command to add/remove an interface from an existing vlan. Should be very easy to implement as well - too bad the code is not open or I’d submit a PR :wink:

Nobody really missed that feature before? Is everybody using the Ui? :wink:

Haven’t you tried WinBox already? Do it and you won’t be going back. CLI is good when you want to do something on ten routers at once, but otherwise WinBox wins. Unless you’re hardcore command line fan, I guess. :slight_smile:

I’m not absolutely sure that there’s no shortcurt, but I didn’t find any. Except:

/interface/bridge/vlan/edit [find vlan-ids=2] tagged

But that’s interactive editor. But if you’d want it for scripts, I’m sure it can be done too. Adding should be the matter of getting previous value and sticking new interface name at the end. Removing would require a bit more effort. I won’t give you examples for that, because RouterOS scripting frustrates me. I’d swear that the thing hates me.

Thanks, the “edit” command seems quite useful :slight_smile:

I’m a Linux user, so I’m very much used to terminals/ consoles :laughing: That’s also why I didn’t try Winbox yet as there’s no Linux version, right?

No different to changing a list of ports in a firewall rule - you have to specify all of current plus new ones, not just the new ones.


Should be very easy to implement as well

Unlikely. Throughout RouterOS you have to use the full value of parameter arguments, there are no delta operations to add or remove individual items in an existing argument, so may require large architectural changes.

Windows version of WinBox works with Wine, so unless you’re purist who can’t stand such thing, you too can enjoy GUI.