Thanks for the help everyone. The installation works great using /system/reset-configuration run-after-reset=NewConfig.rsc
As a sanity check, could someone kindly double-check my config below for any security issues?
Setup details:
- The 4 SFP ports are configured as trunks.
- Port 24 will be used as the management port (Untagged VLAN 999).
- The switches need to be accessible from management VLAN 999.
- I have still to decide the password. Will add that one later in the config or manualy on the switches
{
:local i 0
#Number of interfaces.
:local x 28
#Max time to wait
:local t 30
while ($i < $t && [:len [/interface find]] < $x) do={
:put $i
:set $i ($i + 1)
:delay 1
}
if ($i = $t) do={
:log warning message="Could not load all physical interfaces"
} else={
/interface bridge
add name=bridge admin-mac=[ /interface/ethernet/get [ find name=ether1 ] value-name=mac-address ] auto-mac=no vlan-filtering=yes protocol-mode=rstp disabled=no
#set switch IP here
/interface vlan
add interface=bridge name=vlan_management vlan-id=999
#Set Switch IP here
/ip address
add address=172.16.226.56/23 interface=vlan_management
/ip firewall filter
add action=accept chain=input in-interface=vlan_management src-address=172.16.226.0/23 comment="accept management vlan"
add action=drop chain=input comment="drop any"
add action=drop chain=forward comment="drop any"
/ipv6 settings
set disable-ipv6=yes
/interface bridge vlan
add bridge=bridge comment="Camera Security" tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=11
add bridge=bridge comment=IoT tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=12
add bridge=bridge comment=Staff tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=21
add bridge=bridge comment=Teachers tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=22
add bridge=bridge comment="Printer Staff" tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=23
add bridge=bridge comment=Students tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge untagged=ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9,ether10,ether11,ether12,ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20,ether21,ether22,ether23 vlan-ids=31
add bridge=bridge comment=Smartboards tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=32
add bridge=bridge comment="Printers Classroom" tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=33
add bridge=bridge comment="Computer Classroom" tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=34
add bridge=bridge comment=Servers tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=51
add bridge=bridge comment=IT tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=52
add bridge=bridge comment=BYOD tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=61
add bridge=bridge comment=Guest tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=62
add bridge=bridge comment=Internaat tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=71
add bridge=bridge comment=Klooster tagged=sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4,bridge vlan-ids=72
add bridge=bridge comment=management untagged=ether24 tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=999
#old network vlans will have to delete early next year
add bridge=bridge comment=old_edu tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=40
add bridge=bridge comment=old_WIFI_EDU tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=100
add bridge=bridge comment=old_WIFI_LLN tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=110
add bridge=bridge comment=old_BYOD_Guest tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=120
add bridge=bridge comment=old_Secretariaat tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=200
add bridge=bridge comment=old_Servers tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=500
add bridge=bridge comment=old_Printers tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=550
add bridge=bridge comment=old_VPN tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=600
add bridge=bridge comment=old_IoT tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=650
add bridge=bridge comment=old_Development tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=900
add bridge=bridge comment=old_IT tagged=bridge,sfp-sfpplus1,sfp-sfpplus2,sfp-sfpplus3,sfp-sfpplus4 vlan-ids=901
/interface bridge port
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether1 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether2 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether3 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether4 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether5 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether6 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether7 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether8 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether9 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether10 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether11 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether12 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether13 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether14 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether15 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether16 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether17 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether18 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether19 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether20 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether21 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether22 pvid=31
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether23 pvid=31
add bridge=bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus1 trusted=yes pvid=1
add bridge=bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus2 trusted=yes pvid=1
add bridge=bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus3 trusted=yes pvid=1
add bridge=bridge frame-types=admit-only-vlan-tagged interface=sfp-sfpplus4 trusted=yes pvid=1
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether24 pvid=999
/interface list
add name=management_vlan_list
/interface list member
add interface=vlan_management list=management_vlan_list
/ip service
set ftp disabled=yes
set ssh disabled=yes
set telnet disabled=yes
set www disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/tool mac-server
set allowed-interface-list=none
/tool mac-server ping
set enabled=no
/tool mac-server mac-winbox
set allowed-interface-list=management_vlan_list
}
}