Cisco – How to Assign IP Address to a FastEthernet Port on CPT Switch

ciscocisco-catalystipip addresslayer3

I've configured a vlan 3 with ip address and then assigned FE port to vlan 3 , i read that this will assign the ip address to the FE interface.
I know this is really simple configuration .But really would love some help on how to assign IP addresses to FE interfaces on switches in CPT .

   Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE (fc1)
 !
interface FastEthernet0/1
switchport access vlan 3
switchport mode access
!
!
interface Vlan3
ip address 172.12.123.1 255.255.255.0
!

Best Answer

IP is a layer-3 protocol, but you have a layer-2 switch. When a port is configured as a switch (layer-2) port, you can't assign an IP address to it. It doesn't make sense to assign a layer-3 address to a layer-2 port. IP is a layer-3 protocol, so you assign it to layer-3 ports.

The layer-2 switch can have a layer-3 SVI port to which you can assign an IP address, but your switch isn't a router or layer-3 switch, so an IP address on your SVI is only for switch management. If you want to have multiple VLANs and route between them, you need a router or a layer-3 switch.

If you had a layer-3 switch, you would need to make sure that you have IP routing enabled. You could then assign IP addresses to the ports, but you would first need to use the no switchport command.