Topology
Purpose
Learn how routers can be used as DHCP servers.
Walkthrough
- If you are using your home PC or laptop, set the network adapter to obtain the IP address automatically. You can also set this in Packet Tracer. Connect the PC to your router Ethernet port with a crossover cable.
- Add the IP address 172.16.1.1 255.255.0.0 to your router interface. Please see previous labs
if you can’t remember how to do this. Make sure you no shut it.
- Configure your DHCP pool. Then, configure a lease of 3 days, 3 hours, and 5 minutes for your address. Lastly, exclude all the addresses from 1 to 10 from being assigned to hosts. Presume that these are already in use for other servers or interfaces.
Router#conf t
Router(config)#ip dhcp pool 60days
Router(dhcp-config)#network 172.16.0.0 255.255.0.0
Router1(dhcp-config)#lease 3 3 5 ← command won’t work on Packet Tracer
Router1(dhcp-config)#exit
Router(config)#ip dhcp excluded-address 172.16.1.1 172.16.1.10
Router(config)#
- Issue an ipconfig /all command to check whether an IP address has been assigned to your PC. You may need to issue an ipconfig /renew command if an old IP address is still in use.
PC>ipconfig /all
Physical Address…………….: 0001.C7DD.CB19
IP Address………………….: 172.16.0.1
Subnet Mask…………………: 255.255.0.0
Default Gateway……………..: 0.0.0.0
DNS Servers…………………: 0.0.0.0
- If you wish, you can go back into the DHCP pool and add a default gateway and a DNS server address, which will also be set on the host PC.
Router(config)#ip dhcp pool 60days
Router(dhcp-config)#default-router 172.16.1.2
Router(dhcp-config)#dns-server 172.16.1.3
PC>ipconfig /renew
IP Address………………….: 172.16.0.1
Subnet Mask…………………: 255.255.0.0
Default Gateway……………..: 172.16.1.2
DNS Server………………….: 172.16.1.3
