Add a VLAN to each ethernet interface in Mikrotik

by Jim Bouse 24. October 2019 07:46

I needed to add a VLAN to each interface on a large number of Mikrotik switches.  This is the script I worked up:

/interface bridge add name=Management disabled=no; 
:foreach i in=[/interface ethernet find] do={ 
  :local ifname [/interface get $i default-name]; 
  /interface vlan add interface=$i vlan-id=100 name=($ifname.".0100") disabled=no; 
  /interface bridge port add bridge=Management interface=($ifname.".0100") disabled=no; 


Mikrotik | WISP

Powered by BlogEngine.NET
Original Design by Laptop Geek, Adapted by onesoft