{"id":286,"date":"2021-12-05T22:20:07","date_gmt":"2021-12-05T13:20:07","guid":{"rendered":"https:\/\/hanakihomeserver.dip.jp\/blog\/?p=286"},"modified":"2021-12-05T22:23:18","modified_gmt":"2021-12-05T13:23:18","slug":"dhcp%e3%82%b5%e3%83%bc%e3%83%90%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/hanakihomeserver.com\/?p=286","title":{"rendered":"DHCP\u30b5\u30fc\u30d0\u69cb\u7bc9"},"content":{"rendered":"<p><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\">\u901a\u5e38DHCP\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306f\u300cISC-DHCP\u300d\u3092\u4f7f\u3063\u3066\u69cb\u7bc9\u3059\u308b\u306e\u3060\u304c\u3001ISC\u304c\u65b0\u3057\u3044DHCP\u30b5\u30fc\u30d0\u300cKea\u300d\u3092\u51fa\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u77e5\u3063\u305f\u306e\u3067\u305d\u3061\u3089\u3092\u4f7f\u3063\u3066\u69cb\u7bc9\u3059\u308b\u3053\u3068\u306b\u3057\u3066\u307f\u305f\u3002<\/font><\/p>\n<p><p><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\">\u69cb\u7bc9\u624b\u9806\u306b\u3064\u3044\u3066\u306f\u4e0b\u8a18\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u69cb\u7bc9\u3092\u884c\u3044\u307e\u3044\u3057\u305f\u3002<br \/><a href=\"https:\/\/www.designet.co.jp\/open_source\/keakeeper\/node1.php\">\u76ee\u6b21 | KeaKeeper | OSS\u3067\u306e\u30b7\u30b9\u30c6\u30e0\u69cb\u7bc9\u30fb\u30c7\u30fc\u30b8\u30fc\u30cd\u30c3\u30c8 (designet.co.jp)<\/a><br \/><a href=\"https:\/\/www.unix-power.net\/networking\/post-921\">CentOS7 Kea-DHCP\u30b5\u30fc\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb (unix-power.net)<\/a><br \/><font color=\"#0066cc\"><br \/><font color=\"#333333\">\u300cKea\u300d\u306f\u4eca\u307e\u3067\u306eDHCP\u30b5\u30fc\u30d0\u3068\u9055\u3044DB\u3067\u306e\u7ba1\u7406\u304c\u3067\u304d\u308b\u3002<br \/><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\"><font color=\"#0066cc\"><font color=\"#333333\">\u69cb\u7bc9\u969b\u306fMySQL(MariaDB)\u3084PostgreSQL\u3092\u4f7f\u7528\u3057\u3066\u69cb\u7bc9\u304c\u3067\u304d\u308b\u304c\u3053\u3053\u3068\u3067\u306fMariaDB\u3092\u4f7f\u7528\u3057\u3066\u69cb\u7bc9\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<p><\/font><\/font><\/font><\/font><\/font><\/font><\/p>\n<p><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\"><font color=\"#0066cc\"><font color=\"#333333\"><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\"><font color=\"#0066cc\"><font color=\"#333333\">\u69cb\u7bc9\u30d0\u30fc\u30b8\u30e7\u30f3\uff1aCentOS8 Kea 1.8<br \/><\/font><\/font><\/font><\/font><\/font><\/font><\/p>\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><br \/>\n<\/font><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><br \/>\n<\/font><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><br \/>\n<\/font><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\">\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"># dnf install epel-release<br \/>\n# dnf install kea mariadb-server<br \/># systemctl start \u2013now mariadb<\/font><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\"><br \/>\n\u4e0b\u8a18\u8a2d\u5b9a\u306fMariaDB\u306e\u8a2d\u5b9a\u306b\u306a\u308a\u307e\u3059\u3002<br \/><\/font>\u30fb\u7ba1\u7406\u8005\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a<br \/>\n\u30fb\u533f\u540d\u30e6\u30fc\u30b6\u306e\u524a\u9664<br \/>\n\u30fb\u7ba1\u7406\u8005\u30e6\u30fc\u30b6\u306e\u30ea\u30e2\u30fc\u30c8\u30ed\u30b0\u30a4\u30f3\u306e\u7981\u6b62<br \/>\n\u30fbtest\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u524a\u9664<br \/>\n\u30fb\u6a29\u9650\u30c6\u30fc\u30d6\u30eb\u306e\u30ea\u30ed\u30fc\u30c9<font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><\/p>\n<p><\/font><\/font><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\">\n<p># mysql_secure_installation<\/p>\n<p>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br \/>\nSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<\/p>\n<p>In order to log into MariaDB to secure it, we&#8217;ll need the current<br \/>\npassword for the root user. If you&#8217;ve just installed MariaDB, and<br \/>\nyou haven&#8217;t set the root password yet, the password will be blank,<br \/>\nso you should just press enter here.<\/p>\n<p>Enter current password for root (enter for none):<br \/>\nOK, successfully used password, moving on&#8230;<\/p>\n<p>Setting the root password ensures that nobody can log into the MariaDB<br \/>\nroot user without the proper authorisation.<\/p>\n<p>You already have a root password set, so you can safely answer &#8216;n&#8217;.<\/p>\n<p>Change the root password? [Y\/n] y<br \/>\nNew password:<br \/>\nRe-enter new password:<br \/>\nPassword updated successfully!<br \/>\nReloading privilege tables..<br \/>\n&#8230; Success!<\/p>\n<p>\nBy default, a MariaDB installation has an anonymous user, allowing anyone<br \/>\nto log into MariaDB without having to have a user account created for<br \/>\nthem. This is intended only for testing, and to make the installation<br \/>\ngo a bit smoother. You should remove them before moving into a<br \/>\nproduction environment.<\/p>\n<p>Remove anonymous users? [Y\/n] y<br \/>\n&#8230; Success!<\/p>\n<p>Normally, root should only be allowed to connect from &#8216;localhost&#8217;. This<br \/>\nensures that someone cannot guess at the root password from the network.<\/p>\n<p>Disallow root login remotely? [Y\/n] y<br \/>\n&#8230; Success!<\/p>\n<p>By default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<br \/>\naccess. This is also intended only for testing, and should be removed<br \/>\nbefore moving into a production environment.<\/p>\n<p>Remove test database and access to it? [Y\/n] y<br \/>\n&#8211; Dropping test database&#8230;<br \/>\n&#8230; Success!<br \/>\n&#8211; Removing privileges on test database&#8230;<br \/>\n&#8230; Success!<\/p>\n<p>Reloading the privilege tables will ensure that all changes made so far<br \/>\nwill take effect immediately.<\/p>\n<p>Reload privilege tables now? [Y\/n] y<br \/>\n&#8230; Success!<\/p>\n<p>Cleaning up&#8230;<\/p>\n<p>All done! If you&#8217;ve completed all of the above steps, your MariaDB<br \/>\ninstallation should now be secure.<\/p>\n<p>Thanks for using MariaDB!<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"><br \/>\n<\/font><\/font><\/p>\n<p><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\">Kea\u306eDB\u3068\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/><\/font><\/p>\n<p><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\"><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\">\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"># mysql -u root -p<br \/>\nEnter password:<br \/>\n&gt; CREATE DATABASE kea;<br \/>\n&gt; Exit<\/font><\/p>\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"># mysql -u root -p<br \/>\nEnter password:<br \/>\n&gt; GRANT ALL ON kea.* TO<br \/>\nkeauser@localhost IDENTIFIED BY &#8216;password&#8217;;<br \/>\n&gt; FLUSH PRIVILEGES;<br \/>\n&gt; Exit<\/font><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\nKea\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\u30fb\u30ea\u30ea\u30fc\u30b9\u7528\u3068\u30db\u30b9\u30c8\u7528DB\u306e\u8a2d\u5b9a<br \/>\u30fbIP\u30a2\u30c9\u30ec\u30b9\u306e\u30ea\u30ea\u30fc\u30b9\u8a2d\u5b9a<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\">\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"># vim \/etc\/kea\/kea-dhcp4.conf<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;\u7565&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p><\/font><\/p>\n<p><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"> &#8220;hosts-databases&#8221;: [<br \/>&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8220;host&#8221;: &#8220;localhost&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;kea&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8220;password&#8221;: &#8220;password&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8220;port&#8221;: 3306,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8220;type&#8221;: &#8220;mysql&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &#8220;user&#8221;: &#8220;keauser&#8221;<br \/>&nbsp;&nbsp; }<br \/>\n],<br \/>\n&#8220;lease-database&#8221;: {<br \/>&nbsp;&nbsp; &#8220;host&#8221;: &#8220;localhost&#8221;,<br \/>&nbsp;&nbsp; &#8220;name&#8221;: &#8220;kea&#8221;,<br \/>&nbsp;&nbsp; &#8220;password&#8221;: &#8220;password&#8221;,<br \/>&nbsp;&nbsp; &#8220;port&#8221;: 3306,<br \/>&nbsp;&nbsp; &#8220;type&#8221;: &#8220;mysql&#8221;,<br \/>&nbsp;&nbsp; &#8220;user&#8221;: &#8220;keauser&#8221;<br \/>\n},<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;\u7565&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>&#8220;subnet4&#8221;: [<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;option-data&#8221;: [<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u8a2d\u5b9a<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;routers&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;data&#8221;: &#8220;192.168.10.1&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;space&#8221;: &#8220;dhcp4&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/DNS\u306e\u8a2d\u5b9a<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;domain-name-servers&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;data&#8221;: &#8220;192.168.11.3,192.168.211.11,8.8.8.8,8.8.4.4&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;space&#8221;: &#8220;dhcp4&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;subnet&#8221;: &#8220;192.168.10.0\/24&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-\u7565&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/font><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Kea\u306eDB\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\"># <font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\">kea-admin db-init mysql -u keauser -p password -n kea<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/font><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\"><\/p>\n<p>Kea\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\"><font face=\"BIZ UD\u30b4\u30b7\u30c3\u30af\"># systemctl enable \u2013now kea-dhap4<\/font><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/font><\/p>\n<p><font face=\"BIZ UDP\u30b4\u30b7\u30c3\u30af\">Kea\u304c\u6b63\u5e38\u306b\u8d77\u52d5\u3067\u304d\u308c\u3070\u5b8c\u4e86\u3067\u3059<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u5e38DHCP\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306f\u300cISC-DHCP\u300d\u3092\u4f7f\u3063\u3066\u69cb\u7bc9\u3059\u308b\u306e\u3060\u304c\u3001IS &hellip; <a href=\"https:\/\/hanakihomeserver.com\/?p=286\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[41,42],"class_list":["post-286","post","type-post","status-publish","format-standard","hentry","category-2","tag-dhcp","tag-linux"],"_links":{"self":[{"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286"}],"version-history":[{"count":2,"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=\/wp\/v2\/posts\/286\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hanakihomeserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}