Community discussions

MikroTik App
 
User avatar
pcunite
Forum Guru
Forum Guru
Topic Author
Posts: 1147
Joined: Sat May 25, 2013 5:13 am
Location: USA

Append Bridge vlan values

Fri Feb 19, 2021 6:12 am

I'm attempting to set some values under the /interface bridge vlan command, namely the untagged property. Normally, I set this like so:

set bridge=BR1 tagged=ether4 [find vlan-ids=10].

However, I need a way to append the value to what is already present. Here's what I've cobbled together so far, but it does not work correctly.

A full example is shown below.

Example:
# Script Setup
/interface bridge add name=BR1 protocol-mode=none vlan-filtering=no
/interface bridge vlan 
add bridge=BR1 untagged=ether2 vlan-ids=10

# How to Append "ether4" to array?
set bridge=BR1 untagged=([get value-name=untagged]",ether4") [find vlan-ids=10]
 
tdw
Forum Veteran
Forum Veteran
Posts: 706
Joined: Sat May 05, 2018 11:55 am

Re: Append Bridge vlan values

Fri Feb 19, 2021 3:56 pm

set untagged=([get value-name=untagged [find vlan-ids=10]],"ether4") [find vlan-ids=10]

Is there a reason you explicitly set the untagged= parameter as this will be dynamically populated from the pvid= parameter under /interface bridge port for bridge members and /interface bridge for the bridge itself. This avoids the possibility of mismatches which will cause unexpected behaviour.
 
User avatar
pcunite
Forum Guru
Forum Guru
Topic Author
Posts: 1147
Joined: Sat May 25, 2013 5:13 am
Location: USA

Re: Append Bridge vlan values

Fri Feb 19, 2021 9:04 pm

Is there a reason why you explicitly set the untagged= parameter as this will be dynamically populated.

I am considering removing lines referencing the untagged member because of the reasons you note. I also needed to set the tagged member as well. I really appreciate the help. I'm looking into how to set Hybrid ports in an easy to show way.

Who is online

Users browsing this forum: No registered users and 32 guests