{"id":11819,"date":"2024-02-01T22:25:07","date_gmt":"2024-02-01T14:25:07","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=11819"},"modified":"2024-03-17T14:51:55","modified_gmt":"2024-03-17T06:51:55","slug":"openwrt%e6%97%81%e8%b7%af%e7%94%b1dhcp%e6%8c%87%e5%ae%9a%e4%b8%bb%e8%b7%af%e7%94%b1%e7%bd%91%e5%85%b3%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=11819","title":{"rendered":"OpenWrt\u65c1\u8def\u7531DHCP\u6307\u5b9a\u4e3b\u8def\u7531\u7f51\u5173\u65b9\u6cd5"},"content":{"rendered":"<p style=\"text-align: justify;\">\u5728\u4e00\u822c\u7684\u5bb6\u5ead\u7f51\u7edc\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u8ba9\u5149\u732b\u8d1f\u8d23\u62e8\u53f7\u4e0a\u7f51\uff0cOpenWrt\u65c1\u8def\u7531\u8d1f\u8d23\u79d1\u5b66\u4e0a\u7f51\u53ca\u5b9e\u73b0\u5176\u4ed6\u5e94\u7528\uff0cDHCP\u53ef\u4ee5\u653e\u5728\u4e3b\u8def\u7531\u4e0a\uff0c\u8fd9\u6837\u7684\u597d\u5904\u662f\u6298\u817e\u65c1\u8def\u7531\u4e0d\u4f1a\u5f71\u54cd\u6574\u4e2a\u5bb6\u5ead\u7f51\u7edc\u3002\u5982\u679cDHCP\u8bbe\u7f6e\u5728\u65c1\u8def\u7531\u4e0a\uff0c\u65c1\u8def\u7531\u51fa\u73b0\u6545\u969c\uff0c\u5219\u4f1a\u5f71\u54cd\u5230\u6574\u4e2a\u5bb6\u5ead\u7f51\u7edc\u8bbf\u95ee\u3002<\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u5bb6\u5ead\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\u7684\u8bbe\u5907\u5360\u7edd\u5927\u591a\u6570\uff0c\u90a3\u4e48DHCP\u653e\u5728\u65c1\u8def\u7531\u4e0a\u81ea\u7136\u4f1a\u66f4\u52a0\u65b9\u4fbf\uff0c\u8fd9\u65f6\u5019\u5bf9\u4e0d\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\u7684\u8bbe\u5907\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u65c1\u8def\u7531\u4e0a\u5c06\u8bbe\u5907\u7684\u7f51\u5173\u548cDNS\u6307\u5b9a\u4e3a\u4e3b\u8def\u7531\uff0c\u8ba9\u5b83\u76f4\u63a5\u901a\u8fc7\u4e3b\u8def\u7531\u8bbf\u95ee\u5916\u90e8\u7f51\u7edc\uff0c\u4ece\u800c\u514d\u53bb\u5728\u5ba2\u6237\u7aef\u8bbe\u5907\u4e0a\u624b\u52a8\u8bbe\u7f6e\u7684\u70e6\u607c\u3002\u4e0b\u9762\u4ecb\u7ecd\u8bbe\u7f6e\u8fc7\u7a0b\u3002<\/p>\n<p style=\"text-align: justify;\">\u793a\u4f8b\u7f51\u7edc\u73af\u5883\uff1a\u4e3b\u8def\u7531\u534e\u4e3aP812E\u5149\u732b\uff0c\u7f51\u5173\u5730\u5740192.168.18.254\uff0c\u65c1\u8def\u7531\u4f7f\u7528NanoPi R6S\u8f6f\u8def\u7531\uff0c\u56fa\u4ef6\u4e3a<a href=\"https:\/\/cloud.blog.pfchina.org\/index.php\/s\/CYFKMKGY7spK7mj?path=%2FOpenWrt%2FNanoPi%20R6S\">lean<\/a>\u7f16\u8bd1\u7684\u7248\u672c\uff0c\u7f51\u5173\u5730\u5740192.168.18.2\u3002<\/p>\n<h1 style=\"text-align: justify;\">\u8bbe\u7f6eDHCP\u9759\u6001\u6620\u5c04<\/h1>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u7f51\u7edc&gt;DHCP\/DNS\uff0c\u628a\u5df2\u5206\u914d\u7684\u8bbe\u5907\u7684IP\u5730\u5740\u8fdb\u884c\u9759\u6001\u6620\u5c04\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11820\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42.png\" alt=\"\" width=\"1327\" height=\"304\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42.png 1327w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42-300x69.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42-1024x235.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42-768x176.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_21-57-42-500x115.png 500w\" sizes=\"auto, (max-width: 1327px) 100vw, 1327px\" \/><\/a><\/p>\n<h1 style=\"text-align: justify;\">\u4fee\u6539DHCP\u6807\u8bc6<\/h1>\n<p style=\"text-align: justify;\">\u4f7f\u7528finalshell\u5de5\u5177\uff0c\u8fde\u63a5OpenWrt\u540e\u53f0\uff0c\u7f16\u8f91\/etc\/config\/dhcp\u6587\u4ef6\uff0c\u5728\u4e0d\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\u7684\u8bbe\u5907\u4e0a\u6dfb\u52a0&#8221;direct&#8221;\u6807\u8bc6\u3002<\/p>\n<pre>config host\r\noption name 'Fn1'\r\noption dns '1'\r\noption mac 'fa:11:e5:65:4f:83'\r\noption ip '192.168.18.114'\r\n<span style=\"color: #ff0000;\">option tag 'direct'<\/span>\r\n\r\nconfig host\r\noption name 'Fn2'\r\noption dns '1'\r\noption mac '9e:53:76:01:cd:05'\r\noption ip '192.168.18.115'\r\n<span style=\"color: #ff0000;\">option tag 'direct'<\/span>\r\n\r\nconfig host\r\noption name 'Fn3'\r\noption dns '1'\r\noption mac '74:97:79:ce:7e:99'\r\noption ip '192.168.18.116'\r\n<span style=\"color: #ff0000;\">option tag 'direct'\r\n<\/span><\/pre>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">\u7f16\u8f91\u5b8c\u6210\uff0c\u4fdd\u5b58\u6587\u4ef6\u3002<\/span><\/p>\n<h1 style=\"text-align: justify;\">\u8bbe\u7f6eDHCP\u9ad8\u7ea7\u9009\u9879<\/h1>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u7f51\u7edc&gt;\u63a5\u53e3&gt;LAN\uff0c\u70b9\u51fb\u53f3\u4fa7\u7684\u4fee\u6539\uff0c\u5728\u4e0b\u9762\u7684DHCP\u7684\u9ad8\u7ea7\u8bbe\u7f6e\u5904\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u4e2a\u9009\u9879\uff1a<\/p>\n<pre class=\"code\">tag:direct,3,192.168.18.254 \r\ntag:direct,6,192.168.18.254<\/pre>\n<p><strong><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11822\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10.png\" alt=\"\" width=\"1264\" height=\"462\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10.png 1264w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10-300x110.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10-1024x374.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10-768x281.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/02\/Snipaste_2024-02-01_22-02-10-500x183.png 500w\" sizes=\"auto, (max-width: 1264px) 100vw, 1264px\" \/><\/a><\/strong><\/p>\n<p>tag:direct,3,192.168.18.254\u5c06\u6307\u5b9a\u6807\u8bc6\u4e3adirect\u7684\u8bbe\u5907\u7f51\u5173\u6307\u5411192.168.18.254\uff0ctag:direct,6,192.168.18.254\u5c06\u6307\u5b9a\u6807\u8bc6\u4e3adirect\u8bbe\u5907\u7684DNS\u6307\u5411192.168.18.254\u3002<\/p>\n<p>DHCP\u9ad8\u7ea7\u9009\u9879\u7684\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u53c2\u8003\u6069\u5c71\u7684\u8fd9\u7bc7<a href=\"https:\/\/www.right.com.cn\/forum\/thread-355909-1-1.html\">\u8d34\u5b50<\/a>\u3002<\/p>\n<p>\u4fee\u6539\u5b8c\u6210\u4ee5\u540e\uff0c\u70b9\u51fb\u4fdd\u5b58\u5e76\u5e94\u7528\u3002\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\u91cd\u8fde\uff0c\u4e0a\u8ff0\u8bbe\u5907\u901a\u8fc7\u65c1\u8def\u7531DHCP\u670d\u52a1\u5c06\u4f1a\u83b7\u53d6\u5230\u4e3b\u8def\u7531\u7684\u7f51\u5173\u548cDNS\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e00\u822c\u7684\u5bb6\u5ead\u7f51\u7edc\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u8ba9\u5149\u732b\u8d1f\u8d23\u62e8\u53f7\u4e0a\u7f51\uff0cOpenWrt\u65c1\u8def\u7531\u8d1f\u8d23\u79d1\u5b66\u4e0a\u7f51 &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=11819\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[414],"tags":[178],"class_list":["post-11819","post","type-post","status-publish","format-standard","hentry","category-openwrt","tag-dhcp"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/11819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11819"}],"version-history":[{"count":16,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/11819\/revisions"}],"predecessor-version":[{"id":12244,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/11819\/revisions\/12244"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}