Here’s a basic example of how to configure a DHCP server on a Cisco router. This configuration will set up a DHCP pool, specify the network, default gateway, and DNS server, and exclude certain addresses from being assigned.
1) Enter Global Configuration Mode:
Router> enable
Router# configure terminal
2) Exclude Addresses:
Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.10
3) Create a DHCP Pool:
Router(config)# ip dhcp pool MY_POOL
4) Specify the Network and Subnet Mask:
Router(dhcp-config)# network 192.168.1.0 255.255.255.0
5) Specify the Default Gateway:
Router(dhcp-config)# default-router 192.168.1.1
6) Specify the DNS Server:
Router(dhcp-config)# dns-server 8.8.8.8
7) Exit Configuration Mode and Save Config:
Router(dhcp-config)# exit
Router(config)# exit
Router# write memory
This configuration will set up a DHCP server on your Cisco router that assigns IP addresses in the range 192.168.1.11 to 192.168.1.254, with 192.168.1.1 as the default gateway and 8.8.8.8 as the DNS server.