DHCP Relay Agent — ip helper-address
A DHCP client discovers its server by broadcasting a DHCP Discover packet — a broadcast that every device on the local segment receives. Routers, by design, do not forward broadcasts between subnets. In a network with a centralised DHCP server serving multiple subnets, this creates a problem: hosts on any subnet other than the server's own cannot reach the server at all. For DHCP fundamentals see DHCP and How DHCP Works.
The ip helper-address command transforms a
Cisco router into a DHCP relay agent. When a client broadcast
arrives on an interface with a helper-address configured, the router intercepts
it, rewrites it as a unicast packet addressed to the configured
server IP, and forwards it across the routed network. From the DHCP server's
perspective, the relay agent's interface IP identifies which subnet pool to
use — enabling one server to serve dozens of subnets simultaneously.
This lab builds directly on DHCP Server Configuration — the DHCP server pools configured there are the server-side prerequisite for this lab. Review OSPF Single-Area Configuration or Static Route Configuration to understand the routed path the relayed packets travel. For VLAN segmentation that creates the separate subnets requiring relay see VLANs and VLAN Creation & Management. For inter-VLAN routing at the distribution layer see Inter-VLAN Routing (Router-on-a-Stick) and Inter-VLAN Routing (Layer 3 Switch).
1. Why Broadcasts Don't Cross Routers — and How Relay Fixes It
The Broadcast Boundary Problem
DHCP clients have no IP address when they start — they cannot send a unicast packet. Every DHCP Discover is a Layer 3 broadcast (255.255.255.255) with a Layer 2 broadcast (FF:FF:FF:FF:FF:FF) MAC. Routers drop these broadcasts at their interface — they never cross to another subnet. Without a relay agent, every subnet needs its own local DHCP server:
Without ip helper-address:
[PC1 — 192.168.10.x]──── Router ────[DHCP Server — 10.0.12.1]
DHCP Discover (broadcast) ──► X DROPPED at Router
PC1 cannot reach the DHCP server
With ip helper-address 10.0.12.1 on Router's Gi0/0:
[PC1 — 192.168.10.x]──── Router ────[DHCP Server — 10.0.12.1]
DHCP Discover (broadcast) ──► Router intercepts broadcast
Rewrites as UNICAST to 10.0.12.1
Adds giaddr = 192.168.10.1
──► DHCP Server receives unicast Discover
Selects pool matching 192.168.10.0/24
Sends Offer back to Router
──► Router forwards Offer to PC1
PC1 receives DHCP address!
What ip helper-address Does — Step by Step
| Step | Action by Relay Router | Technical Detail |
|---|---|---|
| 1 | Receives DHCP Discover broadcast on the LAN interface | Broadcast arrives on the interface where ip helper-address is configured |
| 2 | Records the client's MAC address and incoming interface | Used to forward the server's reply back to the correct client |
| 3 | Sets the giaddr field to its own interface IP on the client's subnet | giaddr = gateway IP address. The DHCP server uses this to select the correct pool |
| 4 | Changes destination from broadcast (255.255.255.255) to unicast (server IP) | The relayed packet is now a routable unicast UDP packet to port 67 |
| 5 | Forwards the unicast Discover to the DHCP server | Normal IP routing applies — the server IP must be reachable from the relay router |
| 6 | Receives the server's Offer/Acknowledge (unicast back to relay) | Server unicasts reply to giaddr (relay router), not the client |
| 7 | Forwards the Offer/Acknowledge to the client as broadcast or unicast | Client may receive as broadcast since it still has no IP for unicast delivery |
giaddr — The Key to Pool Selection
The giaddr (Gateway IP Address) field is the most important
element of DHCP relay operation. The relay agent fills this field with its
own IP address on the client-facing interface before forwarding the Discover
to the server. The DHCP server inspects the giaddr and selects the pool whose
network statement contains that IP:
| Relay Interface IP (giaddr) | DHCP Pool Matched | Address Range Offered |
|---|---|---|
| 192.168.10.1 | STAFF-VLAN10 (network 192.168.10.0/24) | 192.168.10.21 – 192.168.10.254 |
| 192.168.20.1 | GUEST-VLAN20 (network 192.168.20.0/24) | 192.168.20.11 – 192.168.20.254 |
| 192.168.30.1 | REMOTE-VLAN30 (network 192.168.30.0/24) | 192.168.30.11 – 192.168.30.254 |
Additional Protocols Forwarded by ip helper-address
By default, ip helper-address forwards broadcasts for eight
UDP protocols — not just DHCP:
| Protocol | UDP Port | Notes |
|---|---|---|
| DHCP / BOOTP | 67, 68 | The primary use case for ip helper-address |
| TFTP | 69 | Used for booting diskless workstations |
| DNS | 53 | Forwarded if DNS uses broadcasts (uncommon) |
| NetBIOS Name Service | 137 | Windows NetBIOS name resolution |
| NetBIOS Datagram Service | 138 | Windows NetBIOS datagrams |
| Time Protocol | 37 | Legacy time synchronisation |
| IEN-116 Name Service | 42 | Legacy name service |
| TAC News | 49 | Legacy protocol |
no ip forward-protocol udp 69,
no ip forward-protocol udp 53, etc.
Leave ports 67 and 68 enabled for DHCP to function.
For additional Layer 2 DHCP security see
DHCP Snooping and
DHCP Snooping &
Dynamic ARP Inspection.
2. Lab Topology & Scenario
One centralised DHCP server (on NetsTuts_R1, also acting as the DHCP server itself) serves three separate VLANs across two distribution routers (NetsTuts_R2 and NetsTuts_R3). R2 and R3 each act as relay agents for their directly connected client subnets — forwarding DHCP requests back to R1.
┌──────────────────────────────┐
│ NetsTuts_R1 │
│ DHCP Server (3 pools) │
│ Loopback0: 1.1.1.1/32 │
│ Gi0/1: 10.0.12.1/30 │
│ Gi0/2: 10.0.13.1/30 │
└──────────────────────────────┘
| |
10.0.12.0/30 10.0.13.0/30
| |
10.0.12.2/30 10.0.13.2/30
┌──────────────────┐ ┌──────────────────┐
│ NetsTuts_R2 │ │ NetsTuts_R3 │
│ Relay Agent │ │ Relay Agent │
│ Gi0/0:10.0.12.2 │ │ Gi0/0:10.0.13.2 │
│ Gi0/1:10.0.23.1 │ │ Gi0/1:10.0.23.2 │
└──────────────────┘ └──────────────────┘
Gi0/2 Gi0/3 Gi0/2 Gi0/3
192.168.10.1 192.168.20.1 192.168.30.1 192.168.40.1
| | | |
VLAN10/24 VLAN20/24 VLAN30/24 VLAN40/24
[PC1][PC2] [Laptop1] [PC3][PC4] [Phone1]
Staff Guest Branch Voice
DHCP Server: R1 (reachable via OSPF or static routes)
Relay on R2 interfaces: Gi0/2 and Gi0/3
Relay on R3 interfaces: Gi0/2 and Gi0/3
| DHCP Pool | Network | Default Gateway | Relay Interface | Helper-Address |
|---|---|---|---|---|
| STAFF-VLAN10 | 192.168.10.0 /24 | 192.168.10.1 | R2 Gi0/2 | 10.0.12.1 (R1) |
| GUEST-VLAN20 | 192.168.20.0 /24 | 192.168.20.1 | R2 Gi0/3 | 10.0.12.1 (R1) |
| BRANCH-VLAN30 | 192.168.30.0 /24 | 192.168.30.1 | R3 Gi0/2 | 10.0.13.1 (R1) |
| VOICE-VLAN40 | 192.168.40.0 /24 | 192.168.40.1 | R3 Gi0/3 | 10.0.13.1 (R1) |
3. Step 1 — Configure DHCP Server Pools on R1
Four pools are required — one per VLAN. Exclusions are configured first.
R1's loopback (1.1.1.1) is used as the ip helper-address
target on R2 and R3 — a loopback is preferred over a physical interface IP
because loopbacks never go down and provide a stable, always-reachable
destination for relayed DHCP packets:
NetsTuts_R1>en NetsTuts_R1#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Exclude static/reserved addresses from all pools ───── NetsTuts_R1(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.20 NetsTuts_R1(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10 NetsTuts_R1(config)#ip dhcp excluded-address 192.168.30.1 192.168.30.10 NetsTuts_R1(config)#ip dhcp excluded-address 192.168.40.1 192.168.40.10 ! ── Pool for Staff VLAN 10 ─────────────────────────────── 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 ! ── Pool for 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)#lease 0 4 NetsTuts_R1(dhcp-config)#exit ! ── Pool for Branch VLAN 30 ────────────────────────────── NetsTuts_R1(config)#ip dhcp pool BRANCH-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 ! ── Pool for Voice VLAN 40 ─────────────────────────────── NetsTuts_R1(config)#ip dhcp pool VOICE-VLAN40 NetsTuts_R1(dhcp-config)#network 192.168.40.0 255.255.255.0 NetsTuts_R1(dhcp-config)#default-router 192.168.40.1 NetsTuts_R1(dhcp-config)#dns-server 8.8.8.8 NetsTuts_R1(dhcp-config)#option 150 ip 192.168.40.5 NetsTuts_R1(dhcp-config)#lease 1 NetsTuts_R1(dhcp-config)#exit NetsTuts_R1(config)#end NetsTuts_R1#wr Building configuration... [OK] NetsTuts_R1#
option 150 ip 192.168.40.5
— DHCP Option 150 provides the IP address of the TFTP server (usually
the call manager) to Cisco IP phones during boot. Phones use this to
download their firmware and configuration. This is a standard addition
to any voice VLAN DHCP pool. For voice VLAN configuration on the
access switch see
Voice VLAN and
Voice VLAN Configuration.
For DNS configuration on client devices see
How DNS Works.
ip helper-address points to R1's physical interface IP
(e.g., 10.0.12.1) and that interface goes down, relay fails for the subnets
behind R2 — even if R1 is reachable via an alternate path. Using a loopback
IP (1.1.1.1) as the helper target means the relay uses any available path
to reach R1, making DHCP relay resilient to single interface failures.
4. Step 2 — Configure Relay Agent on NetsTuts_R2
ip helper-address is configured on each client-facing interface
of R2 — one per VLAN/subnet. Both interfaces point to R1's loopback
(1.1.1.1) as the DHCP server. The key rule: configure the
helper-address on the interface where client broadcasts arrive,
never on the uplink toward the server.
NetsTuts_R2>en NetsTuts_R2#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Relay for VLAN 10 clients (Staff) ──────────────────── NetsTuts_R2(config)#interface GigabitEthernet0/2 NetsTuts_R2(config-if)#description Staff-VLAN10-192.168.10.0/24 NetsTuts_R2(config-if)#ip address 192.168.10.1 255.255.255.0 NetsTuts_R2(config-if)#ip helper-address 1.1.1.1 NetsTuts_R2(config-if)#no shutdown NetsTuts_R2(config-if)#exit ! ── Relay for VLAN 20 clients (Guest) ──────────────────── NetsTuts_R2(config)#interface GigabitEthernet0/3 NetsTuts_R2(config-if)#description Guest-VLAN20-192.168.20.0/24 NetsTuts_R2(config-if)#ip address 192.168.20.1 255.255.255.0 NetsTuts_R2(config-if)#ip helper-address 1.1.1.1 NetsTuts_R2(config-if)#no shutdown NetsTuts_R2(config-if)#exit NetsTuts_R2(config)#end NetsTuts_R2#wr Building configuration... [OK] NetsTuts_R2#
5. Step 3 — Configure Relay Agent on NetsTuts_R3
NetsTuts_R3>en NetsTuts_R3#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Relay for VLAN 30 clients (Branch) ─────────────────── NetsTuts_R3(config)#interface GigabitEthernet0/2 NetsTuts_R3(config-if)#description Branch-VLAN30-192.168.30.0/24 NetsTuts_R3(config-if)#ip address 192.168.30.1 255.255.255.0 NetsTuts_R3(config-if)#ip helper-address 1.1.1.1 NetsTuts_R3(config-if)#no shutdown NetsTuts_R3(config-if)#exit ! ── Relay for VLAN 40 clients (Voice) ──────────────────── NetsTuts_R3(config)#interface GigabitEthernet0/3 NetsTuts_R3(config-if)#description Voice-VLAN40-192.168.40.0/24 NetsTuts_R3(config-if)#ip address 192.168.40.1 255.255.255.0 NetsTuts_R3(config-if)#ip helper-address 1.1.1.1 NetsTuts_R3(config-if)#no shutdown NetsTuts_R3(config-if)#exit NetsTuts_R3(config)#end NetsTuts_R3#wr Building configuration... [OK] NetsTuts_R3#
6. Multiple Helper Addresses — Redundant DHCP Servers
In production networks, a single DHCP server is a single point of failure.
Cisco IOS supports multiple ip helper-address entries
on the same interface — the relay forwards every DHCP Discover to all
configured servers simultaneously. The client receives offers from whichever
server responds first:
! ── Relay to two DHCP servers — primary and secondary ──── NetsTuts_R2(config)#interface GigabitEthernet0/2 NetsTuts_R2(config-if)#ip helper-address 1.1.1.1 NetsTuts_R2(config-if)#ip helper-address 2.2.2.2 NetsTuts_R2(config-if)#exit
Redundant Server Design Considerations
| Consideration | Details |
|---|---|
| Non-overlapping address ranges | Each DHCP server must serve a different portion of the subnet — e.g., primary handles .21–.150 and secondary handles .151–.253 — to avoid both servers offering the same address |
| 80/20 rule | A common design: primary server holds 80% of the pool, secondary holds 20%. Most clients use the primary; secondary covers primary failure |
| Same pool parameters | Both servers must have matching default-router, dns-server, and domain-name — clients receive identical configuration regardless of which server responds |
7. Verification
show ip dhcp binding — on R1 (Server)
NetsTuts_R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type State
Hardware address
192.168.10.21 0100.5056.AB.11.22 Mar 12 2026 09:00 AM Automatic Active
192.168.10.22 0100.5056.AB.33.44 Mar 12 2026 09:02 AM Automatic Active
192.168.20.11 0100.AABB.CC.DD.EE Mar 05 2026 02:00 PM Automatic Active
192.168.30.11 0100.1234.56.78.90 Mar 06 2026 09:10 AM Automatic Active
192.168.40.11 0100.FEDC.BA.98.76 Mar 06 2026 09:15 AM Automatic Active
show running-config interface — Verify Relay on R2
NetsTuts_R2#show running-config interface GigabitEthernet0/2 Building configuration... Current configuration : 128 bytes ! interface GigabitEthernet0/2 description Staff-VLAN10-192.168.10.0/24 ip address 192.168.10.1 255.255.255.0 ip helper-address 1.1.1.1 no shutdown end NetsTuts_R2#show running-config interface GigabitEthernet0/3 Building configuration... Current configuration : 128 bytes ! interface GigabitEthernet0/3 description Guest-VLAN20-192.168.20.0/24 ip address 192.168.20.1 255.255.255.0 ip helper-address 1.1.1.1 no shutdown end
ip helper-address 1.1.1.1.
Verify the helper is on the correct (client-facing) interface — a helper on
the wrong interface is the single most common DHCP relay misconfiguration.
For full interface status see
show ip interface brief and
show running-config.
debug ip dhcp server packet — Live Relay Trace on R1
NetsTuts_R1#debug ip dhcp server packet
DHCP server packet debugging is on.
NetsTuts_R1#
DHCPD: DHCPDISCOVER received from client 0100.5056.AB.11.22
through relay 192.168.10.1 on GigabitEthernet0/1
DHCPD: Allocating address 192.168.10.21 to client
DHCPD: DHCPOFFER sent to 192.168.10.1 for client 0100.5056.AB.11.22
DHCPD: DHCPREQUEST received from client 0100.5056.AB.11.22
DHCPD: DHCPACK sent to 192.168.10.1 for client 0100.5056.AB.11.22
IP address 192.168.10.21
no debug ip dhcp server
packet or undebug all.
show ip dhcp server statistics — Verify Relay Traffic
NetsTuts_R1#show ip dhcp server statistics Memory usage : 24311 Address pools : 4 Database agents : 0 Automatic bindings : 5 Manual bindings : 0 Expired bindings : 0 Malformed messages : 0 Message Received DHCPDISCOVER 18 DHCPREQUEST 16 DHCPRELEASE 3 Message Sent DHCPOFFER 18 DHCPACK 16 DHCPNAK 0
Ping the DHCP Server from Relay Router — Connectivity Check
! ── Verify R2 can reach R1's loopback (the helper target) ─ NetsTuts_R2#ping 1.1.1.1 source GigabitEthernet0/2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: Packet sent with a source address of 192.168.10.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/3 ms NetsTuts_R2#
source GigabitEthernet0/2 (192.168.10.1)
as the source simulates the exact path the relayed DHCP unicast will take —
confirming routing and ACLs permit this traffic before testing DHCP.
Verification Command Summary
| Command | What It Shows | Run On |
|---|---|---|
show running-config interface [int] |
Confirms ip helper-address is on the correct client-facing interface |
Relay router (R2, R3) |
show ip dhcp binding |
All active leases including relay clients — verify remote subnet addresses appear | DHCP server (R1) |
show ip dhcp pool |
Pool utilisation per subnet — confirm leases are being issued from each pool | DHCP server (R1) |
ping [helper-address] source [relay-int] |
Verifies routed connectivity from relay interface to DHCP server — prerequisite for relay | Relay router (R2, R3) |
debug ip dhcp server packet |
Live DORA trace — shows "through relay [IP]" confirming relay operation | DHCP server (R1) — disable after use |
show logging |
DHCP event log — relay events and any DHCP assignment failures | All routers |
8. Troubleshooting DHCP Relay Issues
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| Relay clients get APIPA — direct clients work | Hosts on remote subnets show 169.254.x.x but hosts on the server's local subnet work fine | ip helper-address missing or on wrong interface. Or the helper-address IP is unreachable from the relay router |
Verify: show running-config interface [LAN-int] — confirm helper is present and on the client-facing interface. Ping the helper-address from the relay interface: ping [helper] source [relay-int] |
| Relay clients get addresses from wrong pool | Hosts on 192.168.30.0/24 receive addresses in 192.168.10.x range instead | giaddr mismatch — the helper-address is configured on the wrong interface (not the one with the correct subnet IP), so the wrong giaddr is sent to the server | Check which interface has the helper — its IP address becomes the giaddr. The interface IP must match the pool's network statement on the server. Move the helper to the correct interface. |
| No DHCP binding appears on server for relay clients | show ip dhcp binding shows no entries for remote subnets despite relay being configured |
Routing issue — relayed DHCP unicast (UDP/67) cannot reach the server, or return path is missing. Also check for ACLs blocking UDP port 67/68 between relay and server. | Run debug ip dhcp server packet on R1 — if no Discovers appear, the relay packet is not arriving. Check routing with ping [R1-loopback] source [relay-int]. Review ACLs with show ip access-lists — see ACL Overview and Extended ACL Configuration for ACL troubleshooting. |
| DHCP works then breaks after network change | DHCP relay was working but stops after a routing change or interface failure | The helper-address pointed to a physical interface IP on R1 — that interface went down. Relayed unicasts now have no route to the old physical IP. | Change helper-address to point to R1's loopback interface instead of a physical IP. Loopbacks are always up as long as the router is running — making relay resilient to individual interface failures. |
| Both DHCP servers responding — clients get inconsistent config | Some hosts get correct DNS/gateway, others get wrong values — two helper-addresses configured | Two DHCP servers have overlapping pools or inconsistent pool parameters (different default-router or dns-server values) | Ensure both servers use non-overlapping address ranges and identical DHCP options (default-router, dns-server, domain-name). The client receives options from whichever server's ACK it accepts. |
| Voice phones fail to boot — Option 150 missing | IP phones receive an IP address but cannot download config — "No Service" on phone display | DHCP pool for the Voice VLAN is missing option 150 (TFTP server address for Cisco phones) |
Add option 150 ip [call-manager-IP] to the voice VLAN pool on R1. Phones use this to locate the TFTP server for firmware and config download. |
Key Points & Exam Tips
- Routers drop DHCP broadcasts by default —
ip helper-addressconverts the client's broadcast Discover into a unicast packet addressed to the configured DHCP server IP and forwards it across the routed network. ip helper-addressmust be configured on the client-facing interface — the interface where DHCP Discover broadcasts arrive. Configuring it on the uplink (toward the server) has no effect on client broadcasts.- The relay agent sets the giaddr (Gateway IP Address) field to its own IP on the client-facing interface. The DHCP server uses the giaddr to determine which pool to select — the pool whose
networkstatement contains the giaddr. - Using a loopback IP as the helper-address target is best practice — loopbacks never go down, making relay resilient to physical interface failures on the server router.
- Multiple
ip helper-addressentries on the same interface relay to multiple servers simultaneously — all servers receive every Discover. Use non-overlapping address ranges to avoid duplicate offers for the same address. - By default,
ip helper-addressforwards 8 UDP broadcast protocols including DHCP (67/68), TFTP (69), DNS (53), and NetBIOS (137/138). Restrict to DHCP only withno ip forward-protocol udp [port]for security. - The relay router needs a routed path to reach the DHCP server. If routing or ACLs block UDP port 67/68 between the relay router and server, DHCP relay silently fails.
- Verify relay connectivity with
ping [helper-address] source [relay-interface]before testing DHCP — this confirms the exact path the relayed unicast will use. debug ip dhcp server packeton the DHCP server shows "through relay [IP]" for relayed transactions — confirming the relay is working and identifying which relay agent forwarded the request.- On the CCNA exam: know why DHCP broadcasts don't cross routers, where to place
ip helper-address, what giaddr is used for, and that multiple helper-addresses provide DHCP server redundancy.