Community discussions

MikroTik App
 
maslygan
just joined
Topic Author
Posts: 1
Joined: Wed Oct 26, 2022 1:28 pm

Remove interface from bridge vlan untagged

Fri Nov 18, 2022 1:59 pm

Hello lovely forum

Im in the middle of making a script to manipulate/remove interfaces in the /interfaces bridge vlan untagged section.

I know that a port gets set dynamically when setting pvid in the /interfaces bridge port, but i want to set it on the egress site aswell.
As a port can be set as untagged on multiple vlans, i would like a script that can delete/cleanup, but im not sure how the mikrotik scripting could solve this.

Example: I have ether5,ether6,ether7,ether8 on vlan-ids=2, but ether5 also exists on vlan 5 (someone might have configured this by accident).

i would the like to remove ether 5 on all vlans so i can set the interface on a new vlan.
until now i've tried to export terse to my host machine, and then use grep and sed to manipulate and replace, but that almost gives more issues than what it solves.
im hoping there's a way for the mikrotik device to do it on there, because i already have figured out how to add a new interface without removing existing ones:
/interface bridge vlan set [find vlan-ids=${pvid}] untagged=([get [find vlan-ids=${pvid}] untagged],\"${interface}\" )
the variables is for my shell script, as its intended for people to change a port from one vlan to another, without knowing mikrotik.

Hope my wall of text isn't too hard to understand, and what im trying to acheive here.

Who is online

Users browsing this forum: infabo and 18 guests