How-TO: Configure DHCP on a CISCO router

This post is about configuring a CISCO router to act as a DHCP server in your network.

Task1: Configure R1 to act as a DHCP server and provide all network information to hosts in the LAN dynamically. (R1 and R2 are directly connected via Ethernet)

Server Configuration (R1)

!-- enable dhcp server (default)

service dhcp

! -- defining DHCP pool with all network information

ip dhcp pool OFFICE
default-router !-- gateway address
dns-server !-- DNS servers
netbios-name-server !-- WINS servers
lease 2 !-- lease time

!-- defining static binding to R2 using its client-id

ip dhcp pool STATIC
client-identifier 01cc.010d.f000.00

!-- exclude server and static addresses from the dynamic pool

ip dhcp excluded-address
ip dhcp excluded-address
ip dhcp excluded-address
p dhcp excluded-address

Client Configuration:

interface FastEthernet0/0
ip address dhcp client-id FastEthernet0/0

Troubleshooting and verfication:

IP address is assigned dynamically to R2

!-- R2 f0/0 address is assigned via DHCP

R2(config-if)#do sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 YES DHCP up up

!-- R1 bindings has R2 as a static entry

R1#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name 01cc.010d.f000.00 Infinite Manual

R2 gets its domain-name dynamically from R1

R2#sh ip domain

R2 sets R1 as a default gateway using a floating static route

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static routeGateway of last resort is to network

C is directly connected, FastEthernet0/0 is subnetted, 1 subnets
C is directly connected, Loopback0
S* [254/0] via

R2 learns Primary and secondary DNS servers from R1

R2#ping xyz.comTranslating ""...domain server ( (
% Unrecognized host or address, or protocol not running.

for more information on how to configure DHCP features consult the following link CISCO IOS DHCP Server

Check Also

Best AI tools list