...and there we go again. Yes, there may be circumventions. We can discuss that on a theoretical level just endlessly. Once you are in the actual situation your Unifi main switch dies and you need to replace it: Just try. Been there - done that.
Out of experience: You did not consider some things, say:
1. Maybe your Unifi Network Controller is on a VM on a Proxmox VE host which has a trunk port to your switch.
2. Maybe your OpnSense is also on a trunk port and has firewall rules to allow your management PC's MAC from the LAN to access the management VLAN.
Shall I continue? After the fact I can tell you the actual restoration workflow contains way more than the steps you imagine now.
It is a matter of a downtime of minutes vs. (at the very least) hours, trust me.
Therefore, I keep the management LAN untagged - the switch will then automatically connect to the Unifi Network Controller. Your only concern will be to reach the management LAN to make the UNC adopt the new switch and configure it.
Out of experience: You did not consider some things, say:
1. Maybe your Unifi Network Controller is on a VM on a Proxmox VE host which has a trunk port to your switch.
2. Maybe your OpnSense is also on a trunk port and has firewall rules to allow your management PC's MAC from the LAN to access the management VLAN.
Shall I continue? After the fact I can tell you the actual restoration workflow contains way more than the steps you imagine now.
It is a matter of a downtime of minutes vs. (at the very least) hours, trust me.
Therefore, I keep the management LAN untagged - the switch will then automatically connect to the Unifi Network Controller. Your only concern will be to reach the management LAN to make the UNC adopt the new switch and configure it.
"