Router DHCP Configuration with Packet Tracer - www.ipcisco.com : www.ipcisco.com
Content Protection by DMCA.com

Router DHCP Configuration

with Packet Tracer




************************************************************
WouLd YoU LiKe To Learn How to Use PAcket TraceR and PracTice CCNA LAbs on PaCKet TrAcEr???
Here is My Courses on UDemY!!
CISCO PACKET TRACER HOW TO GUIDE
CISCO PACKET TRACER CCNA LABS ADVENTURE 1
CISCO PACKET TRACER CCNA LABS ADVENTURE 2
************************************************************


Before start-up I want to give some basic information about DHCP. As you know DHCP use UDP 67 and 68 ports. It has a messaging system for the communication between DHCP server and DHCP client. These messaging system’s messages and their types are mentined below:

  • DHCP Discovery (broadcast)
  • DHCP Offer (unicast)
  • DHCP Request (broadcast)
  • DHCP Acknowledgement (unicast)
  • DHCP Negative Acknowledgement (unicast)

DHCP Messages, DHCP Discovery, DHCP Offer, DHCP Request, DHCP ACK, DHCP NACK

DHCP Messages

You can DOWNLOAD the Packet Tracer example with .pkt format HERE.

Here, a client sends a broadcast “DHCP Discovery” message that mentions that it need an ip address.The DHCP servers are replies with configuration offers to the client by “DHCP Offer” unicast message. After that DHCP client sends a broadcast “DHCP Request” message to the network with the “Transaction ID” of the first DHCP Server that send DHCP Offer.The other DHCP servers understand that DHCP client wants to use the DHCP server that has the related “Transaction ID”. Lastly the DHCP server sends a unicast “DHCP Acknowledgement” message to the DHCP client that mentions the ip assignment is successfully done or it send a refuse messaged named “DHCP-NACK”.

To configure a router’s dhcp, we must follow some basic steps. For this configuration the important point is broadcast domains. If we have only one broadcast domain in our topology, then our work is more basic, else we must get help from “ip-helper address” command.This command will help us to convince the router and make it pass the broadcast packets.

For One Broadcast Domain



Our one broadcast domain topology is like below. There is a router that will carry our DHCP server role beside its routing functionalities. And there is a switch for PCs.

DHCP Packet Tracer Example Topology

DHCP Example Topology (One Broadcast Domain)

On routerA, firstly we will give an ip address to the router interface that is connected to the switch.Secondly that we will create a DHCP pool named IPD. In this pool we will mention ip addresses that will be given to the DHCP clients.After that we will assign the router’s interface address as a default-router address for clients. And in the last part we will exclude some addresses that we don t want to use during this dynamic ip assignments.

RouterA# config terminal
RouterA(config)# interface fastEthernet 1/0
RouterA(config-if)# ip address 192.168.10.1 255.255.255.0
RouterA(config-if)# no shut
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up 
RouterA(config-if)# exit RouterA(config)# ip dhcp pool IPD RouterA(dhcp-config)# network 192.168.10.0 255.255.255.0 RouterA(dhcp-config)# default-router 192.168.10.1 RouterA(dhcp-config)# exit RouterA(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10 RouterA(config)# ip dhcp excluded-address 192.168.10.12 192.168.10.14

After this configuration, when we check the ip address of PC0, we will see the ip address 192.168.10.11 . Because it is the first available address in DHCP pool.

For Multiple Broadcast Domains



Many CCNA learn that routers do not pass broadcasts. But progress in CCIE, network engineers learn that it is not true. Because you can pass broadcast traffic for many protocols as DHCP by “ip-helper address” command. Here we will refer only the broadcast of DHCP requests.We can use a router as a DHCP Server again, but I use a separate DHCP Server instead of router in this topology.

DHCP Example Topology (One Broadcast Domain)

DHCP Example Topology (Multiple Broadcast Domains)

In the first place we will configure the DHCP Server for its DHCP pools and its ip configuration. The ip address is 192.168.1.10 and the default gateway will be the routers interface’s ip address that is face to DHCP server.



For the subnets 192.168.1.0 and 10.10.0.0 there must be two DHCP pool.The below screenshot is showing how these assignments will be done in DHCP Server.



In the router the following configuration will be done for two different subnet DHCP achivement:

RouterC # config terminal
RouterC(config)# interface fa0/0
RouterC(config-if)# ip address 10.10.0.1 255.255.255.0
RouterC(config-if)# ip helper-address 192.168.1.10
RouterC(config-if)# no shutdown
RouterC(config-if)# exit
RouterC(config)# interface fa1/0
RouterC(config-if)# ip address 192.168.1.1 255.255.255.0
RouterC(config-if)# ip helper-address 192.168.1.10
RouterC(config-if)# no shutdown
RouterC(config-if)# end
RouterC# copy run start

After this configuration, we can try to dynamic ip assignment on PC by selectinf the dynamic option on ip configuration screen like below.





You can DOWNLOAD the Packet Tracer example with .pkt format HERE.




