Create a VLAN, and configure a Layer 3 (L3) VLAN interface. Assign an IP address for this interface, as shown:
Switch(config)# vlan vlan_ID Switch(config)# interface vlan vlan_ID Switch(config-if)# ip address ip_address subnet_mask
Configure the switch port as a Layer 2 (L2) access port, and associate the access port to a VLAN, as shown:
Switch(config)# interface {fastethernet | gigabitethernet} slot/port Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan vlan_num
You can also assign multiple interfaces into a VLAN, as shown:
Switch(config)# interface range {vlan vlan_ID} {{fastethernet | gigabitethernet | macro macro_name} slot/interface-interface} Switch(config-if-range)# switchport access vlan vlan-id Switch(config-if-range)# switchport mode access