{"id":2228,"date":"2014-03-10T08:54:39","date_gmt":"2014-03-10T12:54:39","guid":{"rendered":"http:\/\/antipaucity.com\/?p=2228"},"modified":"2014-03-10T08:54:39","modified_gmt":"2014-03-10T12:54:39","slug":"a-smartish-dhcpd","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=2228","title":{"rendered":"a smart[ish] dhcpd"},"content":{"rendered":"<p>After running into some wacky networking issues at a recent customer engagement, I had a brainstorm about a smart[ish] DHCPd server that could work in conjunction with DNS and static IP assignment to more intelligently fill subnet space.<\/p>\n<p>Here&#8217;s the scenario we had:<\/p>\n<blockquote><p>Lab network space is fairly-heavily populated with static assigned addresses &#8211; in a \/23 network, ie ~500 available address on the subnet, about 420 addresses were in use.<\/p>\n<p>Not all statically-assigned IPs were registered in DNS.<\/p>\n<p>The in-use addresses were did not leave much contiguous, unused space (little groups of 2 or4 addresses open &#8211; not ~80, or even a couple small batches of 20-30 in a row).<\/p>\n<p>DNS was running on a {{Windows 2012}} host.<\/p>\n<p>DHCPd (<a href=\"https:\/\/www.isc.org\/downloads\/dhcp\">ISC&#8217;s<\/a>) was setup on an {{RHEL}} 5&#215;64 {{Linux}} machine.<\/p><\/blockquote>\n<p>The problem with using the ISC DHCPd server, as supplied by <a href=\"http:\/\/antipaucity.com\/tag\/hpsa\/#.UxoKsPSwJyU\">HPSA<\/a>, is that while you can configure multiple\u00a0<em>subnets<\/em> to hand-out addresses on, you cannot configure multiple\u00a0<em>ranges<\/em>\u00a0on a single {{subnet}}. So we were unable to effectively utilize all the little gaps in assigned addresses.<\/p>\n<p>Maybe this is something {{DNS}}\/{{DHCP}} can do from a Windows DC, but I have an idea for how DHCPd could work a little smarter:<\/p>\n<ul>\n<li>give a very large range on a given subnet (perhaps all but the gateway and broadcast addresses)<\/li>\n<li><em>before<\/em> handing an address out, in addition to checking the leases file for if it is free, check against DNS to see if it is in use<\/li>\n<li>if an address is in use because it is\u00a0<em>static<\/em>, update the leases file with the statically-assigned information\u00a0<em>as if<\/em> it were assigned dynamically &#8211; but give it an unusually-long lease time (eg 1 month instead of 4 hours)<\/li>\n<li>on a periodic basis (perhaps once an hour, day, week &#8211; it should be configurable), scan the whole subnet for in-use addresses (via something like {{nmap}}\u00a0<em>and<\/em> checking against DNS)\n<ul>\n<li>remove all lease file entries for unused\/available IPs<\/li>\n<li>update lease file entries for used\/unavailable IPs, if not already recorded<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>This would have the advantage of intelligently filling address gaps on a given subnet, and require less interaction between teams that want\/need to be able to use DHCP and those that need\/want static addresses.<\/p>\n<p>Or maybe what I&#8217;m describing has already been solved, and I just don&#8217;t know how to find it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After running into some wacky networking issues at a recent customer engagement, I had a brainstorm about a smart[ish] DHCPd server that could work in conjunction with DNS and static IP assignment to more intelligently fill subnet space. Here&#8217;s the scenario we had: Lab network space is fairly-heavily populated with static assigned addresses &#8211; in &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=2228\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">a smart[ish] dhcpd<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_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":[22,41],"tags":[239,240,249,259,394,417,511,719],"keyring_services":[],"class_list":["post-2228","post","type-post","status-publish","format-standard","hentry","category-ideas","category-technical","tag-dhcp","tag-dhcpd","tag-dns","tag-dynamicip","tag-hpsa","tag-ip","tag-networking","tag-staticip"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/2228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2228"}],"version-history":[{"count":0,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/2228\/revisions"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2228"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=2228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}