Open In App

Configure IP Address for Interface in Cisco Switches

Improve
Improve
Like Article
Like
Save
Share
Report

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 192.168.1.1 255.255.255.1
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 192.168.1.0/24 on router0.

  int f0/0
  ip add 192.168.1.1 255.255.255.0
  no sh
  exit
  ip dhcp pool deadpool
  network 192.168.1.0 255.255.255.0
  default-router 192.168.1.1
  dns-server 8.8.8.8
  exit

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

 


Last Updated : 13 Nov, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads