USD ($)
$
United States Dollar
India Rupee

Cisco Switch Configure DHCP Scenario

Created by Gautam Sharma in Articles 6 Jan 2025
Share

In an organization, IT infrastructure may have several devices that require IP addresses to function in the network. For example, a laptop can not access network resources like the internet without having an IP, gateway, and DNS address.

There are two ways by which we can Cisco switch configure DHCP these parameters in a machine like a laptop or any network device.

1. Manually Assigned

2. Dynamically Assigned

In case you have very limited network devices in your IT infrastructure, you can assign IPs and other addresses manually but if you have a large enterprise having hundreds or thousands of network devices then it is very much convenient to assign IPs dynamically. 


Upgrade your skills with Cisco WLC Training!Enjoy Training Benefits>> Install, Configure, wireless controllerExplore course
custom banner static image

The process of assigning the IP parameters on network devices is called Dynamic Host Configuration Protocol (DHCP). It is a network management protocol, allowing devices to receive IP-related information from DHCP servers, the information is as follows 

1. IP Addresses

2. Subnet Masks

3. Default Gateways

4. DNS Server Addresses  

The network professionals obtain training and certifications for building concepts of configuring DHCP on a Cisco Switch or Router. There are some small organizations where that do not effort to keep a dedicated DHCP server for assigning IP addresses dynamically, they use a Cisco switch to configure DHCP which is easy to set up.

Understanding DHCP is a fundamental aspect of Cisco training and certification programs. Cisco certifications, such as the Cisco Certified Network Associate (CCNA), cover DHCP extensively as part of their curriculum.

CCNA training online and Certification ensure that network professionals have the knowledge and skills to implement and manage DHCP in real-world scenarios. You feel free to contact our learning advisors for further information on training and skill development.



banner image

Cisco Switch Configure DHCP - Tasks

In this task, SW1 will be configured as a DHCP Server, and all four routers will be DHCP Clients. Configure DHCP Server functionality on SW11 using the following criteria:


Pool Name

Network Address

Subnet Mask

Default Router

Lease Time

vlan2

10.10.10.8

/29

10.10.10.9

1-day

vlan3

10.10.10.32

/29

10.10.10.33

1-day

vlan4

30.30.30.0

/26

30.30.30.1

1-day

vlan5

20.20.20.96

/27

20.20.20.97

1-day

Cisco Switch as DHCP Server - Explanation

In this blog, we are going to discuss and configure a Cisco switch as a DHCP server. Before directly jumping on to the configuration, let's first understand how it works.

How DHCP Works?

The DHCP process has the following steps while assigning IP parameters to a network device.

1. DHCP Discovery

When a device wants to join a network, it first starts sending a broadcast message called a DHCP discovery in order to locate available DHCP servers.

2. DHCP Offer

When any available DHCP server receives this discovery broadcast message, it responds to the client with a DHCP offer. In this offer, it includes a free available IP address and other configuration parameters for the client.

3. DHCP Request

When a DHCP client receives the DHCP offer (the client may receive multiple offers), it responds in a broadcast message as a DHCP request, containing the IP address of a specific server from which this client wants to accept the offer.


4. DHCP Acknowledgement

Once the chosen server receives the DHCP request from the client, it sends a DCHP acknowledgment back to the client. This confirms that the IP address and other details can now be used by the client for further communication in the network.

In this setup, there are three Cisco switches and four routers. Configure all FastEthernet interfaces on the routers (connected to the switches shown in the topology diagram) to obtain their IP address dynamically via the Cisco switch as a DHCP server. Verify that your routers have obtained an appropriate DHCP IP address. 

Verify that any one of your routers can ping the IP address of any other router. banner image

DHCP Configuration in Cisco Switch

Step #1: Configure VTP mode Server , VTP domain CCNP and verify that all ports are trunk negotiated.

banner image

Step #2: Configure the L2 VLAN for all VLANs on SW1.

SW1:


SW1#conf t

Enter configuration commands, one per line. End with CNTL/Z.
SW1(config-vlan)#vlan 3
SW1(config-vlan)#vlan 4
SW1(config-vlan)#vlan 5
SW1(config-vlan)#

SW1(config)#vlan 2

banner image

Step #3: Verify that all ports connected to the switch are 802.1Q trunk ports. Configure the L3 VLAN for all VLANs on SW1.

banner image

banner image

SW1:


