{"id":2333,"date":"2019-08-13T02:13:09","date_gmt":"2019-08-13T02:13:09","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=2333"},"modified":"2020-07-20T10:49:48","modified_gmt":"2020-07-20T10:49:48","slug":"section-22-dhcp-dynamic-host-configuration-protocol","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=2333","title":{"rendered":"Section 22: DHCP Dynamic Host Configuration Protocol"},"content":{"rendered":"<p><a href=\"http:\/\/wiki.thomasandsofia.com\/?p=2306\">&lt; Section 21<\/a> | <a href=\"\/course-introduction\/\">Home<\/a> | <a href=\"http:\/\/wiki.thomasandsofia.com\/?p=2369\">Section 23 &gt;<\/a><\/p>\n<p>69% Complete<\/p>\n<h1>138. Introduction<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657516#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657516#content<\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>139. DHCP Dynamic Host Configuration Protocol<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657522#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657522#content<\/a><\/p>\n<ul>\n<li>DHCP is a client\/server protocol that automatically provides a host with its IP address and other related configuration information such as the subnet mask, default gateway and DNS server.<\/li>\n<li>DHCP clients obtain their IP configuration information from a DHCP server, rather than being manually configured.<\/li>\n<\/ul>\n<h2>How DHCP Works<\/h2>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-24.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2343\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-24.png\" alt=\"\" width=\"529\" height=\"333\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-24.png 529w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-24-300x189.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-24-150x94.png 150w\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" \/><\/a><\/p>\n<ul>\n<li>Client sends a DHCP discover message using broadcast traffic<\/li>\n<li>Server replies with a DHCP Offer (IP, Subnet, DNS, etc)<\/li>\n<li>Client replies with a request to keep these settings<\/li>\n<li>Server responds with an acknowledgement saying the settings have been recorded for that MAC address.<\/li>\n<\/ul>\n<h2>DHCP Benefits &#8211; Reduced Network Admin<\/h2>\n<ul>\n<li>Centralized and automated IP configuration, rather than manually assigning and managing IP address for every host.<\/li>\n<li>DHCP minimizes configuration errors caused by manual IP address configuration\n<ul>\n<li>Typos<\/li>\n<li>Address conflicts caused by the assignment of an IP address to more than one computer at a time.<\/li>\n<\/ul>\n<\/li>\n<li>Can assign additional IP configuration values by means of DHCP options.\n<ul>\n<li>IP Phones need to know their server&#8217;s address.<\/li>\n<\/ul>\n<\/li>\n<li>Efficient handling of clients that must be updated frequently, such as laptops that move to different locations on a wireless network.\n<ul>\n<li>IP addresses are automatically updated.<\/li>\n<\/ul>\n<\/li>\n<li>The forwarding of initial DHCP messages by using a DHCP relay agent, which eliminates the need for a DHCP server on every subnet.<\/li>\n<\/ul>\n<h2>Recommended DHCP Clients<\/h2>\n<ul>\n<li>Desktop PCs and Laptops\n<ul>\n<li>There are generally many of these on a network. &#8211; Saves a lot of admin time.<\/li>\n<li>They do not accept incoming connections so it doesn&#8217;t matter if their IP address changes.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Non-Recommended DHCP Clients<\/h2>\n<ul>\n<li>Servers and Network infrastructure Devices\n<ul>\n<li>Mission critical devices which do not move and are required for the network to function<\/li>\n<li>Their IP address should be manually configured so they do not change and are not dependent on DHCP\n<ul>\n<li>These do require incoming connections<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>140. Cisco DHCP Server<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657534#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657534#overview<\/a><\/p>\n<h2>DHCP Server Router Configuration<\/h2>\n<p>Usually used for small branch offices<br \/>\n<a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2344\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25.png\" alt=\"\" width=\"492\" height=\"283\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25.png 492w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25-300x173.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25-150x86.png 150w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/p>\n<p><strong>Exclude static address ranges<\/strong><\/p>\n<ul>\n<li>It is best to reserve some IP addresses for networking and other static IP devices. This should be done first before clients are accidentally assigned IPs in this range.<\/li>\n<\/ul>\n<pre>R1(config)#ip dhcp excluded-address 10.10.10.1 10.10.10.10<\/pre>\n<p><strong>Configure DHCP<\/strong><\/p>\n<ul>\n<li>You can name the DCHP pool anything you like.<\/li>\n<\/ul>\n<pre>R1(config)#ip dhcp pool 10.10.10.0_Clients\r\nR1(config-dhcp)#network 10.10.10.0 255.255.255.0\r\nR1(config)#default-router 10.10.10.1\r\nR1(config)#dns-server 10.10.20.10<\/pre>\n<p><strong>Verify the DHCP Pool was correctly created<\/strong><\/p>\n<pre>show ip dhcp pool<\/pre>\n<p>View which IPs have been auto-assigned using DHCP<\/p>\n<pre>show ip dhcp binding<\/pre>\n<h2>Lab Configuration<\/h2>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2344\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25.png\" alt=\"\" width=\"492\" height=\"283\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25.png 492w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25-300x173.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/a1-25-150x86.png 150w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/p>\n<p><strong>Exclude static address first<\/strong><\/p>\n<pre>R1(config)#ip dhcp excluded-address 10.10.10.1 10.10.10.10<\/pre>\n<p><strong>Create the DHCP Pool<\/strong><\/p>\n<pre>R1(config)#ip dhcp pool Demo\r\nR1(config-dhcp)#network 10.10.10.0 255.255.255.0\r\nR1(config)#default-router 10.10.10.1\r\nR1(config)#dns-server 10.10.20.10<\/pre>\n<p><strong>Verify it is working<\/strong><\/p>\n<pre>show ip dhcp pool<\/pre>\n<p><strong>View which IPs have been auto-assigned using DHCP&lt;\/h3<\/strong><\/p>\n<pre>show ip dhcp binding<\/pre>\n<h1 style=\"color: #ff0000;\"><span style=\"color: #000000;\">141. External DHCP Server<\/span><\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657538#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657538#overview<\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/External-DHCP-and-DNS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2357\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/External-DHCP-and-DNS.png\" alt=\"\" width=\"567\" height=\"232\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/External-DHCP-and-DNS.png 567w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/External-DHCP-and-DNS-300x123.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/External-DHCP-and-DNS-150x61.png 150w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n<h2>Description<\/h2>\n<ul>\n<li>Pi2b sends a DHCP broadcast request for an IP address<\/li>\n<li>SW1 sends that request out F0\/1 and F\/03<\/li>\n<li>R1 and Pi3b are NOT DHCP servers, so they drop the packets<\/li>\n<li>Since Routers do not forward broadcast traffic&#8230;\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>HOW DOES THE REQUEST REACH THE DHCP SERVER?<\/strong><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Solution<\/h3>\n<pre>R1(config)#int f0\/0\r\nR1(config-if)#ip helper-address 10.10.20.10<\/pre>\n<h1 style=\"color: #ff0000;\"><span style=\"color: #000000;\">142. Cisco DHCP Client<\/span><\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657546#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657546#overview<\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/Router-DHCP-Client.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2362\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/Router-DHCP-Client.png\" alt=\"\" width=\"390\" height=\"335\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/Router-DHCP-Client.png 390w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/Router-DHCP-Client-300x258.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/Router-DHCP-Client-150x129.png 150w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><\/a><\/p>\n<ul>\n<li>Cisco routers are typically manually configured with Static IP address<\/li>\n<li>An exception is where an office is connected to the Internet and they have not purchased a static Public IP.\n<ul>\n<li>They would not have a need for any incoming connections<\/li>\n<\/ul>\n<\/li>\n<li>The office would still require a public IP to allow internal hosts access to the Internet via NAT.<\/li>\n<li>In this case, the router will receive the public IP from the service provider via DHCP.<\/li>\n<\/ul>\n<pre>R1(config)#int f0\/0\r\nR1(config-if)#ip address dhcp\r\nR1(config-if)#no shutdown<\/pre>\n<h3>To view information regarding any DHCP leases<\/h3>\n<pre>show dhcp lease<\/pre>\n<p>&nbsp;<\/p>\n<h1>143. DHCP Lab Configuration<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657550#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657550#overview<\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2363\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration.png\" alt=\"\" width=\"1112\" height=\"479\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration.png 1112w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration-300x129.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration-768x331.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration-1024x441.png 1024w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration-150x65.png 150w\" sizes=\"auto, (max-width: 1112px) 100vw, 1112px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration-Lab-Exercise.pdf\">24-1 DHCP Configuration Lab Exercise<\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/08\/24-1-DHCP-Configuration-Answer-Key.pdf\">24-1 DHCP Configuration Answer Key<\/a><\/p>\n<p><strong>1. You have not acquired a static public IP address from the Internet service provider. Configure the outside interface FastEthernet 0\/0 on R1 to receive its IP address using DHCP. The Service Provider is already configured and you have no access to it.<\/strong><\/p>\n<pre>conf t\r\nint f0\/0\r\nip address dhcp\r\nno shutdow<\/pre>\n<p><strong>2. Verify that R1 received its public IP address via DHCP (you may need to wait a few minutes for the address to be assigned).<\/strong><\/p>\n<pre>#2 ways\r\nshow ip interface brief<\/pre>\n<p><strong>3. What is the IP address of R1\u2019s DHCP server?<\/strong><\/p>\n<pre>203.0.113.2<\/pre>\n<p><strong>4. Enable the DHCP service on R1 so it gives out IP addresses to the PCs in the 10.10.10.0\/24 subnet. Leave IP addresses 10.10.10.1 \u2013 10 free to be assigned to servers and printers. 10.10.20.10 is the DNS server.<\/strong><\/p>\n<pre>conf t\r\nip dhcp exclude-address 10.10.10.1 10.10.10.10\r\nip dhcp pool Eng\r\nnetwork 10.10.10.0 255.255.255.0\r\ndefault-router 10.10.10.1\r\ndns-server 10.10.20.10<\/pre>\n<p><strong>5. Verify the clients received their IP information via DHCP.<\/strong><br \/>\n<strong>PC1<\/strong><\/p>\n<pre>ipconfig\r\n...\r\nFastEthernet0 Connection:\r\nLink-local IPv6 Address.........: FE80::200:CFF:FEA0:A359\r\nIP Address......................: 10.10.10.11\r\nSubnet Mask.....................: 255.255.255.0\r\nDefault Gateway.................: 10.10.10.1\r\n<\/pre>\n<p><strong>6. Verify the clients can ping the DNS server by its hostname \u2018DNSserver\u2019 (it might take some time for DNS to resolve the hostname).<\/strong><\/p>\n<pre>this is not working. everything seem correct. \r\ncan ping 10.10.20.10 from both pcs<\/pre>\n<p><strong>7. On R1, verify both clients received an IP address via DHCP.<\/strong><\/p>\n<pre>sh ip dhcp binding<\/pre>\n<p><strong>8. Cleanup \u2013 remove the DHCP server configuration on R1. You will use an external DHCP server instead in the next section.<\/strong><\/p>\n<pre>no ip dhcp pool Eng\r\nno ip dhcp exclude-address 10.10.10.1 10.10.10.10<\/pre>\n<p><strong>9. Enter the command \u2018ipconfig \/release\u2019 on the PCs to release their IP addresses.<\/strong><\/p>\n<pre>C:\\&gt;ipconfig \/release\r\n\r\n   IP Address......................: 0.0.0.0\r\n   Subnet Mask.....................: 0.0.0.0\r\n   Default Gateway.................: 0.0.0.0\r\n   DNS Server......................: 0.0.0.0<\/pre>\n<p><strong>10. Enter the command \u2018ipconfig \/renew\u2019 on the PCs and verify they can no longer obtain an IP address via DHCP<\/strong><\/p>\n<pre>C:\\&gt;ipconfig \/renew\r\nDHCP request failed.<\/pre>\n<p><strong>11. The server at 10.10.20.10 has been configured as a DHCP server with a scope of IP addresses for the 10.10.10.0\/24 subnet, but the PCs there are not receiving IP addresses. Why is this?<\/strong><\/p>\n<pre>The Router interface has not been configured to forward these requests<\/pre>\n<p><strong>12. Configure the network to allow the PCs to receive their IP addresses from the DHCP server.<\/strong><\/p>\n<pre>conf t\r\nint f0\/1\r\nip helper-address 10.10.20.10<\/pre>\n<p><strong>13. Verify the clients received their IP information via DHCP.<\/strong><br \/>\n<strong>PC1<\/strong><\/p>\n<pre>C:\\&gt;ipconfig \/renew\r\n\r\n   IP Address......................: 10.10.10.101\r\n   Subnet Mask.....................: 255.255.255.0\r\n   Default Gateway.................: 10.10.10.1\r\n   DNS Server......................: 10.10.20.10\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&lt; Section 21 | Home | Section 23 &gt; 69% Complete 138. Introduction https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657516#content &nbsp; 139. DHCP Dynamic Host Configuration Protocol https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8657522#content DHCP is a client\/server protocol that automatically provides a host with its IP address and other related configuration information such as the subnet mask, default gateway and DNS server. DHCP clients obtain their ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=2333\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-2333","post","type-post","status-publish","format-standard","hentry","category-icnd1-ccent"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2333"}],"version-history":[{"count":19,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2333\/revisions"}],"predecessor-version":[{"id":3084,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2333\/revisions\/3084"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}