free lab · CertCrack Packet Tracer Labs · All labs

Lab 7: DHCPv4 — Server & Relay

CCNA domain: Domain 4 · IP Services (DHCPv4)  ·  Difficulty: Intermediate  ·  Time: ~35 minutes  ·  Devices: 2 routers (2911), 2 switches (2960), 3 PCs

Nobody configures 200 PCs by hand — DHCP hands out addresses, gateways and DNS automatically. In this lab R1 becomes the DHCP server for two LANs: its own local subnet directly, and a second subnet behind R2, whose requests can only reach the server because of the DHCP relay command ip helper-address. You will reserve the first ten addresses of each pool for infrastructure with excluded ranges, then watch the bindings appear as the PCs boot.

Your progress on this lab

0 of 6 tasks done — tick tasks off as you finish them; progress is saved in this browser.

What you need

Topology

R1DHCP serverR22911SW1LAN 1SW2LAN 2PC0DHCP clientPC1DHCP clientPC2DHCP via helperG0/1 · 10.0.0.1/30 — 10.0.0.2 · G0/0G0/0 · 192.168.1.1/24G0/1 · 192.168.2.1/24

LAN 1 (192.168.1.0/24) hangs off R1 itself, so its DHCP broadcasts reach the server untouched. LAN 2 (192.168.2.0/24) sits behind R2 — and DHCP requests are broadcasts, which routers refuse to forward. R2 solves this with a helper address that converts LAN 2's broadcasts into unicasts aimed at R1 (10.0.0.1). R1 also needs a static route to 192.168.2.0/24 so it can answer and route return traffic; DHCP cannot fix a missing route.

DeviceInterfaceIP addressNotes
R1GigabitEthernet 0/0192.168.1.1 /24LAN 1 gateway + DHCP server interface
R1GigabitEthernet 0/110.0.0.1 /30Link to R2 — the address the helper points at
R2GigabitEthernet 0/010.0.0.2 /30Link to R1
R2GigabitEthernet 0/1192.168.2.1 /24LAN 2 gateway — ip helper-address goes here
R1DHCP pool LAN1192.168.1.0 /24Hands out .11–.254 (.1–.10 excluded)
R1DHCP pool LAN2192.168.2.0 /24Hands out .11–.254 (.1–.10 excluded)
PC0 / PC1FastEthernet 0DHCPExpect 192.168.1.11 and 192.168.1.12, gateway 192.168.1.1
PC2FastEthernet 0DHCPExpect 192.168.2.11, gateway 192.168.2.1 — via the helper

Tasks

Build the topology first, then work through the tasks in order. Try each task from memory before you open the commands — that is how the skill sticks. Click Show commands only when you are stuck or to check your work.

Task 1 — Address both routers and route to LAN 2

Configure the four interfaces from the plan and no shutdown them. Then give each router one static route to the far LAN: R1 must reach 192.168.2.0/24 (via R2 at 10.0.0.2) before it can serve or answer that subnet, and R2 must reach 192.168.1.0/24 (via R1 at 10.0.0.1) so DHCP replies and pings can travel back. Both routes matter — DHCP cannot fix a missing path in either direction.

On R1:
interface gigabitEthernet 0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
interface gigabitEthernet 0/1
ip address 10.0.0.1 255.255.255.252
no shutdown
exit
ip route 192.168.2.0 255.255.255.0 10.0.0.2

On R2:
interface gigabitEthernet 0/0
ip address 10.0.0.2 255.255.255.252
no shutdown
interface gigabitEthernet 0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
ip route 192.168.1.0 255.255.255.0 10.0.0.1

Task 2 — Exclude the infrastructure addresses on R1

The first ten addresses of each subnet are reserved for gateways, servers and printers that get static assignments. If DHCP hands one out, you get a duplicate-address fault later. Exclusions are configured in global configuration mode — before or after the pools, but never inside a pool. Run both lines on R1:

ip dhcp excluded-address 192.168.1.1 192.168.1.10
ip dhcp excluded-address 192.168.2.1 192.168.2.10

Task 3 — Create the LAN1 DHCP pool

