DHCP Server Configuration Guide
Video Coming Soon....
Here is a step-by-step guide for configuring a DHCP server on a Cisco router in Packet Tracer, connecting the router to a switch and one end device (PC) that will receive its IP address from the router via DHCP.
Scenario Overview
- Router: Acts as a DHCP server.
- Switch: Connects the router and the end device (PC).
- End Device: A PC that will automatically receive an IP address from the router.
IP Address Scheme
- Network: 192.168.1.0/24
- Router Interface IP: 192.168.1.1
- DHCP Range: 192.168.1.2 to 192.168.1.254
Step 1: Add Devices to Packet Tracer
- Add the Router, Switch, and PC:
Drag and drop a Cisco Router (e.g., 2911), Cisco Switch (e.g., 2960), and one PC from the device list.
- Connect the Devices:
Connect Router GigabitEthernet0/0 to Switch FastEthernet0/1.
Connect PC FastEthernet0 to Switch FastEthernet0/2.
Step 2: Configure the Router as a DHCP Server
- Enter the Router CLI:
Click on the router, go to the CLI tab.
- Enter Privileged EXEC Mode:
enable - Enter Global Configuration Mode:
configure terminal - Configure the Router Interface (GigabitEthernet0/0):
Assign the IP address to the router's interface connected to the switch:
interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 no shutdown end - Create the DHCP Pool:
Define the DHCP pool and IP address range:
ip dhcp pool MY_POOL network 192.168.1.0 255.255.255.0 default-router 192.168.1.1 dns-server 8.8.8.8 end - Exclude the Router’s IP Address from the DHCP Pool:
Prevent the DHCP server from assigning the router's IP address:
ip dhcp excluded-address 192.168.1.1 end - Save the Configuration:
write memory
Step 3: Configure the Switch
- Enter the Switch CLI:
Click the switch and go to the CLI tab.
- Enter Privileged EXEC Mode:
enable - Enter Global Configuration Mode:
configure terminal - Configure the Switch Ports:
Make sure that the switch ports connected to the router and the PC are in access mode:
interface FastEthernet0/1 switchport mode access endinterface FastEthernet0/2 switchport mode access end - Save the Switch Configuration:
write memory
Step 4: Configure the End Device (PC)
- Click on the PC, go to the Desktop tab.
- Click IP Configuration.
- Set the PC to DHCP:
Select the option for DHCP to automatically obtain an IP address from the router.
Step 5: Verify the Configuration
- Check if the PC received an IP Address:
The PC should receive an IP address in the range
192.168.1.2to192.168.1.254from the router. You can verify this by checking the IP Configuration on the PC. - Verify DHCP Binding on the Router:
On the router, use the following command to check the DHCP bindings (i.e., the IP addresses assigned to clients):
show ip dhcp binding - Ping the Router from the PC:
From the PC, go to the Command Prompt and try to ping the router’s IP address (
192.168.1.1):ping 192.168.1.1If the ping is successful, the DHCP configuration is working correctly.
Step 6: Save the Router’s Configuration
- Ensure that the router's configuration is saved to avoid losing the settings after a reboot:
write memory
Conclusion
You have successfully configured a Cisco router as a DHCP server, and connected it to a switch and an end device (PC). The PC will now receive its IP configuration automatically via DHCP. You can expand this setup by adding more end devices, and they will also receive IP addresses from the router.