Normally I configure data center switch ports to statically assign VLAN membership
switchport mode access
switchport access vlan 42
Now, I want to reverse that -- I want to define VLANs on the switch and let the host pick which one it wants to belong to.
vlan 12, 22, 32, 42
switchport mode ?
I'm getting stuck here. 'switchport mode dynamic'? No, that enables DTP, which is Cisco-proprietary, not supported on standard Intel/Broadcom/whatever drivers in the average Linux/Windows host. 'switchport mode trunk' and 'switch trunk allowed vlan 12,22,32,42'. No -- that didn't work -- the end-station brings up link but cannot go any further; and the switch shows the port as belonging to vlan 1.
The only way I see doing this is configuring a trunk, allowing only the desired possible vlans, and then on the host specify which vlan you want to use by having it tag its traffic with that VLAN number. You'll have to make sure your end host knows how to do 802.1q trunking.
The only way I could see doing this w/o using 802.1x or VMPS (which both don't allow the host to choose vlan) would be to provide a trunk allowing the possible vlans that will work...then on the host tag the traffic in the vlan they wish to join.
So if you wanted vlan 12, 22, 32, 42 to be possible, on the switch:
Switchport trunk encap dot1q
Switchport mode trunk
Switchport trunk allowed vlan 12, 22, 32, 42
On the host you will have to specify which vlan it will use.