{"id":6297,"date":"2020-01-19T19:41:04","date_gmt":"2020-01-19T11:41:04","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6297"},"modified":"2022-06-17T15:24:23","modified_gmt":"2022-06-17T07:24:23","slug":"dhcpd","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/dhcpd","title":{"rendered":"dhcpd\u547d\u4ee4 – \u7ba1\u7406DHCP\u670d\u52a1\u7a0b\u5e8f"},"content":{"rendered":"\n

dhcpd\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cDHCP daemon\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u7ba1\u7406DHCP\u670d\u52a1\u7a0b\u5e8f\u3002\u6267\u884cdhcpd\u547d\u4ee4\u4f1a\u8bfb\u53d6\u52a0\u8f7ddhcpd.conf\u914d\u7f6e\u6587\u4ef6\u5e76\u542f\u52a8\u670d\u52a1\u5668\u4e0a\u7684DHCP\u670d\u52a1\u7a0b\u5e8f\uff0c\u968f\u540e\u7528\u6237\u4fbf\u53ef\u4ee5\u83b7\u53d6\u5230\u5982IP\u5730\u5740\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u5730\u5740\u7b49\u7f51\u5361\u4fe1\u606f\u4e86\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>dhcpd [\u53c2\u6570] [\u7f51\u7edc\u63a5\u53e3]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-p <\u7aef\u53e3><\/td>\u6307\u5b9a\u76d1\u542c\u7aef\u53e3<\/td><\/tr>
-f<\/td>\u4f5c\u4e3a\u524d\u53f0\u8fdb\u7a0b\u8fd0\u884c<\/td><\/tr>
-d<\/td>\u542f\u7528\u8c03\u8bd5\u6a21\u5f0f<\/td><\/tr>
-q<\/td>\u5728\u542f\u52a8\u65f6\u4e0d\u663e\u793a\u7248\u6743\u4fe1\u606f<\/td><\/tr>
-t<\/td>\u6d4b\u8bd5\u914d\u7f6e\u6587\u4ef6\u7684\u8bed\u6cd5\u662f\u5426\u6b63\u786e<\/td><\/tr>
-T<\/td>\u53ef\u4ee5\u7528\u6765\u6d4b\u8bd5\u79df\u7ea6\u6570\u636e\u5e93\u6587\u4ef6<\/td><\/tr>
-4<\/td>\u8fd0\u884cDHCPv4\u670d\u52a1\u5668<\/td><\/tr>
-6<\/td>\u8fd0\u884cDHCPv6\u670d\u52a1\u5668<\/td><\/tr>
-s <\u670d\u52a1\u5668><\/td>\u6307\u5b9a\u53d1\u9001\u56de\u590d\u7684\u670d\u52a1\u5668<\/td><\/tr>
-cf <\u914d\u7f6e\u6587\u4ef6><\/td>\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6<\/td><\/tr>
-lf <\u79df\u7ea6\u6587\u4ef6><\/td>\u6307\u5b9a\u79df\u7ea6\u6587\u4ef6<\/td><\/tr>
-pf <PID\u6587\u4ef6><\/td>\u6307\u5b9aPID\u6587\u4ef6<\/td><\/tr>
-tf <\u8ddf\u8e2a\u8f93\u51fa\u6587\u4ef6><\/td>\u6307\u5b9a\u6587\u4ef6\u8bb0\u5f55DHCP\u670d\u52a1\u5668\u7684\u6574\u4e2a\u542f\u52a8\u72b6\u6001<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u542f\u52a8DHCP\u670d\u52a1\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dhcpd<\/strong>\r\nInternet Systems Consortium DHCP Server 4.3.6\r\nCopyright 2004-2017 Internet Systems Consortium.\r\nAll rights reserved.\r\nFor info, please visit https:\/\/www.isc.org\/software\/dhcp\/\r\nldap_gssapi_principal is not set,GSSAPI Authentication for LDAP will not be used\r\nNot searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file\r\nConfig file: \/etc\/dhcp\/dhcpd.conf\r\nDatabase file: \/var\/lib\/dhcpd\/dhcpd.leases\r\nPID file: \/var\/run\/dhcpd.pid\r\nSource compiled to use binary-leases\r\nWrote 0 leases to leases file.\r\n\r\nListening on LPF\/ens160\/00:0c:29:60:cd:ee\/192.168.10.0\/24\r\nSending on   LPF\/ens160\/00:0c:29:60:cd:ee\/192.168.10.0\/24\r\nSending on   Socket\/fallback\/fallback-net\r<\/pre>\n\n\n\n

\u6307\u5b9a\u53d1\u9001\u56de\u590d\u7684DHCP\u670d\u52a1\u5668\u5730\u5740\uff0c\u5e76\u542f\u52a8\u670d\u52a1\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dhcpd -s 192.168.10.10<\/strong><\/pre>\n\n\n\n

\u4ee5\u8c03\u8bd5\u6a21\u5f0f\u542f\u52a8DHCP\u670d\u52a1\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dhcpd -d<\/strong><\/pre>\n\n\n\n

\u6307\u5b9a\u76d1\u542c\u7aef\u53e3\u53f7\u540e\u542f\u52a8DHCP\u670d\u52a1\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# dhcpd -p 53<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"

dhcpd\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cDHCP daemon\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u7ba1\u7406DHCP\u670d\u52a1\u7a0b\u5e8f\u3002\u6267\u884cdhcpd […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6297"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6297"}],"version-history":[{"count":14,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6297\/revisions"}],"predecessor-version":[{"id":10315,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6297\/revisions\/10315"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}