Configure Cisco router as DHCP server

Dynamic Host Configuration Protocol (DHCP) is a program level protocol that distributes various network configuration parameters to devices on a TCP / IP network. - IP addresses, subnet masks, standard gateways, DNS servers, etc. DHCP uses a client server architecture. A DHCP client is configured to request network parameters from a DHCP server on the network. A DHCP server is configured with a pool of available IP addresses and assigns an address to the DHCP client.




A Cisco router can be configured as a DHCP server. Here are the steps:

Exclude IP addresses from DHCP task using ip dhcp-excluded address FIRST_IP LAST_IP
Create a new DHCP pool using the ip dhcp pool NAME command.
Define a subnet used to assign IP addresses to hosts with the SUBNET_MASK network command.
Define the default gateway with the IP command for the default router.
Define the DNS server with the DNS server's IP address command.
(Optional) Define the DNS domain name with the IP Domain Name NAME command.
(Optional) Define the lease term with the DAYS HOURS MINUTES rental agreement. If you do not specify this argument, the default lease term of 24 hours is used.


Here's an example configuration:

Floor1 (config) #ip dhcp excluded address 192.168.0.1 192.168.0.50
Floor1 (config) #ip dhcp pool Floor1DHCP
Floor1 (dhcp-config) #network 192.168.0.0 255.255.255.0
Floor1 (dhcp-config) # default router 192.168.0.1
Floor1 (dhcp-config) # dns server 192.168.0.1

In the example above, you can see that I have configured the DHCP server with the following parameters:

The IP addresses in the range 192.168.0.1 - 192.168.0.50 are not assigned hosts
The DHCP pool was created and called Floor1DHCP
The IP addresses assigned to the hosts come from the 192.168.0.0/24 range
The default gateway IP address is 192.168.0.1
The DNS server's IP address is 192.168.0.1



To see information about the currently rented addresses, you can use the ip dhcp binding view command:

Floor1 # show ip dhcp binding
IP address Client ID / rental type
Hardware address address
192.168.0.51 0060.5C2B.3DCC - Automatic
In the above, you can see that there is a single DHCP client that has been assigned the IP address 192.168.0.51. Since we omitted the IP addresses from the range 192.168.0.1 - 192.168.0.50, the unit received the first available address - 192.168.0.51.

To see information about the configured DHCP pools, you can use the ip dhcp pool view command:

Floor1 # view ip dhcp pool
Pool Floor1DHCP:
Utility mark (high / low): 100/0
Subnet size (first / next): 0/0
Total addresses: 254
Leased addresses: 1
Excluded addresses: 1
Waiting event: none

A subnet is currently in the pool

Current index IP address range Leased / Excluded / Total
192.168.0.1 192.168.0.1 - 192.168.0.254 1/1/254

This command displays some important information about the DHCP pools configured on the device - the pool name, the total number of IP addresses, the number of leased and excluded addresses, the IP range of the subnet, and so on.
Post a Comment (0)
Previous Post Next Post

Advertisment