Here goes my take.
You don’t specify the model that you are using, but for this I’m going to assume that you’re using one of the CRS3xx devices. These are proper managed switches, so… they do managed switch stuff.
These devices can only offload one bridge to hardware, therefore basically for all useful purposes you should have a VLAN-aware (VLAN filtering on) bridge with all the ports where switching is expected assigned to that. (Another way of saying it is: the default is to have all ports as part of a bridge, and you have the ability to exempt some ports from switching and have the interfaces directly available.)
The usual advice when setting up vlan-aware bridges for the first time is to (temporarily) take one port out of bridging, and assign an IP address, etc. and use this as a “management” port, because if you mess up the VLAN configuration, you can easily lose access to your device, have to reset it to regain access, etc. This is not fun, when you have to do it for the fifth time.
Other than this, the my next question is going to be: are the packets you’re going to be switching vlan-tagged or not? You don’t specify, and based on your setup, I’m going to assume that they are untagged.
In this case the way to solve your problem:
- Assign all (both groups) of ports to a bridge, and turn on VLAN filtering
- Configure the ports as access ports (this means: set pvid, enable ingress filtering, and set admit only-untagged-and-priority-tagged), assign e.g. pvid=100 to one set of ports, pvid=200 to the other. (This is done in the bridge->port part of the configuration.)
- Add the two vlans. You don’t have to manually add the ports, this is done automatically based on pvid. (This is done in the bridge->vlan part of the configuration.)
There. Complete. What this means is that a packet coming in on your ports will be tagged with the pvid assigned to that port, and will only be able to leave the switch via ports marked with the same pvid. The tag is removed on egress, so the tag only exists internal to the switch logic.
If you want to access the switch itself (winbox, ssh, etc.) from one of these ports, you’ll have to add a vlan interface to the bridge with the appropriate vlan id (same as the pvid you assigned to the group of ports) from where you want access. Then treat this vlan interface as your interface for purposes such as assigning an IP address, using a DHCP client, enabling access in the firewall, etc.