A pool ties together everything a client needs: the network it draws addresses from, the default-router it is told to use, and a dns-server. Enter pool configuration with ip dhcp pool LAN1 — the prompt changes to (dhcp-config)# — then add the three statements:

ip dhcp pool LAN1
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8
exit

Task 4 — Create the LAN2 DHCP pool

The second pool mirrors the first, with one difference students constantly miss: the default-router is 192.168.2.1 — LAN 2's own gateway on R2 — not the DHCP server's address. A pool always describes the client's subnet, never the server's location.

ip dhcp pool LAN2
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 8.8.8.8
exit

Task 5 — Relay LAN 2's requests with ip helper-address

Now the piece that makes LAN 2 work at all. On R2, under the LAN 2 interface, add the helper pointing at R1's address on the interconnect link, 10.0.0.1. When a DHCP broadcast arrives on G0/1, R2 rewrites it as a unicast to 10.0.0.1 and — crucially — stamps its own G0/1 address (192.168.2.1) as the gateway inside the request, which is how R1 knows to answer from pool LAN2 and not LAN1.

On R2:
interface gigabitEthernet 0/1
ip helper-address 10.0.0.1
exit

Task 6 — Switch the PCs to DHCP and watch them learn

On each PC: Desktop → IP Configuration → DHCP. PC0 and PC1 should receive 192.168.1.11 and 192.168.1.12 (the pool starts after the excluded range); PC2 should receive 192.168.2.11 with gateway 192.168.2.1. If a PC shows an APIPA address (169.254.x.x), its request never got an answer — re-check that subnet's path through the verification steps. Note this lab's helper only forwards DHCP correctly because the route from Task 1 exists.

On PC0, PC1 and PC2:
Desktop > IP Configuration > select DHCP
Wait for 'DHCP request successful'

Then check - PC2 > Command Prompt:
ipconfig

Verification

Run these checks from the device CLI (or a PC command prompt where noted). Your output should match the description — wording may vary slightly by Packet Tracer version.

Exam connection

DHCP sits in Domain 4 (IP Services), and the relay is its most-tested behavior: expect questions asking where ip helper-address is configured (on the router interface facing the clients — not the server, not the clients) and what breaks when the excluded range or the default-router statement is wrong. This lab also quietly rehearses Domain 3: DHCP answers are useless without the return route. Cement it with the free 30-question CCNA practice sample and the CCNA 200-301 guidebook.

Turn lab skills into exam marks

DHCP questions reward people who have watched a binding table fill up. Run the free sample and see if the relay scenarios feel as obvious as they should now.

Free CCNA SampleCCNA Guidebook

FAQ

Why do the PCs get .11 first instead of .2?

Because of the excluded-address ranges from Task 2: .1 through .10 in each subnet are withheld from the pool, so the first lease the server may offer is .11. Exclusions are how you keep DHCP from colliding with statically addressed infrastructure like the gateway itself at .1.

What exactly does ip helper-address forward?

By default it forwards eight UDP broadcast services — DHCP (ports 67/68) is the one this lab uses, along with things like TFTP, DNS and NetBIOS name service broadcasts. The router takes the broadcast received on that interface and re-sends it as a unicast to the helper address, inserting the receiving interface's IP as the gateway address (giaddr) so the server knows which subnet the request came from.

PC2 got a 169.254 address. What failed?

169.254.x.x is APIPA: the PC asked for DHCP, heard nothing, and self-assigned a link-local address. Work outward: is R2's G0/1 up and addressed? Is the helper on that interface (not on G0/0)? Does pool LAN2's network match 192.168.2.0/24? Can R1 ping 192.168.2.1 — if not, the Task 1 static route is missing and replies have no path back.

← Previous labLab 6: Single-Area OSPFv2 Next lab →Lab 8: PAT Overload & Standard ACLs

More free tools

Packet Tracer LabsAll 10 free CCNA hands-on labs Subnet CalculatorNetwork, broadcast & host ranges from any IP/CIDR Subnetting PracticeTimed subnet drills with worked solutions OSI Model QuizLearn the 7 layers and test yourself All Free ToolsThe CertCrack tools hub