How to Configure DHCP on Cisco Router?

Configure DHCP on Cisco Router step by step guide

Configure DHCP on Cisco Router. Last week we published a topic about installation and configuration of DHCP Server in Windows Server 2012 R2. We have introduced the DHCP Server “Install and Configure DHCP Server on Windows Server 2012 R2” and told the necessary services and network protocols requirement if you don’t know the basic of DHCP Server? you must read the article first.

Create and Configure a CCNA Lab within Cisco Packet Tracer.

Download the DHCP configuration in Cisco router lab of packet tracer from the end of this post or try to create your own network lab with two routers and their LAN networks and then configure it with the following step by step guide.

How to Configure DHCP on Cisco Router - Technig
How to Configure DHCP on Cisco Router – Technig

Configure the Router 1 with below IP address and initial configuration. I assume you know and understand the basic router and Switch configuration clearly. So no need to explain the functions of the basic router and switch commands line.

Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 10.10.10.1 255.255.255.252
R1(config-if)#no shutdown

R1(config-if)#clock rate 64000
R1(config-if)#

For Router 2, configure the same interface serial 0/0/0 and fastEthernet 0/0 with the following commands.

Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface serial 0/0/0
R2(config-if)#ip address 10.10.10.2 255.255.255.252
R2(config-if)#no shutdown

R2(config-if)#

R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.10.1 255.255.255.0
R2(config-if)#no shutdown

Configure DHCP on Cisco Router Using Packet Tracer

Let’s configure Router 2 as DHCP Server and set the clients to get their IP address from DHCP Server in Cisco Router.

In the R2 while you are in the config mode, type the command ‘ip dhcp excluded-address 192.168.10.1 192.168.10.20‘ and then press enter. This command ‘ip dhcp excluded-address’ will create an exclusive range of IP addresses which reserved for Network Servers and DHCP Server will not assign them to clients.

The ‘ip dhcp pool‘ command creates a pool for a network. You can create many pools on a router for all Local area network that connected to the router.

How to Configure DHCP on Cisco Router - Technig
How to Configure DHCP on Cisco Router – Technig

R2>enable
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.20
R2(config)#ip dhcp pool Technig_Clients
R2(dhcp-config)#
R2(dhcp-config)#network 192.168.10.0 255.255.255.0
R2(dhcp-config)#default-router 192.168.10.1
R2(dhcp-config)#dns-server 192.168.10.100
R2(dhcp-config)#

Now go to client setting and set the IP Configuration to DHCP and see the client get new IP address from DHCP Server.

Get IP From DHCP Server
Get IP From DHCP Server

So that’s it, configure DHCP on Cisco router within a minute! Simple and easy.

DHCP Relay on Cisco Router

Remember some DHCP options (DHCP Relay Agent) when you need to provide IP addresses from a DCHP server to clients that are outside of your network or are not in the same Local Area Network. You must use the ‘ip helper-address‘ to forward the DHCP client requests to the remote host.

DHCP Options - IP Helper-address
DHCP Options – IP Helper-address

Configure the R1 to relay the DHCP client request. It does not work without routing. So configure Routers with static or dynamic routing. Here I’m testing with RIP.

R1>enable
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip helper-address 10.10.10.2
R1(config-if)#exit

R1(config)#router rip
R1(config-router)#network 10.10.10.0
R1(config-router)#network 192.168.30.0
R1(config-router)#exit

Go to the client IP configuration setting and see the forwarded request by DHCP Server.

Forward DHCP client request on Cisco Router
Forward DHCP client request on Cisco Router

Hope you learn the configuration of DHCP Server on Cisco Router and Download the DHCP on Cisco Router Packet Tracer.

 

Related Search: 

Configure dhcp on cisco router interface
Configure dhcp on cisco router in packet tracer
What is dhcp pool
Configure dhcp on cisco switch 2960
How to configure dhcp pool on cisco switch
IP dhcp excluded-address
Cisco dhcp lease command
IP dhcp server

You might also like
17 Comments
  1. CVS says

    The Packet Tracer file linked is locked with a password.

    1. Shais
      Shais says

      Sorry, the password is technig.com

  2. dave says

    What is the password for the protected ccna lab practical. CCNA Lab – DHCP Configuration on Cisco Router

  3. dave says

    sorry just seen the password nvm

  4. amanullah says

    why the IP helper dose not work? The other network machines can not get IP from DHCP. I tried more and more but I could not configure the tow network with DHCP. Pleas help me.

    Just the router DHCP has been Inistaled get IP.

    1. Shais
      Shais says

      Hi Aman,

      Try to crate and configure the DHCP on a router and configure the DHCP-Relay agent to other routers to get deploy IP address for their clients.

  5. kalger says

    You forgot to mention, that we need to create another dhcp pool for the second network.

    ip dhcp pool Technig-BNetwork
    network 192.168.30.0 255.255.255.0
    default-router 192.168.30.1
    dns-server 192.168.10.100

    1. Shais
      Shais says

      Hi Kalger,
      Thanks for mentioning my mistake.

  6. khalid says

    the default router ip give above is from which network we give ……and what is the dns ip…

    1. Shais
      Shais says

      DNS is the network domain naming system. It resolve the IP address to name and name to IP address.
      Here I just set a DNS IP address for testing the lab.

  7. Milan says

    if we need
    ip dhcp pool Technig-BNetwork
    network 192.168.30.0 255.255.255.0
    default-router 192.168.30.1
    dns-server 192.168.10.100

    on another router then that was the purpose of ip helper-address command in this network sir????

    1. Shais
      Shais says

      Hi Milan,

      The IP helper works as DHCP relay agent to gain IP from main DHCP server and deploy to the clients connected to this router.

  8. faiz says

    Thanks sir.

  9. aditi says

    why are we using two routers…?what is need of r2 router…?

    1. Shams
      Shams says

      This is just a test lab for understanding DHCP and features. But in the real network, you can optimize your network hardware.

  10. Louie Albarico says

    Hi, I know this thread is a bit old.
    But, I just want to ask if:
    Is it possible to create another outside network(R3) to the right of R1?
    Does the R2 DHCP server still give any address to that network?
    If possible, it would be a pleasure if you do a demo.
    Thank you.

    1. Shais
      Shais says

      Each network must have its own range of IP address.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.