{"id":11779,"date":"2026-08-10T17:40:49","date_gmt":"2026-08-10T08:40:49","guid":{"rendered":"https:\/\/www.k-in.co.jp\/niwakan\/?p=11779"},"modified":"2026-08-10T17:40:49","modified_gmt":"2026-08-10T08:40:49","slug":"dhcpd-conf%e3%81%ae%e7%ae%a1%e7%90%86%e3%82%92%e4%b8%80%e5%85%83%e5%8c%96%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.k-in.co.jp\/niwakan\/archives\/2026\/08\/11779\/","title":{"rendered":"dhcpd.conf\u306e\u7ba1\u7406\u3092\u4e00\u5143\u5316\u3059\u308b"},"content":{"rendered":"<p>\u30ed\u30fc\u30ab\u30eb\u306edhcpd server\u306f2\u53f0\u3042\u308b\u3002<br \/>\n\u3053\u308c\u306f\u5168\u304f\u540c\u3058\u56fa\u5b9aip\u306e\u7ba1\u7406\u3092\u3057\u3066\u3044\u308b\u3002<br \/>\n\u9055\u3044\u306f\u3001\u305d\u308c\u305e\u308c\u304c\u914d\u5e03\u3057\u7ba1\u7406\u3059\u308bdynamic ip\u306e\u914d\u5e03\u5e45\u304c\u91cd\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304f\u3089\u3044\u3002<br \/>\n<!--more--><\/p>\n<p>\u306a\u306e\u3067\u4e00\u5143\u5316\u3057\u3066\u7ba1\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3002<br \/>\n\u89aa\u6a5f\uff08192.168.0.36\uff09\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"dhcpd.conf master\">INTERFACES = \"en0, en1\";\r\nserver-name\t\t\t\"macmi2.lo.k-in.co.jp\";\r\noption\trouters\t\t\t192.168.0.1;\r\noption\tbroadcast-address\t192.168.0.255;\r\noption\tdomain-name\t\t\"lo.k-in.co.jp\";\r\noption\tsubnet-mask\t\t255.255.255.0;\r\noption\tdomain-name-servers\t192.168.0.36, 192.168.0.35, 192.168.0.1;\r\noption\tdomain-search\t\t\"k-in.co.jp\",\"lo.k-in.co.jp\";\r\ndefault-lease-time\t\t86400;\r\nmax-lease-time\t\t\t86400;\r\nddns-update-style interim;\r\nlog-facility local7;\r\nsubnet 192.168.0.0 netmask 255.255.255.0 {\r\n\trange\tdynamic-bootp\t\t192.168.0.241 192.168.0.250;\r\n\toption\tdomain-name-servers\t192.168.0.1;\r\n\tdefault-lease-time\t\t43200;\r\n\tmax-lease-time\t\t\t43200;\r\n}\r\n\r\ninclude \"\/opt\/local\/etc\/dhcp\/known_hosts.conf\";<\/pre>\n<p>\u5b50\u6a5f\uff08192.168.0.36\uff09\u5074\u306f\u3053\u308c\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"dhcpd.conf slave\">INTERFACES = \"en0, en1\";\r\nserver-name\t\t\t\"macmini.lo.k-in.co.jp\";\r\noption\trouters\t\t\t192.168.0.1;\r\noption\tbroadcast-address\t192.168.0.255;\r\noption\tdomain-name\t\t\"lo.k-in.co.jp\";\r\noption\tdomain-name-servers\t192.168.0.36, 192.168.0.35, 192.168.0.1;\r\noption\tdomain-search\t\t\"k-in.co.jp\",\"lo.k-in.co.jp\";\r\nmax-lease-time\t\t\t86400;\r\nddns-update-style interim;\r\nauthoritative;\r\nlog-facility local7;\r\nsubnet 192.168.0.0 netmask 255.255.255.0 {\r\n\trange\tdynamic-bootp\t192.168.0.231 192.168.0.240;\r\n\toption\tdomain-name-servers\t192.168.0.1;\r\n\tdefault-lease-time\t\t43200;\r\n\tmax-lease-time\t\t\t43200;\r\n}\r\ninclude \"\/opt\/local\/etc\/dhcp\/known_hosts.conf\";<\/pre>\n<p>\u9055\u3063\u3066\u3044\u308b\u306e\u306frange dynamic-bootp\u306e\u5272\u308a\u5f53\u3066\u958b\u59cb\u30fb\u7d42\u4e86\u4f4d\u7f6e\u3060\u3051\u3002<br \/>\n\u305d\u3057\u3066\u3001\u56fa\u5b9aip\u90e8\u5206\uff08known_hosts.conf\uff09\u3092\u5916\u306b\u51fa\u3057\u3001\u3053\u308c\u3092rsync\u3067\u540c\u671f\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"Makefile\">SLAVE_HOST = 192.168.0.35\r\nSYNC_FILE  = known_hosts.conf\r\nCONF_FILE  = dhcpd.conf\r\nCONF_PATH  = \/opt\/local\/etc\/dhcp\r\nDHCPD      = \/opt\/local\/sbin\/dhcpd\r\n\r\n.PHONY: all test sync deploy\r\n\r\n# \u30c7\u30d5\u30a9\u30eb\u30c8\u52d5\u4f5c\uff1a\u30c6\u30b9\u30c8 -> \u540c\u671f\r\ndeploy: test sync\r\n\r\n# 1. \u30ed\u30fc\u30ab\u30eb\u306e\u6587\u6cd5\u30c1\u30a7\u30c3\u30af\r\ntest:\r\n\t@echo \"==> Syntax testing local dhcpd.conf...\"\r\n\t$(DHCPD) -t -cf $(CONF_PATH)\/$(CONF_FILE)\r\n\r\n# 2. rsync\u3067\u5b50\u30b5\u30fc\u30d0\u30fc\u3078\u8ee2\u9001\r\nsync:\r\n\t@echo \"==> Syncing $(SYNC_FILE) to $(SLAVE_HOST)...\"\r\n\trsync -avz $(CONF_PATH)\/$(SYNC_FILE) rsync:\/\/$(SLAVE_HOST)\/dhcp_config\/\r\n\t@echo \"==> Syntax testing remote dhcpd.conf...\"\r\n\tssh root@$(SLAVE_HOST) \"$(DHCPD) -t -cf $(CONF_PATH)\/$(CONF_FILE)\"<\/pre>\n<p>known_hosts.conf\u3092\u66f8\u304d\u63db\u3048\u305f\u6642\u3001\u4e00\u5ea6sudo make\u3092\u901a\u3059\u3053\u3068\u3067\u3001\u30c1\u30a7\u30c3\u30af\u3068\u540c\u671f\u304c\u884c\u308f\u308c\u308b\u3002\uff08\u5f53\u7136\u3001\u3053\u308c\u3082Gemini\u3055\u3093\u4f5c\uff09<br \/>\n\u9063\u308a\u305f\u3044\u3053\u3068\u3092\u4f1d\u3048\u3066\u3001\u4f5c\u3063\u3063\u3066\u304f\u308c\u305f\u3082\u306e\u3092\u5c11\u3005\u5f04\u308b\u3002<br \/>\n\u4eca\u56de\u306e\u5834\u5408\u3001apple\u7d14\u6b63\u304c\u52d5\u304b\u306a\u3044\u3088\u3046\u306b\u3001DHCPD\u306b\u30d5\u30eb\u30d1\u30b9\u3092\u8a2d\u5b9a\u3057\u305f\u304f\u3089\u3044\u3002<br \/>\ndhcpd\u306e\u518d\u8d77\u52d5\u304c\u306a\u3044\u306e\u306f\u3001\u30ea\u30fc\u30b9\u4e2d\u3060\u3063\u305f\u308a\u3057\u305f\u3089\u554f\u984c\u304c\u8d77\u304d\u305d\u3046\u3060\u304b\u3089\u3002<br \/>\n\u3053\u306e\u5909\u66f4\u306f\u6b21\u306e\u9031\u672b\u591c\u4e2d\u306b\u30b5\u30fc\u30d0\u30fc\u304c\u518d\u8d77\u52d5\u3057\u305f\u3089\u53cd\u6620\u3055\u308c\u308b\u3002\u305d\u308c\u307e\u3067\u8ffd\u52a0\u5bfe\u8c61\u306fdynamic\u3067ip\u304c\u632f\u3089\u308c\u308b\u3053\u3068\u306b\u306a\u308b\u3051\u308c\u3069\u30011\u9031\u9593\u3050\u3089\u3044\u554f\u984c\u306a\u3044\u3060\u308d\u3046\u3002<br \/>\n\u3068\u3001\u5272\u308a\u5207\u308b\u3053\u3068\u306b\u3057\u305f\u3002<br \/>\n\u56e0\u307f\u306b\u5b50\u6a5f\u5074\u306ersyncd.conf\u3067dhcp_config\u306f\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"rsyncd.conf\">log file=\/opt\/local\/var\/log\/rsyncd\/rsyncd.log\r\npid file=\/opt\/local\/var\/run\/rsyncd.pid\r\nuid = root\r\ngid = wheel\r\nuse chroot = no\r\nread only = false\r\nmax connections = 4\r\nlist=false\r\n\r\n[dhcp_config]\r\n    path = \/opt\/local\/etc\/dhcp\r\n    comment = DHCP Config Directory\r\n    read only = no\r\n    hosts allow = 192.168.0.36<\/pre>\n<p>\u5f53\u7136\u3053\u308c\u3082Gemini\u3055\u3093\u4efb\u305b\u3067\u3042\u308b\u3002<\/p>\n<p>\u5b50\u6a5f\u5074\u306b\u3082Makefile\u3092\u5165\u308c\u305f\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"Makefile\"># \u5909\u6570\u8a2d\u5b9a\r\nCONF_FILE  = dhcpd.conf\r\nCONF_PATH  = \/opt\/local\/etc\/dhcp\r\nDHCPD      = \/opt\/local\/sbin\/dhcpd\r\n\r\n.PHONY: all test deploy\r\n\r\n# \u30c7\u30d5\u30a9\u30eb\u30c8\u52d5\u4f5c\uff1a\u30c6\u30b9\u30c8\r\ndeploy: test\r\n\r\n# 1. \u30ed\u30fc\u30ab\u30eb\u306e\u6587\u6cd5\u30c1\u30a7\u30c3\u30af\r\ntest:\r\n\t@echo \"==> Syntax testing local dhcpd.conf...\"\r\n\t$(DHCPD) -t -cf $(CONF_PATH)\/$(CONF_FILE)<\/pre>\n<p>\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3060\u3051\u3002<br \/>\n\u3053\u308c\u306f\u3001\u4e00\u5fdcdhcpd.conf\u3092\u76f4\u63a5\u5f04\u308b\u3053\u3068\u3082\u8003\u616e\u3057\u3066\u2026\u2026\u3063\u3066\u304b\u3001\u3064\u3044\u3067\u3060\u3002<br \/>\nTerminal\u306e\u30a6\u30a4\u30f3\u30c9\u30a6\u3092\u9593\u9055\u3048\u3066\u3001\u5b50\u6a5f\u5074\u306bMakefile\u4f5c\u3063\u3061\u3083\u3063\u305f\u304b\u3089\u3060\u3002\uff08\u7b11\uff09<br \/>\n4\u3064\u3082\u958b\u3044\u3066\u300135\u306836\u3092\u540c\u6642\u306b\u5f04\u308b\u3068\u3053\u3046\u306a\u308b\u3002\u6c17\u3092\u4ed8\u3051\u3088\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ed\u30fc\u30ab\u30eb\u306edhcpd server\u306f2\u53f0\u3042\u308b\u3002 \u3053\u308c\u306f\u5168\u304f\u540c\u3058\u56fa\u5b9aip\u306e\u7ba1\u7406\u3092\u3057\u3066\u3044\u308b\u3002 \u9055\u3044\u306f\u3001\u305d\u308c\u305e\u308c\u304c\u914d\u5e03\u3057\u7ba1\u7406\u3059\u308bdynamic ip\u306e\u914d\u5e03\u5e45\u304c\u91cd\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304f\u3089\u3044\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[246],"tags":[226,259],"class_list":["post-11779","post","type-post","status-publish","format-standard","hentry","category-my-macmini-server","tag-dhcpd","tag-rsyncd"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/11779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/comments?post=11779"}],"version-history":[{"count":1,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/11779\/revisions"}],"predecessor-version":[{"id":11781,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/11779\/revisions\/11781"}],"wp:attachment":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/media?parent=11779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/categories?post=11779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/tags?post=11779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}