************************************************************
WouLd YoU LiKe To Learn How to Use PAcket TraceR and PracTice CCNA LAbs on PaCKet TrAcEr???
Here is My Courses on UDemY!!
CISCO PACKET TRACER HOW TO GUIDE
CISCO PACKET TRACER CCNA LABS ADVENTURE 1
CISCO PACKET TRACER CCNA LABS ADVENTURE 2
************************************************************


You can download “Packet Tracer” in Tools section.

I hope this post will be helpful for computer network funs…;)

You can check the other Packet Tracer Examples below:

Common Cisco Router Configuration Example on Packet Tracer
Router DHCP Configuration Example on Packet Tracer
VTP Configuration Example on Packet Tracer
VLAN Configuration Example on Packet Tracer
STP Configuration Example on Packet Tracer
BGP Configuration Example on Packet Tracer
Port Security Configuration Example on Packet Tracer
RIP Configuration Example on Packet Tracer
CDP Configuration Example on Packet Tracer
OSPF Area Types Example on Packet Tracer (Standard and Backbone Areas)
OSPF External Routes Example on Packet Tracer
OSPF Area Types Example on Packet Tracer (Stub, NSSA, Totally Stubby, Totally NSSA Areas)

Youn can join OUR Facebook Group with the below links!!!




About the Author
Gokhan Kosem is a telecommunation and network engineer. His ambition to IP networks and end-to-end system installation made him to prepare this web-site. By sharing his experiences about various networking protocols beside different system installation experiences and Cisco, Juniper, Alcatel-Lucent devices configurations, he is aimed to be helpful for his collegues in all over the world. He is currently lives in Istanbul, Turkey.

53 comments for “Router DHCP Configuration with Packet Tracer”

1
haleh

hi
thanks a lot
i passed ccna and enjoyed from your post and you solve my problem with dhcp config in packet tracer!
another my problem is config dhcp with different vlans and 1 dhcp server(like part2 of this project) in packet tracer .
do you have a project about that?

December 8th, 2011 at 11:45
2
gokhankosem

Hi Halleh,
Congratulations for your achievement! I am happy if my article was useful for you;)

As you know some DHCP packets are broadcast, and so they do not pass any broadcast domain.
You should cheat the router with ip helper-address:)

If you give the command “ip helper-address dhcpaddress” command to the interface of the router that is in another broadcast domain,
then you will able to set the DHCP to a different broadcast domain. Here, ip helper-address command will change the 255.255.255.255
broadcast address to a unicast address (DHCP server’s address).

I hope this will be useful for you;)

December 9th, 2011 at 22:39
3
halleh

hi gokhan
can packet tracer 5.3.2 provide dhcp to multi vlans from one server?

December 11th, 2011 at 12:14
4
halleh

can serverP-T in yoyr project allocate ip to pcs in different vlan?

December 11th, 2011 at 12:29
5
gokhankosem

Hi Halleh,

Yes it can allocate ip to different vlans by ip helper-address command;)

December 11th, 2011 at 22:12
6

pls can get me thru on how packet tracer 5.3.2 provide dhcp to multi-vlan from one server

May 10th, 2012 at 18:23
7
Radia

thank u for ur post.. and it was really helpful :)

May 13th, 2012 at 17:18
8
gokhankosem

You welcome Radio…ipcisco.com is a new website, I hope it will be more helpfull in the following days;)

May 20th, 2012 at 14:51
9
vinayak kamble

hi
i want to configure dhcp on router. how to configure if have more than two switches in the network.
pl help

June 2nd, 2012 at 15:02
10
mehrzad qashqae

hi

thank u for ur post.. and it was really helpful

July 16th, 2012 at 14:23
11
gokhankosem

You are welcome, Mehrzad ;)

July 21st, 2012 at 16:31
12
Kiran

Hi Gokhan,

As per this article i am trying to configure DHCP in packet tracer. I am trying to configure “ip helper-address” in interface mode and “ip dhcp-server” in global config mode but none of them is working. I tried these two commands in router as well as in layer 3 switch but failed. My actual intention is to assign ip address from DHCP server to phone and pc where phone is connected to layer 2 switch and pc is connected to the phone. There are two layer 3 switches in between layer 2 switch and DHCP server. Every thing is working fine except this DHCP configuration in layer 3 switch and phones and PCs are not getting ip address. Please help me in this scenario.

DHCP server–L3 switch–L3 switch–L2 switch—IP phone(DHCP client)–PC(DHCP client)

August 7th, 2012 at 11:29
13
SANJEEV KUMAR

Its very helpfull for me.

thanks

August 23rd, 2012 at 07:49
14
Nelsen Marcelino

Hey. Please help me to create 3 Lan, 3 Wan . Using 3 switches and as you many as you can PC. Here our IP address 192.170.9.0/26
ASAP

September 17th, 2012 at 07:17
15
prashant

Can i create a user authenticated dhcp server in cisco packet tracer?How?

