Community discussions

MikroTik App
 
dima1002
Member Candidate
Member Candidate
Topic Author
Posts: 160
Joined: Fri Jan 26, 2018 8:40 pm

all ports to bridge

Fri Sep 09, 2022 8:31 am

Hello,

1. I have a 48 port switch, how do I get all ports in one bridge with a script?

2. We have VLANS on the bridge, can you use all or dynamic?
 
AidanAus
Member Candidate
Member Candidate
Posts: 177
Joined: Wed May 08, 2019 7:35 am
Location: Australia
Contact:

Re: all ports to bridge

Mon Sep 12, 2022 10:21 am

To slap all ports into the same bridge
foreach i in=[interface find] do={interface bridge port add interface=$i bridge=(YOUR BRIDGE INTERFACE)}


this was another script from the other day, someone wanted x vlans in the bridge>vlans config that were concurrent, idk if you can make some use out of it as well, count will be the start, will go up 1 vlan per run, either add the other ports in the tagged= or alternatively have some fun and see if you can incorporate some of the code into that so you dont have to :)

local count (number here at the vlan you want to start at)

foreach i in=[interface bridge vlan find] do={ local vn [interface bridge vlan find vlan-ids=$count] ; interface bridge vlan set numbers=$vn tagged=ether1,ether2,ether3,ether4,ether5; if ($count<=10) do=[set count ($count + 1)] }

Who is online

Users browsing this forum: anav, erlinden, yosue111 and 44 guests