DHCP stand for Dynamic Host Configuration Protocol, It is a network protocol used to automatcally assign IP addressess, It uses DORA process for assigning IP address.
The DORA process works as follows: 1. Discover: The client device sends out a DHCPDISCOVER broadcast message to find a DHCP server.2. Offer: The DHCP server receives the DHCPDISCOVER message and sends back a DHCPOFFER message with a list of available IP addresses.
3. Request: The client device selects an IP address from the list and sends back a DHCPREQUEST message to the DHCP server.
4. Acknowledge: The DHCP server confirms the DHCPREQUEST message by sending back a DHCPACK message. Once the DORA process is complete, the client device has an IP address and other network configuration information, such as the subnet mask, default gateway, and DNS server address.
The DORA process is repeated whenever a client device boots up or when its IP address lease expires.
Here are some of the benefits of using the DORA process:
- Automatic IP address assignment: The DORA process automatically assigns IP addresses to devices on the network, which eliminates the need for administrators to manually configure IP addresses on each device.
- Centralized IP address management: The DORA process centralizes the management of IP addresses, which makes it easier to track and manage IP addresses on the network. This can help to prevent IP address conflicts and other network problems.
- Dynamic IP address assignment: The DORA process can dynamically assign IP addresses to devices on the network, which means that IP addresses can be reused when devices are no longer connected to the network. This can help to conserve IP addresses and make it easier to manage the network.
Step2:Enter the global configuration mode by typing configure terminal.
Step3:Configure a DHCP address pool by typing ip dhcp pool pool_name.
Step4:Define the IP excluded list(reserve IP Address) by typing ip dhcp excluded-address Address Range
Step5:Define the subnet that will be used to assign IP addresses to hosts by typing network Address subnet_mask
Step6:Define the default router by typing default-router gateway IP
Step7:Define the DNS server with the dns-server ip_address command.
Step8: Define the lease with the lease M H sec command
Step9:Exit the DHCP pool configuration mode by typing end.
Step10:Save the configuration by typing write memory.
Here is an example of a DHCP server configuration for a Cisco switch:
SW01#configure terminal SW01(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.50 SW01(config)#ip dhcp pool DHCPPOOL SW01(dhcp-config)#network 192.168.10.0 255.255.255.0 SW01(dhcp-config)#default-router 192.168.10.1 SW01(dhcp-config)#dns-server 8.8.8.8 SW01(dhcp-config)#lease 30 23 59 SW01(dhcp-config)#end
show ip dhcp binding
SW01#show ip dhcp binding IP address Client-ID/ Lease expiration Type Hardware address 192.168.10.51 00D0.5812.EDDB -- Automatic 192.168.10.52 0002.4A65.8B87 -- Automatic 192.168.10.53 000B.BE29.D786 -- Automatic SW01#
As you can see, the DHCP server has issued IP addresses to two clients, PC1, PC2 and PC3. The MAC addresses of these clients are also listed in the output.