{"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
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 <\/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 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 DHCP is a critical service and your Cisco IOS router can provide full support to be a DHCP server. Many of the parameters and options defined in the RFC are present and available in IOS routers. This is important because the router will be there in the network. It is a network element that can start providing this type of server like services without the need to install and deploy a full blown server. Smaller deployments, branch offices, and home offices will benefit from this function at the network element. The service is software based and it can be fully configured in your router for multiple interfaces, multiple DHCP scopes, also supporting static assignments.<\/p>\n Here is a configuration example of configuring a DHCP pool in a Cisco Router:<\/p>\n RouterX(config)#ip dhcp pool Marketing Commands are available in the command-line interface to aid in monitoring and troubleshooting.<\/p>\n Router#sh ip dhcp conflict The last command shows IP DHCP conflict. It will help you identify IP address conflicts found by the DHCP servers and clients. An address conflict occurs when the server is trying to assign an IP address and either the server or the client find that there is other devices in the network with the same IP address. Servers will ping the IP addresses on the lease before they assign them to detect conflicts and clients use gratuitous ARPs to detect all the clients with the same IP. If an address conflict is detected and the address is removed from the pool, the address is not assigned until an administrator resolves the conflict. These built-in capabilities make the IOS DHCP server a powerful tool.<\/p>\n","protected":false},"excerpt":{"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. Understanding DHCP Process The Dynamic Host Configuration Protocol, … Read more<\/a>","protected":false},"author":5,"featured_media":0,"parent":87,"menu_order":52,"comment_status":"closed","ping_status":"closed","template":"cisco-page.php","meta":{"_acf_changed":false,"footnotes":""},"acf":[],"yoast_head":"\nDHCP Address Allocation<\/h2>\n
\n
Using a Router as a DHCP Server<\/h2>\n
Commands and Configurations<\/h2>\n
\nRouterX(dhcp-config)#network 10.123.1.0 255.255.255.0
\nRouterX(dhcp-config)#default-router 10.123.1.1
\nRouterX(dhcp-config)#domain-name learncisco.net
\nRouterX(dhcp-config)#dns-server 172.16.4.10 172.16.4.12<\/p><\/blockquote>\n\n
\nIP address\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Detection method\u00a0\u00a0 Detection time\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 VRF
\n192.168.200.58\u00a0\u00a0\u00a0 Gratuitous ARP\u00a0\u00a0\u00a0\u00a0 May 28 2012 03:31 PM
\n192.168.200.59\u00a0\u00a0\u00a0 Gratuitous ARP\u00a0\u00a0\u00a0\u00a0 May 28 2012 03:31 PM
\n192.168.200.64\u00a0\u00a0\u00a0 Gratuitous ARP\u00a0\u00a0\u00a0\u00a0 May 28 2012 03:39 PM<\/p><\/blockquote>\n