DHCP Server Configuration on a Cisco Router
Every device on an IP network needs four pieces of information to communicate: an IP address, a subnet mask, a default gateway, and a DNS server. Manually assigning these to every host in an organisation is time-consuming and error-prone. DHCP (Dynamic Host Configuration Protocol) automates this — a DHCP server maintains pools of available addresses and automatically leases them to hosts when they connect to the network.
Cisco IOS routers can act as full DHCP servers — an efficient solution for
branch offices and small networks that do not have a dedicated server.
The router assigns IP addresses, subnet masks, default gateways, DNS servers,
and lease durations to hosts. When hosts on remote subnets need to reach a
DHCP server on a different subnet, a DHCP relay agent
(ip helper-address) forwards the broadcast requests as unicast
across router boundaries. For a conceptual overview see
DHCP Overview and
How DHCP Works.
Before starting, complete Inter-VLAN Routing — Layer 3 Switch and Inter-VLAN Routing — Router-on-a-Stick to understand how hosts on different VLANs reach the router. For default gateway redundancy with DHCP, see HSRP — First Hop Redundancy.
1. DHCP — Core Concepts
The DORA Process
DHCP uses a four-step exchange called DORA to assign an address to a client. Understanding each step is essential for troubleshooting DHCP failures:
| Step | Message | Direction | Purpose | Transport |
|---|---|---|---|---|
| D | DHCP Discover | Client → Network | Client broadcasts to find available DHCP servers | Broadcast (255.255.255.255) |
| O | DHCP Offer | Server → Client | Server offers an available IP address and configuration | Broadcast or unicast |
| R | DHCP Request | Client → Network | Client formally requests the offered address (also broadcast to notify other servers) | Broadcast (255.255.255.255) |
| A | DHCP Acknowledge | Server → Client | Server confirms the lease — client may now use the IP address | Broadcast or unicast |
ip helper-address) converts
these broadcasts into unicast packets and forwards them to the DHCP server.
See DHCP Relay and
DHCP Relay Agent — ip helper-address
for the dedicated relay lab.
DHCP Pool Parameters
| Parameter | IOS Command | Description | Required? |
|---|---|---|---|
| Network | network [IP] [mask] |
The subnet this pool serves — defines the range of available addresses | ✅ Yes |
| Default Gateway | default-router [IP] |
The gateway address sent to clients — should match the router's interface IP on that subnet | ✅ Recommended |
| DNS Server | dns-server [IP] |
DNS resolver address sent to clients — can specify up to 8 servers | ✅ Recommended |
| Lease Duration | lease [days] [hours] [minutes] |
How long a client may keep the address before renewing. Default: 1 day | Optional |
| Domain Name | domain-name [name] |
DNS domain suffix appended to hostnames — e.g., netstuts.local |
Optional |
| NetBIOS Server | netbios-name-server [IP] |
WINS server for Windows NetBIOS name resolution (legacy) | Optional |
Excluded Addresses
Before defining any pool, exclude addresses that are already statically assigned — router interfaces, servers, printers, switches, and the HSRP virtual IP. Excluded addresses are configured globally (not inside a pool) and apply across all pools:
| Address Type | Example | Why Exclude? |
|---|---|---|
| Router interface (gateway) | 192.168.10.1 | Already assigned — DHCP must not hand it to a host |
| HSRP virtual IP | 192.168.10.254 | Used by HSRP — not available for hosts |
| Servers and printers | 192.168.10.2–10 | Static assignments — must be consistent |
| Managed switch IP | 192.168.10.11 | Static management address on the switch |
2. Lab Topology & Scenario
NetsTuts_R1 serves as the DHCP server for two VLANs —
VLAN 10 (Staff, 192.168.10.0/24) and VLAN 20 (Guest, 192.168.20.0/24).
NetsTuts_R2 is on a remote subnet (192.168.30.0/24)
and uses ip helper-address to relay DHCP requests from its
LAN clients back to R1 across the routed network.
┌─────────────────────────────────────────────────────────────────┐
│ NetsTuts_R1 │
│ DHCP Server for all three pools │
│ Gi0/0.10: 192.168.10.1/24 Gi0/0.20: 192.168.20.1/24 │
│ Gi0/1: 10.0.12.1/30 ──────────────────────────────────┐ │
└─────────────────────────────────────────────────────────────────┘
| | |
VLAN 10 VLAN 20 10.0.12.0/30
192.168.10.0/24 192.168.20.0/24 |
[PC1][PC2] [Laptop1] ┌─────────────────┐
│ NetsTuts_R2 │
│ Gi0/0: │
│ 10.0.12.2/30 │
│ Gi0/1: │
│ 192.168.30.1/24│
│ ip helper-addr │
└─────────────────┘
|
192.168.30.0/24
[PC3][PC4]
(DHCP relay clients)
| DHCP Pool | Subnet | Gateway | Excluded Range | Served By |
|---|---|---|---|---|
| STAFF-VLAN10 | 192.168.10.0 /24 | 192.168.10.1 | .1 – .20 | R1 directly |
| GUEST-VLAN20 | 192.168.20.0 /24 | 192.168.20.1 | .1 – .10 | R1 directly |
| REMOTE-VLAN30 | 192.168.30.0 /24 | 192.168.30.1 | .1 – .10 | R1 via relay on R2 |
3. Step 1 — Exclude Static Addresses on R1
Always configure exclusions before defining the pools. If a pool is defined first and a client receives an address before the exclusion is added, that address will be handed out and must be manually cleared. Exclusions take a range — use a single IP for just one address:
NetsTuts_R1>en NetsTuts_R1#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Exclude static addresses from VLAN 10 pool ─────────── ! ── Router interface (.1) through reserved range (.20) ─── NetsTuts_R1(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.20 ! ── Exclude static addresses from VLAN 20 pool ─────────── NetsTuts_R1(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10 ! ── Exclude static addresses from VLAN 30 pool ─────────── NetsTuts_R1(config)#ip dhcp excluded-address 192.168.30.1 192.168.30.10
4. Step 2 — Define DHCP Pools on R1
Pool 1 — STAFF VLAN 10
! ── Pool for VLAN 10 Staff network ─────────────────────── NetsTuts_R1(config)#ip dhcp pool STAFF-VLAN10 NetsTuts_R1(dhcp-config)#network 192.168.10.0 255.255.255.0 NetsTuts_R1(dhcp-config)#default-router 192.168.10.1 NetsTuts_R1(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 NetsTuts_R1(dhcp-config)#domain-name netstuts.local NetsTuts_R1(dhcp-config)#lease 7 NetsTuts_R1(dhcp-config)#exit
lease 7 sets a 7-day lease — appropriate for office workstations
that stay on the network continuously. Shorter leases (e.g., 1 hour) are
better for high-turnover environments like guest Wi-Fi.
Pool 2 — GUEST VLAN 20
NetsTuts_R1(config)#ip dhcp pool GUEST-VLAN20 NetsTuts_R1(dhcp-config)#network 192.168.20.0 255.255.255.0 NetsTuts_R1(dhcp-config)#default-router 192.168.20.1 NetsTuts_R1(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 NetsTuts_R1(dhcp-config)#domain-name guest.netstuts.local NetsTuts_R1(dhcp-config)#lease 0 4 NetsTuts_R1(dhcp-config)#exit
lease 0 4 = 0 days,
4 hours). Short leases reclaim addresses quickly as guest devices come
and go — preventing address exhaustion on the guest VLAN. A different
domain name (guest.netstuts.local) also segregates guest
name resolution from the staff domain.
Pool 3 — REMOTE VLAN 30 (served via relay)
NetsTuts_R1(config)#ip dhcp pool REMOTE-VLAN30 NetsTuts_R1(dhcp-config)#network 192.168.30.0 255.255.255.0 NetsTuts_R1(dhcp-config)#default-router 192.168.30.1 NetsTuts_R1(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 NetsTuts_R1(dhcp-config)#domain-name netstuts.local NetsTuts_R1(dhcp-config)#lease 1 NetsTuts_R1(dhcp-config)#exit NetsTuts_R1(config)#end NetsTuts_R1#wr Building configuration... [OK] NetsTuts_R1#
default-router 192.168.30.1) points to R2's interface —
not R1. Clients on the 192.168.30.0/24 subnet will reach this pool via
the relay agent configured on R2 in the next step.
DHCP Pool Command Reference
| Command | What It Does | Example |
|---|---|---|
ip dhcp pool [name] |
Creates a named DHCP pool and enters dhcp-config mode | ip dhcp pool STAFF-VLAN10 |
network [IP] [mask] |
Defines the subnet this pool serves — addresses not excluded are available for lease | network 192.168.10.0 255.255.255.0 |
default-router [IP] |
Sets the default gateway sent to clients (Option 3) | default-router 192.168.10.1 |
dns-server [IP] [IP2] |
Sets the DNS resolver(s) sent to clients (Option 6) | dns-server 8.8.8.8 8.8.4.4 |
domain-name [name] |
Sets the DNS domain name sent to clients (Option 15) | domain-name netstuts.local |
lease [days] [hours] [minutes] |
Sets the lease duration. Default is 1 day. Use lease infinite for permanent leases |
lease 7 / lease 0 4 |
5. Step 3 — Configure DHCP Relay Agent on R2
Hosts on 192.168.30.0/24 send DHCP Discover as a broadcast.
By default, R2 drops broadcasts and does not forward them to R1.
The ip helper-address command on R2's LAN interface
converts the broadcast into a directed unicast sent
to R1's IP (10.0.12.1), allowing DHCP to cross the router boundary:
NetsTuts_R2>en NetsTuts_R2#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Apply relay on the interface facing the remote clients NetsTuts_R2(config)#interface GigabitEthernet0/1 NetsTuts_R2(config-if)#ip helper-address 10.0.12.1 NetsTuts_R2(config-if)#exit NetsTuts_R2(config)#end NetsTuts_R2#wr Building configuration... [OK] NetsTuts_R2#
ip helper-address 10.0.12.1 is configured on the interface
facing the clients (Gi0/1 — the 192.168.30.0/24 side),
not the uplink to R1. The helper-address is R1's IP address on the link
between R1 and R2 (10.0.12.1). When a client broadcasts a DHCP Discover,
R2 intercepts it, replaces the source IP with its own interface IP
(192.168.30.1), and forwards it as a unicast to 10.0.12.1. R1 uses the
relay agent's IP (192.168.30.1) to identify which pool to use —
matching it to the REMOTE-VLAN30 pool whose network includes 192.168.30.1.
How the Relay Process Works
| Step | What Happens | Key Detail |
|---|---|---|
| 1 | PC3 sends DHCP Discover as broadcast (255.255.255.255) | Source IP: 0.0.0.0 (no IP yet) |
| 2 | R2 receives broadcast on Gi0/1 — ip helper-address is configured |
R2 intercepts the broadcast instead of dropping it |
| 3 | R2 adds its interface IP (192.168.30.1) as the giaddr (gateway address field) and forwards the Discover as unicast to 10.0.12.1 | giaddr tells R1 which subnet the client is on |
| 4 | R1 receives the unicast Discover, reads the giaddr (192.168.30.1), matches it to the REMOTE-VLAN30 pool, and sends an Offer back to R2 | R1 selects the correct pool based on giaddr |
| 5 | R2 forwards the Offer to PC3. PC3 completes the DORA exchange and receives 192.168.30.x | PC3 also receives gateway 192.168.30.1 and DNS 8.8.8.8 |
ip helper-address on the interface closest to the
clients — the LAN-facing interface of the relay router.
If configured on the wrong interface (e.g., the uplink), the router
will not intercept client broadcasts and DHCP fails silently.
6. Step 4 — DHCP Static Binding (Optional)
For devices that need the same IP address every time (network printers, servers, IP cameras) but should still use DHCP rather than manual static configuration, IOS supports manual bindings — a fixed IP address permanently reserved for a specific MAC address. For securing DHCP against rogue servers and starvation attacks, see DHCP Snooping.
! ── Static DHCP binding for a network printer ──────────── NetsTuts_R1(config)#ip dhcp pool PRINTER-OFFICE NetsTuts_R1(dhcp-config)#host 192.168.10.15 255.255.255.0 NetsTuts_R1(dhcp-config)#hardware-address 00A0.C9B4.3210 NetsTuts_R1(dhcp-config)#default-router 192.168.10.1 NetsTuts_R1(dhcp-config)#dns-server 8.8.8.8 NetsTuts_R1(dhcp-config)#exit
host command replaces network for static
bindings — it specifies a single host address rather than a subnet.
The hardware-address ties the binding to a specific MAC.
When the printer sends a DHCP Discover with that MAC, R1 always offers
192.168.10.15 — regardless of the excluded-address range. Static bindings
are stored separately from dynamic leases.
7. Verification
show ip dhcp pool
NetsTuts_R1#show ip dhcp pool Pool STAFF-VLAN10 : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 254 Leased addresses : 3 Pending event : none 1 subnet is currently in the pool : Current index IP address range Leased addresses 192.168.10.21 192.168.10.1 - 192.168.10.254 3 Pool GUEST-VLAN20 : Total addresses : 254 Leased addresses : 1 Current index IP address range Leased addresses 192.168.20.11 192.168.20.1 - 192.168.20.254 1 Pool REMOTE-VLAN30 : Total addresses : 254 Leased addresses : 2 Current index IP address range Leased addresses 192.168.30.11 192.168.30.1 - 192.168.30.254 2
show ip dhcp binding
NetsTuts_R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type State Interface
Hardware address/
User name
192.168.10.21 0100.5056.AB.12.34 Mar 12 2026 10:22 AM Automatic Active GigabitEthernet0/0.10
192.168.10.22 0100.5056.AB.56.78 Mar 12 2026 10:24 AM Automatic Active GigabitEthernet0/0.10
192.168.10.23 0100.5056.AB.9A.BC Mar 12 2026 10:25 AM Automatic Active GigabitEthernet0/0.10
192.168.20.11 0100.AABB.CC.DD.EE Mar 05 2026 06:32 PM Automatic Active GigabitEthernet0/0.20
192.168.30.11 0100.1234.56.78.9A Mar 06 2026 10:30 AM Automatic Active GigabitEthernet0/1
192.168.30.12 0100.FEDC.BA.98.76 Mar 06 2026 10:32 AM Automatic Active GigabitEthernet0/1
show ip dhcp binding lists every active lease — the assigned
IP, the client's MAC address (in Client-ID format: 01 + MAC), the lease
expiry time, whether the assignment was automatic (dynamic) or manual
(static binding), and the interface the lease was issued from.
Remote relay clients (192.168.30.x) show the relay interface (Gi0/1)
rather than the client's actual interface.
show ip dhcp conflict
NetsTuts_R1#show ip dhcp conflict IP address Detection method Detection time VRF 192.168.10.25 Ping Mar 05 2026 08:14 AM
clear ip dhcp conflict * after resolving the duplicate
assignment.
show ip dhcp server statistics
NetsTuts_R1#show ip dhcp server statistics Memory usage : 22137 Address pools : 3 Database agents : 0 Automatic bindings : 6 Manual bindings : 1 Expired bindings : 0 Malformed messages : 0 Secure arp entries : 0 Message Received BOOTREQUEST 0 DHCPDISCOVER 12 DHCPREQUEST 10 DHCPDECLINE 0 DHCPRELEASE 2 DHCPINFORM 0 Message Sent BOOTREPLY 0 DHCPOFFER 12 DHCPACK 10 DHCPNAK 0
Verify Relay on R2
NetsTuts_R2#show running-config interface GigabitEthernet0/1 Building configuration... Current configuration : 112 bytes ! interface GigabitEthernet0/1 description Remote-LAN-VLAN30 ip address 192.168.30.1 255.255.255.0 ip helper-address 10.0.12.1 duplex auto speed auto end
ip helper-address 10.0.12.1 is on the correct interface —
Gi0/1, the LAN-facing interface. If the helper-address were on Gi0/0 (the
uplink toward R1), R2 would not intercept client broadcasts and DHCP
would fail for all hosts on the 192.168.30.0/24 subnet.
Verification Command Summary
| Command | What It Shows | Primary Use |
|---|---|---|
show ip dhcp pool |
All pools — total addresses, leased count, current index, utilisation | Confirm pools are defined correctly and check address usage |
show ip dhcp binding |
All active leases — IP, client MAC, expiry time, type (auto/manual) | Identify which host has which IP — essential for troubleshooting |
show ip dhcp conflict |
Addresses removed from the pool due to conflict detection (ping response) | Diagnose address conflicts — clear with clear ip dhcp conflict * |
show ip dhcp server statistics |
Message counters — DISCOVER, OFFER, REQUEST, ACK, NAK, DECLINE | Verify DORA exchange is completing — check for NAK or high conflict counts |
show running-config | section dhcp |
All DHCP-related config — pools, exclusions, helper-addresses | Audit entire DHCP configuration in one view |
show logging |
DHCP event log — address assignments, conflicts, and relay events | Post-event review of DHCP activity |
8. Troubleshooting DHCP Issues
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| Host receives 169.254.x.x address | PC shows APIPA address — cannot reach the network | DHCP Discover sent but no Offer received — DHCP server unreachable or pool exhausted | Check show ip dhcp pool — confirm leased count vs total. Check if server is reachable. On relay scenarios, confirm ip helper-address is correct. |
| Pool exhausted — no addresses available | show ip dhcp pool shows leased = total. New clients get no address |
All available addresses are leased — either pool is too small, lease time too long, or stale bindings from disconnected devices | Clear expired bindings: clear ip dhcp binding *. Reduce lease time for dynamic environments. Add a larger subnet or expand the pool range. |
| Remote hosts not receiving DHCP (relay issue) | Direct hosts work but hosts on the remote subnet (via relay) get APIPA | ip helper-address not configured, configured on wrong interface, or pointing to wrong server IP |
Verify show running-config interface [LAN-int] on relay router — confirm helper-address is on the LAN-facing interface and points to the DHCP server's correct IP |
| Address conflict logged | show ip dhcp conflict shows entries — some hosts fail to get addresses |
A device has a static IP in the DHCP pool range — when DHCP pings the address before offering it, the device responds, and DHCP removes it from the pool | Exclude the conflicting address: ip dhcp excluded-address [IP]. Clear the conflict log: clear ip dhcp conflict * |
| Wrong default gateway assigned | Hosts receive an IP but cannot reach other networks | default-router in the pool is misconfigured — pointing to the wrong IP or not configured at all |
Check pool with show running-config | section dhcp. Correct the default-router statement. Hosts need to renew their lease to get the corrected value. |
| DHCP server assigning addresses from wrong pool | Relay clients receive addresses from the wrong subnet | The network statement in the pool does not match the giaddr sent by the relay router — pool matching uses the relay agent's interface IP |
Verify the relay router's interface IP falls within the pool's network range. The pool's network must match the subnet of the relay router's LAN interface. |
Key Points & Exam Tips
- Always configure
ip dhcp excluded-addressbefore defining pools — this prevents DHCP from handing out addresses already statically assigned to routers, switches, servers, printers, or HSRP virtual IPs. - The DHCP DORA process (Discover → Offer → Request → Acknowledge) uses broadcasts for Discover and Request — routers drop broadcasts by default. DHCP only works across subnets with a relay agent. See How DHCP Works for the full process detail.
ip helper-address [server-IP]must be placed on the interface facing the clients — not the uplink toward the server. A common exam and real-world mistake is placing it on the wrong interface.- The DHCP server identifies which pool to use for relay clients based on the giaddr field — the relay router's LAN interface IP. The pool's
networkstatement must include that IP address. show ip dhcp bindingshows every active lease — IP address, client MAC, expiry time, and whether it was dynamically assigned or a static binding. This is the primary command for tracing which host holds which IP.show ip dhcp poolshows utilisation — total addresses vs leased count. Use this to detect pool exhaustion before hosts start failing to get addresses.show ip dhcp conflictshows addresses that were removed from the pool because DHCP detected they were already in use (ping response before offering). Clear withclear ip dhcp conflict *after resolving the duplicate.- Static DHCP bindings use
hostinstead ofnetworkand tie a specific IP to a MAC address viahardware-address— useful for printers and servers that need a consistent IP without manual static configuration. - DHCP lease time should match the environment — long leases (7 days) for stable wired workstations, short leases (1–4 hours) for guest Wi-Fi where devices frequently join and leave.
- On the CCNA exam: know the four DORA steps, why broadcasts do not cross routers, what
ip helper-addressdoes, the difference betweennetwork(dynamic pool) andhost(static binding), and which commands verify active leases vs pool utilisation. Also review VLANs and DNS as closely related topics.