You are configuring a Cisco router as a DHCP server to dynamically assign IP addresses to client devices on a local network.
1. Understanding DHCP
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, default gateways, and other parameters to network devices. A Cisco router can function as a DHCP server, providing these settings to clients.
2. Practical Scenario
You are setting up a small office network.
The router will act as a DHCP server.
The local network uses the 192.168.1.0/24 subnet.
The router's interface (FastEthernet0/0) will be the gateway 192.168.1.1.
The DHCP server should assign addresses from 192.168.1.100 to 192.168.1.200.
Some devices (like a printer) will need static IP reservations.
3. Network Topology
4. Configuration Steps
Step 1: Enter Global Configuration Mode
Connect to the router via CLI(Console, SSH, or Telnet), then enter global configuration mode:
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
Step 2: Exclude Reserved IP Addresses
Reserve specific IP addresses that should not be assigned by DHCP (e.g., for the router, printers, and servers):
PC1> ip dhcp
DORA IP 192.168.1.11/24 GW 192.168.1.1
PC1> show ip
NAME : PC1[1]
IP/MASK : 192.168.1.11/24
GATEWAY : 192.168.1.1
DNS : 8.8.8.8
DHCP SERVER : 192.168.1.1
DHCP LEASE : 86395, 86400/43200/75600
MAC : 00:50:79:66:68:00
LPORT : 20008
RHOST:PORT : 127.0.0.1:20009
MTU : 1500
PC1>
Step 10: Printer (Static IP)
Manually set IP: 192.168.1.2, Gateway: 192.168.1.1.
Ensure it doesn’t request DHCP.
PC2> ip 192.168.1.2/24 192.168.1.1
Checking for duplicate address...
PC2 : 192.168.1.2 255.255.255.0 gateway 192.168.1.1
PC2> show ip
NAME : PC2[1]
IP/MASK : 192.168.1.2/24
GATEWAY : 192.168.1.1
DNS :
MAC : 00:50:79:66:68:01
LPORT : 20010
RHOST:PORT : 127.0.0.1:20011
MTU : 1500
PC2>
5. Verifying DHCP Configuration
1. Check the DHCP Configuration
R1#show ip dhcp pool
Pool OFFICE_NETWORK :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 0
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
192.168.1.1 192.168.1.1 - 192.168.1.254 0
R1#
This shows the active DHCP pool and available IP addresses.
2. View DHCP Bindings (Leased IPs)
R1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
192.168.1.11 0100.5079.6668.00 Mar 23 2025 05:54 AM Automatic
R1#
This displays assigned IP addresses and MAC addresses.
7. Troubleshooting Commands
Check if the DHCP service is running:
R1#show running-config | inclu
R1#show running-config | include dhcp
ip dhcp excluded-address 192.168.1.1 192.168.1.10
ip dhcp pool OFFICE_NETWORK
R1#
Debug DHCP process:
R1#debug ip dhcp server events
DHCP server event debugging is on
Keywords
DHCP, Cisco Router, IP Address, Subnet Mask, Default Gateway, DNS Server, Lease Time, Excluded Address, DHCP Pool, Network Configuration, IP Binding, DHCP Reservation, Dynamic IP, Static IP, Show Commands, Debugging, Packet Tracer, Network Automation, Router Configuration, CCNA, سیسکو