How to use Cisco Router as DHCP Server?

How to use Cisco Router as DHCP Server?
By Network Bulls
Dec 16, 2015
DHCP,Technical Artic...

About Dynamic Host Configuration Protocol (DHCP) and how to use Cisco Router as DHCP Server

An upgrade of BOOTSTRAP PROTOCOL created by IETF (Internet Engineering Task Force). It is a client-server protocol whose main objective is to assign IP-Address to the client asking for it, however DHCP also provides some more information than just IP-address. It reduces need of administrator to give IP-Address to all the devices statically and human errors can also be reduced with DHCP in a large network. Blog Image  

What is DHCP?

It is an application layer protocol which provides IP-address, subnet-mask, default-gateway, DNS server IP-Address automatically. it uses UDP port no 67 and 68 as an information of transport layer of OSI.

How DHCP works?

DHCP works on DORA process

  • DISCOVER
  • OFFER
  • REQUEST
  • ACKNOWLEDGEMENT

  Blog Image 1 Blog Image 3   DISCOVER

When client boots up it sends a broadcast looking for DHCP server and asking for IP-Address.

B4   OFFER

When server respond on discover message it sends an offer message this message is unicasted on the same IP-address which is been offered by the server from the pool of a IP-address stored in server. Note: Cisco router as a DHCP server may do broadcast in this case.

B5 REQUEST

Client requests for the IP-address after checking it for IP conflicts. It is again a broadcast message from client to server, requesting for the same IP offered in the offer message.

B6 ACKNOWLEDGEMENT

It is a message sent by a server to the client as an acknowledgement that one IP--address is been assigned to client from the pool of IP-addresses. It is a uni-cast message.

B7 Note: Cisco router as a DHCP server may do broadcast in this case.

These messages are all unicasted by DHCP helping agent when DHCP server is not in same broadcast domain.

We can make different devices as a DHCP server. Devices like Routers, Layer3 switches, Access-Points, modem, etc.

DHCP configuration on Cisco Router used as a DHCP server and client as a PC.

Blog Image 4 IP-Address pool =172.20.10.0/28

Subnet mask = 255.255.255.240

Default-gateway = 172.20.10.1

DNS server = 172.20.10.1

On R1

After assigning IP-Address on interface fastethernet 0/0 statically  

DHCP as a router

Syntax:

Blog Image 5 R1(config)#ip dhcp excluded-address 172.20.10.1

With this command we exclude that IP-Address or range of IP-Addresses which are not to be provided to client via DHCP.

R1(config)#ip dhcp pool Network Bulls

With this we created dhcp pool and named it Network Bulls.

R1(dhcp-config)#network 172.20.10.0 255.255.255.240

This command is of dhcp mode in which we declare the IP subnet from where server will assign IP-Address.

R1(dhcp-config)#default-router 172.20.10.1

This command is telling about the default-gateway IP-Address.

R1(dhcp-config)#dns-server 172.20.10.1 This command is telling about the dns-server’s IP-Address.

On PC

Open command prompt check IP-Address.

Syntax:

>ipconfig

Blog Image 6 One can also refer to RFC 2131 for DHCP

RFC 2131 was updated in 2014  

Download PDF How to use Cisco Router as DHCP Server?

Vishwajeet Rathore

Sr. Trainer - Cisco R&S and Security

Network Bulls

Tags
Leave a Comment
Dhondup
“What about DHCP option 82. ...”
9 years ago

What about DHCP option 82. Kindly explain details about option 82.

Network Bulls
“Wait for our upcoming blogs...”
9 years ago

Wait for our upcoming blogs, we will definitely include your query. Team Network Bulls

Vijay
“good”
8 years ago

good

GET REGULAR UPDATES ON NETWORK BULLS