🌐 DHCP (Dynamic Host Configuration Protocol)

 

🌐 DHCP (Dynamic Host Configuration Protocol)


🧠 Top 5 Key Points

  1. Automatic IP Assignment:
    DHCP automatically assigns IP addresses, subnet masks, gateways, and DNS servers to clients, reducing manual configuration.

  2. Centralized Management:
    All IP configuration settings are managed by a DHCP server, simplifying administration in large networks.

  3. Leased IP Addresses:
    Clients receive IPs for a limited lease period — after which they can renew or release them.

  4. Uses UDP Ports:

    • UDP Port 67: Server side

    • UDP Port 68: Client side

  5. Message Types:
    Key DHCP message types: Discover → Offer → Request → Acknowledge (DORA).

    Client sends broadcast 255.255.255.255 to discover Server
    Server offers  192.168.1.2 to Client 
    Client sends request broadcast 255.255.255.255 to Server
    Server acknowledges 192.168.1.2 to Client..


⚙️ Technical Summary

FeatureDescription
OSI LayerApplication Layer
Protocol TypeUDP
Default Port67 (Server), 68 (Client)
PurposeIP address auto-assignment
ProcessDORA (Discover, Offer, Request, Acknowledge)

🧰 Packet Tracer Lab — DHCP Configuration


🎯 Goal:

Set up a Router as DHCP Server to automatically assign IPs to clients in a LAN.


πŸ–₯️ Network Topology

[PC1] [PC2] | | | | +----[Switch]----[Router]

IP Plan

DeviceInterfaceIP AddressPurpose
Router (R1)G0/0192.168.10.1Default Gateway & DHCP Server
PC1DHCPAssigned automatically
PC2DHCPAssigned automatically

πŸͺœ Step-by-Step Configuration

πŸ”Ή 1. Configure Router Interface

enable conf t interface g0/0 ip address 192.168.10.1 255.255.255.0 no shutdown exit

πŸ”Ή 2. Configure DHCP Pool

ip dhcp pool OFFICE network 192.168.10.0 255.255.255.0 default-router 192.168.10.1 dns-server 8.8.8.8 lease 1

πŸ”Ή 3. Exclude Router IP Address

(Prevents the DHCP server from assigning the router’s own IP.)

ip dhcp excluded-address 192.168.10.1 192.168.10.5

πŸ”Ή 4. Verify DHCP Configuration

show ip dhcp binding show ip dhcp pool

πŸ”Ή 5. Configure PCs

In Packet Tracer:

  1. Click PC → Desktop → IP Configuration

  2. Select DHCP

  3. PC automatically gets an IP address (e.g., 192.168.10.6, 192.168.10.7).


πŸ”Ή 6. Test Connectivity

  • On PC1, open Command Prompt → ping 192.168.10.1
    ✅ Should succeed (gateway reachable).

  • On PC1, ping PC2’s IP (both dynamically assigned).
    ✅ Should also succeed.


πŸ’‘ Troubleshooting Tips

Renew DHCP Address

Release:

ipconfig /release

Renew:

ipconfig /renew

Useful when:

  • Wrong IP assigned
  • DHCP issues

IssueFix
PCs not receiving IPCheck if DHCP service is enabled on router
Same IP for all PCsEnsure enough IPs in the pool
No pingCheck cabling and interfaces (use no shutdown)

🧠 Learning Summary

ConceptDescription
DHCP RoleAssign IP addresses automatically
DHCP MessagesDORA (Discover, Offer, Request, Acknowledge)
Default GatewayAssigned via DHCP
ExclusionPrevents assigning reserved IPs
Verificationshow ip dhcp binding

Comments

Popular posts from this blog

πŸ–§ VLAN (Virtual Local Area Network)

🌐 NAT (Network Address Translation)

πŸ›°️ OSPF (Open Shortest Path First)