Dynamic Configuration
Consider this topology:
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
After that, we go to Switch’s interface fa0/1 and execute the command:
int f0/1
ip add dhcp
Configure IP Address for Interface in Cisco Switches
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: