Prerequisites
Install the Advanced License.
Enable IP routing globally on the switch.
Assign an IP address to the VLAN that you want to enable with OSPF.
Routing is automatically enabled on the VLAN when you assign an IP address to it.