{"id":3485,"date":"2025-02-19T10:12:43","date_gmt":"2025-02-19T10:12:43","guid":{"rendered":"https:\/\/technobabble.us.to\/?p=3485"},"modified":"2025-02-19T11:03:58","modified_gmt":"2025-02-19T11:03:58","slug":"zero-touch-provisioning-with-dhcp-kea","status":"publish","type":"post","link":"https:\/\/technobabble.us.to\/?p=3485","title":{"rendered":"Zero Touch Provisioning with DHCP (KEA)"},"content":{"rendered":"\n<p>In my last blog I wrote about building ZTP configurations for SONiC switches using the data in NetBox. This post will explain how those configurations are served to these devices without the need for any human intervention. <\/p>\n\n\n\n<p>The key elements are: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DHCP Server (to receive requests from new devices and point to software\/config locations) <\/li>\n\n\n\n<li>KEA class definitions (unique for each vendor and platform)  <\/li>\n\n\n\n<li>HTTP Server (send firmware) <\/li>\n\n\n\n<li>GIT Server (send configuration files)<\/li>\n\n\n\n<li><em>ztp.json<\/em> file that defines the final steps needed to fully configure a SONiC switch<\/li>\n<\/ul>\n\n\n\n<p>The ZTP process is as follows: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>New switch is plugged into the network and DHCP request is sent requesting software (ONIE)<\/li>\n\n\n\n<li>DHCP server determines hardware vendor\/type and sends the correct software to switch<\/li>\n\n\n\n<li>Switch loaded with new software, reboots  &amp; requests configuration file from DHCP server<\/li>\n\n\n\n<li>DHCP server responds with the correct configuration file (based on serial number) <\/li>\n\n\n\n<li>Switch applies the configuration file and reboots before completing ZTP <\/li>\n\n\n\n<li>Switch looks at ZTP configuration file for further configuration instructions and or QA<\/li>\n<\/ul>\n\n\n\n<p><strong>KEA example of the various classes that define the different vendors and platforms. This is just a list of all the classes currently defined in KEA.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2132\" height=\"1208\" data-id=\"3495\" src=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1.png\" alt=\"\" class=\"wp-image-3495\" srcset=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1.png 2132w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1-300x170.png 300w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1-768x435.png 768w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1-1536x870.png 1536w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_classes-1-2048x1160.png 2048w\" sizes=\"auto, (max-width: 2132px) 100vw, 2132px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><strong>Drilling down into the class for Edgecore we can see the location of the software file and also the vendor and platform ID which determines the actual hardware type.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2144\" height=\"1188\" data-id=\"3502\" src=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore.png\" alt=\"\" class=\"wp-image-3502\" srcset=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore.png 2144w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore-300x166.png 300w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore-768x426.png 768w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore-1536x851.png 1536w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/edgecore-2048x1135.png 2048w\" sizes=\"auto, (max-width: 2144px) 100vw, 2144px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><strong>Class definition for Wistron. The unique HEX value is how the DHCP server can identify the correct hardware. <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2192\" height=\"908\" data-id=\"3505\" src=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron.png\" alt=\"\" class=\"wp-image-3505\" srcset=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron.png 2192w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron-300x124.png 300w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron-768x318.png 768w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron-1536x636.png 1536w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/wistron-2048x848.png 2048w\" sizes=\"auto, (max-width: 2192px) 100vw, 2192px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><strong>Once the switch has the correct software applied and has rebooted, then the ZTP process can begin. All switches default to the name &#8220;sonic&#8221; after having the software upgraded so this is the key piece of info the DHCP server is looking for in this step of the process.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2218\" height=\"1192\" data-id=\"3512\" src=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_ztp.png\" alt=\"\" class=\"wp-image-3512\" srcset=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_ztp.png 2218w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_ztp-300x161.png 300w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_ztp-768x413.png 768w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_ztp-1536x825.png 1536w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/sonic_ztp-2048x1101.png 2048w\" sizes=\"auto, (max-width: 2218px) 100vw, 2218px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>This is the <em>ztp.json<\/em> file that contains the instructions to configure the switch. The configs are stored on git and the serial number is the unique identifier to ensure the correct config ends up on the proper device.  In addition to the main configuration file, there is also the routing portion of the config (FRR). Finally there is a basic connectivity check via ping.    <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1344\" height=\"1642\" data-id=\"3514\" src=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/ztp.json_.png\" alt=\"\" class=\"wp-image-3514\" srcset=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/ztp.json_.png 1344w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/ztp.json_-246x300.png 246w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/ztp.json_-768x938.png 768w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/ztp.json_-1257x1536.png 1257w\" sizes=\"auto, (max-width: 1344px) 100vw, 1344px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>You can add any instructions you might need for your infra. The first step in the ZTP process was a password change and setting a sleep timer. <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"222\" data-id=\"3516\" src=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/Screenshot-2025-02-19-at-03.00.04.png\" alt=\"\" class=\"wp-image-3516\" srcset=\"https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/Screenshot-2025-02-19-at-03.00.04.png 764w, https:\/\/technobabble.us.to\/wp-content\/uploads\/2025\/02\/Screenshot-2025-02-19-at-03.00.04-300x87.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>That&#8217;s all there is to Zero Touch Provisioning a SONiC switch using KEA DHCP server. I will write another blog post on KEA in the near future since it&#8217;s very helpful when managing infrastructure. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last blog I wrote about building ZTP configurations for SONiC switches using the data in NetBox. This post will explain how those configurations are served to these devices without the need for any human intervention. The key elements &hellip; <a href=\"https:\/\/technobabble.us.to\/?p=3485\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3485","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/technobabble.us.to\/index.php?rest_route=\/wp\/v2\/posts\/3485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technobabble.us.to\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technobabble.us.to\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technobabble.us.to\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technobabble.us.to\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3485"}],"version-history":[{"count":15,"href":"https:\/\/technobabble.us.to\/index.php?rest_route=\/wp\/v2\/posts\/3485\/revisions"}],"predecessor-version":[{"id":3519,"href":"https:\/\/technobabble.us.to\/index.php?rest_route=\/wp\/v2\/posts\/3485\/revisions\/3519"}],"wp:attachment":[{"href":"https:\/\/technobabble.us.to\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technobabble.us.to\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technobabble.us.to\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}