{"id":79091,"date":"2026-11-17T02:00:06","date_gmt":"2026-11-17T02:00:06","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79091"},"modified":"2026-11-17T02:00:06","modified_gmt":"2026-11-17T02:00:06","slug":"linux-advanced-06-dhcp","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79091","title":{"rendered":"Linux Advanced 06 \u2014 DHCP Leases and a Kea Lab"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1992\">Linux Advanced category<\/a> \u00b7 Lesson 6 of 9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This lesson draws on the linked Open Education posts and adds original explanations or lab examples where useful. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Validate a Kea DHCPv4 pool and verify a lease issued to a VM on an isolated segment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original Ubuntu walkthrough uses the older ISC DHCP Server. This lab applies its server\/client pattern to Kea. A DHCPv4 exchange typically goes Discover, Offer, Request, Acknowledge. A lease can carry an address, mask, router, DNS, and duration. Never start a DHCP lab on a shared or unauthorized network. A second server can cause unexpected and conflicting offers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Give the server VM a static 192.168.56.20\/24 address on an isolated adapter, and attach a disposable client VM to the same segment. Check the actual adapter names. Disable any separate hypervisor DHCP for that segment only. Keep a NAT adapter on a separate segment if it is needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Validate a small Kea configuration<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># On the server VM, with kea-dhcp4-server installed:\nlab=$(mktemp -d)\ncat &gt; &quot;$lab\/kea-dhcp4.conf&quot; &lt;&lt;'EOF'\n{\n  &quot;Dhcp4&quot;: {\n    &quot;interfaces-config&quot;: { &quot;interfaces&quot;: [ &quot;enp0s8&quot; ] },\n    &quot;valid-lifetime&quot;: 600,\n    &quot;subnet4&quot;: [ {\n      &quot;id&quot;: 1,\n      &quot;subnet&quot;: &quot;192.168.56.0\/24&quot;,\n      &quot;pools&quot;: [ { &quot;pool&quot;: &quot;192.168.56.100 - 192.168.56.130&quot; } ]\n    } ]\n  }\n}\nEOF\nsudo kea-dhcp4 -t &quot;$lab\/kea-dhcp4.conf&quot;\nprintf 'configuration check status: %s\\n' &quot;$?&quot;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>... DHCP4_CONFIG_COMPLETE ...\nconfiguration check status: 0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A syntax check is not a lease test. In the disposable VM, back up the packaged configuration, then install the validated fixture at \/etc\/kea\/kea-dhcp4.conf and restart kea-dhcp4-server. Continue only after confirming the bound interface is isolated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check the client lease against the server log<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Client VM: enable DHCPv4 on the isolated adapter in its network manager.\nip -4 -br address show dev enp0s8\nip route show dev enp0s8\n# Server VM:\njournalctl -b -u kea-dhcp4-server -n 25 --no-pager<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>enp0s8           UP             192.168.56.100\/24\n192.168.56.0\/24 proto kernel scope link src 192.168.56.100\n... DHCP4_LEASE_ALLOC ... 192.168.56.100 ...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The allocated address can vary. No default router or DNS server is advertised by this fixture. Stop the service and restore the configuration on the server VM, or roll back the VM snapshot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Why should a server\u2019s static address be outside the dynamic pool?<\/li>\n\n\n<li>Does this isolated lease provide internet access?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>How many addresses are in this inclusive pool?<\/li>\n\n\n<li>If the client receives .200 instead of .100\u2013.130, what do you check?<\/li>\n\n\n<li>How would you prove your server issued the observed lease?<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Why should a server\u2019s static address be outside the dynamic pool?<\/strong><br><strong>Answer<\/strong> \u2014 An address must not be offered to a client if the server already uses it.<\/li>\n\n\n<li><strong>Does this isolated lease provide internet access?<\/strong><br><strong>Answer<\/strong> \u2014 No. This configuration advertises no gateway. A separate adapter could supply independent connectivity.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>How many addresses are in this inclusive pool?<\/strong><br><strong>Answer<\/strong> \u2014 31, before exclusions or reservations.<\/li>\n\n\n<li><strong>If the client receives .200 instead of .100\u2013.130, what do you check?<\/strong><br><strong>Answer<\/strong> \u2014 Check for another server and pre-existing leases, confirm the actual adapter, and verify the server&#8217;s configured pool.<\/li>\n\n\n<li><strong>How would you prove your server issued the observed lease?<\/strong><br><strong>Answer<\/strong> \u2014 Correlate the client lease and identity or timestamp with the server&#8217;s lease record or log.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78403\">How to install a DHCP Server in Ubuntu:<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78410\">How to configure a DHCP Client in Ubuntu<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=68592\">DHCP: How to configure a DHCP server in Linux #74<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78732\">Understanding Host-Only Networking in Oracle VirtualBox: Concepts, Tools, IP Addressing, DHCP, and Practical Options<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Technical references<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/ubuntu.com\/server\/docs\/how-to\/networking\/install-isc-kea\/\">Ubuntu Server guide to installing and configuring Kea<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 05 \u2014 Authoritative DNS with BIND. Next lesson 07 \u2014 Time Synchronization with chrony.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1992\">Linux Advanced category<\/a> \u00b7 Lesson 6 of 9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Validate a Kea DHCPv4 pool and verify a lease issued to a VM on an isolated segment.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1992],"tags":[],"class_list":["post-79091","post","type-post","status-publish","format-standard","hentry","category-linux-advanced","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79091,"position":0},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79090,"url":"http:\/\/bangla.sitestree.com\/?p=79090","url_meta":{"origin":79091,"position":1},"title":"Linux Advanced 05 \u2014 Authoritative DNS with BIND","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Build an authoritative forward zone and distinguish an authoritative answer, NXDOMAIN, and no response.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79092,"url":"http:\/\/bangla.sitestree.com\/?p=79092","url_meta":{"origin":79091,"position":2},"title":"Linux Advanced 07 \u2014 Time Synchronization with chrony","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Distinguish clock display from synchronization and show whether chrony selected a source.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79096,"url":"http:\/\/bangla.sitestree.com\/?p=79096","url_meta":{"origin":79091,"position":3},"title":"Linux Advanced 2 02 \u2014 Rootless Containers with Podman","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Serve a fixture with rootless Podman and verify that its port is published only on loopback.","rel":"","context":"In &quot;Linux Advanced 2&quot;","block_context":{"text":"Linux Advanced 2","link":"http:\/\/bangla.sitestree.com\/?cat=1993"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79084,"url":"http:\/\/bangla.sitestree.com\/?p=79084","url_meta":{"origin":79091,"position":4},"title":"Linux Intermediate 08 \u2014 SSH Keys, Host Identity, and File Transfer","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Verify an SSH host\u2019s identity, use a passphrase-protected key, and transfer a non-sensitive file.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79086,"url":"http:\/\/bangla.sitestree.com\/?p=79086","url_meta":{"origin":79091,"position":5},"title":"Linux Advanced 01 \u2014 LVM and Controlled Filesystem Growth","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Create and expand an isolated LVM stack without touching the system disk.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79091"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79091\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79091"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}