October 2nd, 2012 at 10:47
16
Priya

Wow I learnt hw n\w are intersting from ur post

October 16th, 2012 at 17:55
17
cisco kid

hi gokhan
i followed the tutorial you made but suddenly the pc4 wont received an ip address via dhcp but the pc3 has a dhcp ip add ,,, can u help me? thank in advance

November 3rd, 2012 at 14:40
18
Amira

Thank you for the post… very helpful :)

November 18th, 2012 at 14:59
19
sanjev

I have configured DHCP but not able to get ip for the desktop

November 27th, 2012 at 14:50
20
Thiyagu

thanks a lot..learning here first about dhcp..

@sanjev
It works for me.may be u missed to change static radio button to dhcp.

December 10th, 2012 at 14:28
22
fateme iranpour

hi merc
do u have bgp scenario?
if u have plz send me.
thanks

April 19th, 2013 at 07:40
23
Sima

Hi Gokhan,
Thank for your useful posts, i want to request u for a dhcpv6 config tutorial with command explanation.
Thanks…

June 24th, 2013 at 01:53
24
tata

Thank you!!!!!

June 27th, 2013 at 12:04
25
Edem

Thanks for the help was able to pass my ccna successfully and to finish my projects as well, unlike most sites you made things simple and straight to the point,thanks.

July 29th, 2013 at 13:40
26
edris

hello.I am Iranian
1.VLAN mode by using the Subnetting Packet tracer software by 300 client?

August 31st, 2013 at 10:53
27
Vincois Slayer

Very nice……helps me a lot

September 24th, 2013 at 10:09
28
Ole

Made my day! Thanks alot!

October 1st, 2013 at 23:05
29
John Philippe P. Liberato

Thank you a lot man! :D

December 9th, 2013 at 13:55
30
Czeth

Hey thanks ! this tutorial helped me a lot !

December 10th, 2013 at 17:33
31
Ibnu Mahardhika

Its very helpfull for me.

thanks

December 12th, 2013 at 12:44
32
Cali

Thanks, help me a lot.

December 15th, 2013 at 07:42
33
dhananjayan

best work keep up the good work

December 22nd, 2013 at 20:58
34
revathy

hi gokhankosem
Thank you so much it is very useful

January 16th, 2014 at 15:22
35
Benk

hi,
DHCP request failed
why?
between router and switch is not connect :(

March 7th, 2014 at 18:14
37
hazel

Thank you for the notes. It was helpful. But I have some questions:
1-Why the RIP and static route config? Is it necessary for DHCP? Because if you just type and give them static IPs, they all the PC can ping each other without the routing config.

2- Using the configurations you provided, the 10.0.0.0 works fine. But the 192.x.x.x network does not. The hosts are given the gateway 0.0.0.0.
I am not sure what went wrong.

I hope you can help. Thank you again.

April 16th, 2014 at 04:52
38
Jamal

Nice share. helped me allot .

April 29th, 2014 at 09:42
39
Akil Ansari

thanks it’s very help full for me.

May 3rd, 2014 at 13:23
40
mohammad

hi
I do that but request failed. please help me in detail
best regards

May 14th, 2014 at 00:32
41
Jalal Anwar

Thanks for the post it really helped me in my CCn class thanks for ur efforts because of you i have got 10 out of 10 in my Assignment Thankyou be Happy as always :) :) :) :) :)

I am student of Comsats abbottabad Pakistan :) :)

May 14th, 2014 at 10:23
42
Bilal Ahmad

Thankyou sir for the great post u did

actually today one of our teacher give us assignment in Router Dhcp and i have got the idea from your site thankyou …

May 14th, 2014 at 10:24
43
Avinaba Chakraborty

it is very helpfull

June 27th, 2014 at 21:25
44

thanks you for your configure dhcp

August 22nd, 2014 at 04:48
45

i want to know full advanced networking can u plz help me

January 5th, 2015 at 14:52
46
Kend

hi gokhan , it’s very helpful though i still have one question in my mind , can the dhcp gives ip addresses through multiple routers? As i’m trying to have multiple routers and switches and i want them to be auto assigned with ip address and they can connect to each others

February 6th, 2015 at 13:17
47
Kend

and what are the excluded addresses for?

February 6th, 2015 at 13:19
48
Timoteo

In wirehark, why am is it recording packets from ip source that are not allocated?

May 6th, 2015 at 01:22
49

I have written so many articles on DHCP configuration in detail.Hope you guys like it.

June 28th, 2015 at 21:50
50
sam

thanks very helpful
but i want save this i am not able to save help me

July 6th, 2015 at 10:57
51
shella

thank you dear
very helpful

October 10th, 2015 at 07:10
52
Pius

Its helpful ever seen

December 31st, 2015 at 01:39
53
eangly

when i change from static to DHCP it show me “DHCP failed. APIPA is being used””\
how can i fix it

January 4th, 2016 at 07:08

Leave a Reply


Copy Protected by Chetan's WP-Copyprotect.