Thanks for the advice thus far. I discovered that the provision does not fail, it actually completes as it should. However, I do get disconnected from the device in roughly the same place in my config every time. Normally I lose connectivity on the /interface bridge port. See below.
Connect to port 1 on the switch, then run this code.
/interface bridge port
remove [ find interface=ether23 ]
remove [ find interface=ether24 ]
/ip address
add address=10.xx.xx.xx/24 interface=ether24 network=10.xx.xx.xx
/ip dhcp-client
add interface=ether23 disabled=no
Now that port 23 is not in the bridge, and a DHCP client, I connect to port 23 to get updated firmware, then proceed with the rest of the provision. Below is the snippet that is disconnecting me:
/certificate
add name="xyz" common-name="xyz" days-valid="3650"
sign "xyz" name="xyz"
/interface vlan
add interface=bridge name=vlan2 vlan-id=2
add interface=bridge name=vlan3 vlan-id=3
add interface=bridge name=vlan4 vlan-id=4
add interface=bridge name=vlan5 vlan-id=5
add interface=bridge name=vlan6 vlan-id=6
/ip address
remove [ find address="192.168.88.1/24" ]
add address=10.xx.xx.4/24 interface=vlan5 network=10.xx.xx.0
/ip cloud
set update-time=no
/ip route
add distance=1 gateway=10.xx.xx.1
/ip dns
set servers=10.xx.xx.xx,10.xx.xx.xx
/interface bridge
set [ find name=bridge ] comment=""
/interface bridge vlan
add vlan-ids=2 bridge=bridge tagged=sfp-sfpplus2,ether4 untagged=ether16
add vlan-ids=3 bridge=bridge tagged=sfp-sfpplus2,ether4 untagged=ether1,ether2
add vlan-ids=4 bridge=bridge tagged=sfp-sfpplus2,ether4
add vlan-ids=5 bridge=bridge tagged=bridge,ether4 untagged=ether3,ether5,ether6,ether22
add vlan-ids=6 bridge=bridge tagged=sfp-sfpplus2,ether4
add vlan-ids=666 bridge=bridge untagged=ether15
/interface bridge port
set [ find interface=ether1 ] pvid=3
set [ find interface=ether2 ] pvid=3
set [ find interface=ether3 ] pvid=5
set [ find interface=ether4 ] frame-types=admit-only-vlan-tagged
set [ find interface=ether5 ] pvid=5
set [ find interface=ether6 ] pvid=5
set [ find interface=ether15 ] pvid=666
set [ find interface=ether16 ] pvid=2
set [ find interface=ether22 ] pvid=5
set [ find interface=sfp-sfpplus2 ] frame-types=admit-only-vlan-tagged
As stated, I lose access to the device typically in the /interface bridge port section. I'm connected to port 23 via DHCP, and I'm not modifying that port at all after the initial addition of the DHCP Client.
Provisioning through SSH has same behavior as Winbox. I lose access, but if I power cycle the switch, port 23 is working fine again. When I provisioned the last switch, I lost connection after
set [ find interface=ether6 ] pvid=5
. Initially, I suspected maybe generating a certificate was making the switch run out of memory. So I tried that first, then rebooted the switch and ran the rest of the commands. Still get disconnected for no reason.
I don't have particular interest in using the console port. I am trying to determine if this is a bug, and if so, report it so it can be fixed. I do still need to attempt to send the commands one at a time, but I have a feeling that will work fine.