SW1(config)#ip routing
SW1(config)#interface Vlan1
SW1(config-if)# ip address 1.1.1.11 255.255.255.0
SW1(config-if)#!
SW1(config-if)#interface Vlan2
SW1(config-if)# ip address 10.10.10.9 255.255.255.248
SW1(config-if)#!
SW1(config-if)#interface Vlan3
SW1(config-if)# ip address 10.10.10.33 255.255.255.248
SW1(config-if)#!
SW1(config-if)#interface Vlan4
SW1(config-if)# ip address 30.30.30.1 255.255.255.192
SW1(config-if)#!
SW1(config-if)#interface Vlan5
SW1(config-if)# ip address 20.20.20.97 255.255.255.224
SW1(config-if)#!
SW1(config-if)#
SW1#conf t
SW1(config)#int vlan 2
SW1(config-if)#no shut
SW1(config-if)#int vlan 3
SW1(config-if)#no shut
SW1(config-if)#int vlan 4
SW1(config-if)#no shut
SW1(config-if)#int vlan 5
SW1(config-if)#no shut
SW1(config-if)#^Z

SW1(config)#!

Enter configuration commands, one per line. End with CNTL/Z.

Step #4: Verify the L3 VLAN for all VLANs on SW1.

banner image

Step #4: Configure the Switch port on all switches that are connected to all four routers.

SW1:


SW1(config)#int eth1/0

SW1(config-if)#switchport mode access

SW1(config-if)#switchport access vlan 2

SW1(config-if)#no shut
SW1(config)#int eth2/0
SW1(config-if)#switchport access vlan 2
SW1(config-if)# switchport mode access
SW1(config-if)# duplex auto
SW1(config-if)#end

SW2:


SW2(config)#int eth1/0

SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 3
SW2(config-if)#int eth2/0
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 3
SW2(config-if)#^Z
SW2(config)#int eth3/0
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 5
SW2(config-if)#int eth4/0
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 5
SW2(config-if)#^Z
SW3(config)#int eth3/0
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 4
SW3(config-if)#int eth4/0
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 4
SW3(config-if)#^Z

Step #5: Configure the SW1 to make it a DHCP server.

SW1:


SW1(config)#ip dhcp pool vlan2

SW1(dhcp-config)# network 10.10.10.8 255.255.255.248

SW1(dhcp-config)# default-router 10.10.10.9

SW1(dhcp-config)#!

SW1(dhcp-config)#ip dhcp pool vlan3

SW1(dhcp-config)# network 10.10.10.32 255.255.255.248

SW1(dhcp-config)# default-router 10.10.10.33

SW1(dhcp-config)#!

SW1(dhcp-config)#ip dhcp pool vlan4

SW1(dhcp-config)# network 30.30.30.0 255.255.255.192

SW1(dhcp-config)# default-router 30.30.30.1

SW1(dhcp-config)#!

SW1(dhcp-config)#ip dhcp pool vlan5

SW1(dhcp-config)# network 20.20.20.96 255.255.255.224

SW1(dhcp-config)#  default-router 20.20.20.97

 Step #6: Configure the Routers so that they will take the IP address from the DHCP server.

R1:


R1(config)#int range eth0/0-1
R1(config-if-range)#no shut
R1(config-if-range)#ip address dhcp

R2:


R2(config)#int range eth0/0-1
R2(config-if-range)#no shut
R2(config-if-range)#ip address dhcp

R3:


R3(config)#int range eth0/0-1
R3(config-if-range)#no shut
R3(config-if-range)#ip address dhcp

R4:


R4(config)#int range eth0/0-1
R4(config-if-range)#no shut
R4(config-if-range)#ip address dhcp

Step #8: Verification that All routers are able to get the IP address

banner image

banner image
Gautam Sharma

This is Gautam's biography

More... | Author`s Bog | Book a Meeting

Related Articles

#Explore latest news and articles

Port Address Translation & It's Configuration on Cisco ASA Firewall 16 Sep 2024

Port Address Translation & It's Configuration on Cisco ASA Firewall

Understand what is port address translation and configure it on Cisco ASA. Learn the difference between NAT and PAT. 
What is BGP and How Does it Work? 20 Dec 2024

What is BGP and How Does it Work?

Discover what is BGP and how it works. The concepts lay the foundation for a deeper understanding of internet routing.
What is OSPF and How it Works? 6 Nov 2024

What is OSPF and How it Works?

Do you know? what is OSPF and how it works in networking. The IGP protocol concepts lay the foundation for becoming an expert. Read More!

FAQ

When an organization has limited resources for assigning a dedicated server for DHCP then Cisco switch can be used for assigning IP addresses dynamically to network clients.
IP address, Subnet mask, Gateway IP, DNS address
Linux servers, Windows server, AWS and other cloud platforms as DHCP server. Cisco routers can also be DHCP server in small organizations.

Comments (0)

Share

Share this post with others

Contact learning advisor

Captcha image
Palo Alto Live Training Starts!
Palo Alto Live Training Starts!
Palo Alto Training | Starting 18th Jan | Expert Guidance | Hands-On Labs!
Day
Hr
Min
Sec
Register Now