TECHNIG
Gateway for IT Experts and Tech Geeks

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 a 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 the DHCP Server on the 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

23 Comments
  1. CVS says

    The Packet Tracer file linked is locked with a password.

    1. 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 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 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 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 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.

    2. Ed says

      I know this thread is a bit old but just used it now to prepare for CCNA (configuring DHCP).
      The second pool is needed in the router being used already as DHCP. That router is R2 in this case.
      The helper-address used on R1 is so that R2 can send DHCP addresses to the network behind R1, i. e. R1 is used as DHCP relay agent.
      I believe something in the steps is missing. So far RIP was configured only on R1. If we want RIP to work we need to configure it on R2 also.
      R2(config)#router rip
      R2(config-router)#network 10.10.10.0
      //Next line is important since it is different than for R1//
      R2(config-router)#network 192.168.10.0
      R2(config-router)#exit

      With those two things (second dhcp pool and RIP on R2), the network behind R1 gets addresses in the second pool (Technig-BNetwork).

      1. Shais says

        Thanks, Ed.

  8. faiz says

    Thanks sir.

  9. aditi says

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

    1. 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 says

      Each network must have its own range of IP address.

  11. Afwan Radhiah Abdul Rahim says

    Hi, why i can’t download the packet tracer file?

    1. Shais says

      The link has been updated. You can download it now.

  12. Mary says

    Okay,

    But, no one was really talking about THIS lab. We are talking about the OSPF lab. No one can download the OSPF lab at x/wp-content/uploads/2015/04/Configure-OSPF-Routing-Protocol-Technig.zip

    It does NOT work.

Leave A Reply

Your email address will not be published.