Open In App
Related Articles

Configure IP Address for Interface in Cisco Switches

Improve Article
Save Article
Like Article

To configure an IP Address on a switch interface, first, we must change the interface from a layer 2 interface to a layer 3 interface. A point to note is that to provide an IP Address to a switch interface, the switch first must be a Multilayer Switch and all ports of an MLS is layer 2 by default. There are two ways to configure an IP address to a switch interface that is given below:

Static Configuration:

Consider a Multilayer Switch:

Cisco Switch


First, we need to check whether an interface is a layer 2 port or a layer 3 port.

show interfaces f0/1 switchport
Cisco Switch CLI Configuration


Switch port: Enabled means that the port is currently a layer 2 port. To change the interface from a layer 2 switch to a layer 3 switch:

int f0/1
no switchport exit

Providing IP address to an interface:

int f0/1
ip add
Cisco Switch CLI Configuration


Checking if an IP address has been provided to the interface

show ip int br | ex unassigned
Cisco Switch CLI Configuration


Dynamic Configuration:

Consider this topology:

Multilayer Switch with Cisco Router


First, we again make the fa0/1 port of Switch0 a layer 3 port.

int f0/1
no switchport

Then we provide interface Fa0/0 and configure a DHCP pool for the network on router0.

  int f0/0
  ip add
  no sh
  ip dhcp pool deadpool

Checking DHCP pool status:

show ip dhcp pool pool
Checking DHCP pool status


After that, we go to Switch’s interface fa0/1 and execute the command:

int f0/1
ip add dhcp
Checking DHCP pool status


Simulation of the DORA Process:

Simulation Result


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 13 Nov, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials