🌐 DHCP (Dynamic Host Configuration Protocol)
DHCP is a network protocol used to automatically assign IP configuration to clients in a network.
This is used in:
- Offices
- Companies
- Schools
- WiFi routers
- ISPs
- Enterprise networks
Almost every modern network uses DHCP.
🎯 What DHCP Does
Instead of manually assigning IP addresses to every PC:
❌ Manual:
PC1 = 192.168.1.10 PC2 = 192.168.1.11 PC3 = 192.168.1.12
✅ DHCP automatically gives:
- IP Address
- Subnet Mask
- Default Gateway
- DNS Server
🔥 Real-Life Example
When you connect:
Mobile to WiFi
Laptop to office LAN
👉 Router automatically gives IP
That is DHCP.
🎯 What You Will Learn
- ✔ Automatic IP allocation
- ✔ DHCP pool creation
- ✔ Default gateway assignment
- ✔ DNS assignment
- ✔ Lease process
- ✔ Enterprise networking basics
🧪 Practical Topology
In Cisco Packet Tracer create:
PC0 ----\ PC1 ----- Switch ---- Router PC2 ----/
🌐 IP Plan
🔌 Wiring
PCs → Switch
Use:
Copper Straight-Through
Switch → Router
Use:
Copper Straight-Through
⚙️ Step 1: Configure Router Interface
On router:
enable configure terminal interface g0/0 ip address 192.168.1.1 255.255.255.0 no shutdown
🔥 Step 2: Configure DHCP Service
ip dhcp pool OFFICE
👉 Creates DHCP pool named OFFICE
Configure Network
network 192.168.1.0 255.255.255.0
Configure Default Gateway
default-router 192.168.1.1
Configure DNS
dns-server 8.8.8.8
🔥 Full DHCP Configuration
enable configure terminal interface g0/0 ip address 192.168.1.1 255.255.255.0 no shutdown ip dhcp pool OFFICE network 192.168.1.0 255.255.255.0 default-router 192.168.1.1 dns-server 8.8.8.8
🔥 Step 3: Exclude Router IP
VERY IMPORTANT
ip dhcp excluded-address 192.168.1.1
🧠 Why?
👉 Prevents DHCP from assigning router IP to PCs.
🔥 Step 4: Configure PCs
On every PC:
Desktop → IP Configuration
Select:
DHCP
🎯 Result
PC automatically gets:
🧪 Step 5: Verify
From PC:
ipconfig
You’ll see DHCP-assigned IP.
🧪 Step 6: Test Connectivity
ping 192.168.1.1
✔ Success
🔍 DHCP Process (VERY IMPORTANT)
DORA Process
🧠 How It Works
- 1️⃣ PC broadcasts DHCP Discover
- 2️⃣ Router replies DHCP Offer
- 3️⃣ PC sends Request
- 4️⃣ Router sends Acknowledgement
✔ IP assigned
🔥 Verification Commands
On router:
show ip dhcp binding
👉 Shows assigned IPs
show ip dhcp pool
👉 Shows DHCP pool details
🧠 Important Interview Questions
❓ What port does DHCP use?
UDP 67 & 68
❓ What is APIPA?
If DHCP fails:
169.254.x.x
❓ Why exclude addresses?
Prevent important IP assignment conflicts.
❓ What is lease time?
Duration client can use IP.
🔥 Common Mistakes
🎯 What You Learned
- ✔ Automatic IP assignment
- ✔ DHCP pool
- ✔ DORA process
- ✔ Enterprise IP management
- ✔ Router as DHCP server










0 comments:
Post a Comment
For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.