I am trying a configure a 2811 Cisco router on packet tracer to be a DHCP server for 3 hosts.
Here is the running config I have as of now:
Building configuration...
Current configuration : 657 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname r1
!
!
!
!
!
ip dhcp pool stackexchange
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.0
duplex auto
The configuration is as suggested by @Andrey Prokhorov but now I found no "lease" command.
I must be able to have the DHCP service working on all 3 host.
Best Answer
Lets assume you want to deliver IP addresses to your interface Gi0/0 (addr 192.168.0.1) network 192.168.0.0/24, also you have DNS server 192.168.0.5. Then you should define DHCP pool with options:
This will enable DHCP service for your 192.168.0.0/24 network with lease time for each address in 7 days.
Also, you can exclude IP addresses from distributed scope by entering command:
This will prevent issuance of addresses 192.168.0.1 thru 192.168.0.10. You can add many of that entries. Exclude records can consist of only one address:
You can find more about configuring DHCP server in Cisco IOS here - Configuring DHCP