{"id":57,"date":"2013-03-18T21:58:46","date_gmt":"2013-03-18T21:58:46","guid":{"rendered":"https:\/\/learncisco.net\/index.php\/router-as-a-dhcp-server\/"},"modified":"2023-01-11T08:52:25","modified_gmt":"2023-01-11T01:52:25","slug":"router-as-a-dhcp-server","status":"publish","type":"page","link":"https:\/\/www.learncisco.net\/courses\/icnd-1\/lan-connections\/router-as-a-dhcp-server.html","title":{"rendered":"Configuring DHCP on a Cisco Router – Step-by-Step"},"content":{"rendered":"

In this lesson, we are going to describe its features and illustrate how a Cisco router can be used as a DHCP server. Using the Security Device Manager, you will get the chance to configure the protocol, tune its components, and monitor the operations of the protocol.<\/p>\n

Understanding DHCP Process<\/h2>\n

The Dynamic Host Configuration Protocol, also known as DHCP, is a client server application that automates the assignment of IP components to client machines. In that sense, client machines will go into the network without parameters and will request those parameters from a DHCP server.<\/p>\n

The parameter information contained on the DHCP server ranges from the required IP address and default gateway and subnet mask to DNS servers, NetBIOS name servers, and other specialized parameters like TFTP servers and SIP servers, and the client belongs to the IP telephony world.<\/span><\/p>\n

The specification on the RFC even includes VLAN IDs and quality of service parameters. The protocol can be based on a lease model in which machines rent their parameters and they can be reused by other machines if the original device is no longer in the network. Parameters are leased based on a certain time, which can be defined and can be different per IP address scope or per group of machines. You could also define manual allocations and fix parameters for a particular machine.\u00a0Let us describe the DHCP process in more details.<\/p>\n

\"DHCP<\/p>\n

In this figure, we have a client requesting IP addresses from a server. It looks like three clients and two servers just to illustrate the different stages of the process, but we are talking about the same client and the same server at this point. The first thing to say here is that each one of these calls is a local broadcast in terms of IP information. This is because the clients do not know the subnet that they belong to when they start because they obviously don’t have an IP address and the servers don’t know where to reply to, because the clients don’t have an IP address yet. So all of these calls will use a local broadcast and a destination IP address on the packet.<\/span><\/p>\n

Clients will broadcast a request message, a discover message to servers, more than one server could see that message, and so that’s why you need the four stages here. The servers will reply with an offer message, again this is still a local protest because the client does not have a local address. It is a local broadcast at layer 3 but during the discover message, the server knows the MAC address of the client, and that’s why even though at layer 3 it is a broadcast in the destination, it will be unicast later too because the server will send information straight to the MAC address of the client. So overall, that’s how the process works.<\/p>\n

After the discover message and the offer message, then more than one server could reply with an offer message, so the client has to make a decision as to which address or which information to take. So it will reply with a request message, deciding which server will provide the information. All along, offer messages include IP addresses but also other options like default gateways, leased time, expiration time, etc. Finally, the selected server will say, “Okay. I acknowledge your request. Here is the information. Now we start a lease time, and you are the owner of the address temporarily.” And so that’s a DHCP acknowledgment message. The client will see it and will start operating.<\/p>\n

The important thing about these being local protests is that if you place a router in the middle of the conversation, then routers will not forward local broadcasts. So you will have to configure that router so that requests and replies can travel back and forth across that router. If you are going to configure a Cisco router as a DHCP server, then he would have to support DHCP and perform all of these calls.<\/p>\n

DHCP Address Allocation<\/h2>\n

Providing an IP address to a client is the most important task performed by a host configuration protocol. Together with that we are getting information for the network segment, default gateway, DNS servers, domain name, TFTP servers (important in the IP telephony) and so on. To provide flexibility for configuring addresses on different types of clients, the DHCP standard includes three different address allocation mechanisms:<\/p>\n