{"id":20,"date":"2026-09-02T09:35:12","date_gmt":"2026-09-02T01:35:12","guid":{"rendered":"https:\/\/www.xiayanxi.cn\/?p=20"},"modified":"2026-09-02T09:35:12","modified_gmt":"2026-09-02T01:35:12","slug":"centos6-5-%e6%90%ad%e5%bb%badhcp%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.xiayanxi.cn\/index.php\/2026\/09\/02\/centos6-5-%e6%90%ad%e5%bb%badhcp%e6%9c%8d%e5%8a%a1%e5%99%a8\/","title":{"rendered":"CentOS6.5 \u642d\u5efaDhcp\u670d\u52a1\u5668"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4e8c\u3001dhcp\u670d\u52a1\u5b89\u88c5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX \/]# yum install -y dhcp<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Loaded plugins: fastestmirror, refresh-packagekit, security<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Loading mirror speeds from cached hostfile<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up Install Process<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Resolving Dependencies<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211;&gt; Running transaction check<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&gt; Package dhcp.x86_64 12:4.1.1-38.P1.el6.centos will be installed<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211;&gt; Finished Dependency Resolution<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Dependencies Resolved<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================================================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Package&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Arch&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Version&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Repository&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================================================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installing:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;dhcp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x86_64&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12:4.1.1-38.P1.el6.centos&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; local_server&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 817 k<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Transaction Summary<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================================================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install&nbsp; &nbsp; &nbsp; &nbsp;1 Package(s)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Total download size: 817 k<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installed size: 1.9 M<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Downloading Packages:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Running rpm_check_debug<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Running Transaction Test<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Transaction Test Succeeded<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Running Transaction<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; Installing : 12:dhcp-4.1.1-38.P1.el6.centos.x86_64&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1\/1&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; Verifying&nbsp; : 12:dhcp-4.1.1-38.P1.el6.centos.x86_64&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1\/1&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installed:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; dhcp.x86_64 12:4.1.1-38.P1.el6.centos&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Complete!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX \/]# vi \/etc\/dhcp\/dhcpd<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">dhcpd6.conf&nbsp; dhcpd.conf&nbsp; &nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX \/]# vi \/etc\/dhcp\/dhcpd.conf&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX \/]# cat \/etc\/dhcp\/dhcpd.conf&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># DHCP Server Configuration file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#&nbsp; &nbsp;see \/usr\/share\/doc\/dhcp*\/dhcpd.conf.sample<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#&nbsp; &nbsp;see &#8216;man 5 dhcpd.conf&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX \/]# cp \/usr\/share\/doc\/dhcp-4.1.1\/dhcpd.conf.sample&nbsp; \/etc\/dhcp\/dhcpd001.conf&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX \/]# cd \/etc\/dhcp<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX dhcp]# ls<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">dhclient.d&nbsp; dhcpd001.conf&nbsp; dhcpd6.conf&nbsp; dhcpd.conf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX dhcp]# mv dhcpd.conf dhcpd.conf.bak242<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX dhcp]# mv dhcpd001.conf dhcpd.conf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX ~ 22:36]#vi \/etc\/dhcp\/dhcpd.conf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX ~ 22:38]#cat \/etc\/dhcp\/dhcpd.conf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># dhcpd.conf<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># Sample configuration file for ISC dhcpd<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># option definitions common to all supported networks&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">option routers 192.168.242.1;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">option subnet-mask 255.255.255.0;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">option domain-name &#8220;example.org&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">option domain-name-servers ns1.example.org, ns2.example.org;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">default-lease-time 600;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">max-lease-time 7200;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">subnet 192.168.242.0 netmask 255.255.255.0 {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">range 192.168.242.100192.168.242.150;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">range 192.168.242.180192.168.242.240;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX ~ 22:38]#service dhcpd start<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX ~ 22:39]#service dhcpd status<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">dhcpd (pid&nbsp; 3497) \u6b63\u5728\u8fd0\u884c&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX ~ 22:39]#<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[root@BenX ~ 22:39]#cat \/var\/lib\/dhcpd\/dhcpd.leases<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># The format of this file is documented in the dhcpd.leases(5) manual page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># This lease file was written by isc-dhcp-4.1.1-P1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">server-duid &#8220;\\000\\001\\000\\001)\\313GO\\000\\014)\\212\\322]&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">lease 192.168.242.100 {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; starts 1 2022\/03\/21 14:25:46;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; ends 1 2022\/03\/21 14:35:46;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; cltt 1 2022\/03\/21 14:25:46;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; binding state active;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; next binding state free;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; hardware ethernet 00:50:56:c0:00:08;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; uid &#8220;\\001\\000PV\\300\\000\\010&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; client-hostname &#8220;Ben&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">lease 192.168.242.101 {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; starts 1 2022\/03\/21 14:29:11;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; ends 1 2022\/03\/21 14:39:11;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; cltt 1 2022\/03\/21 14:29:11;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; binding state active;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; next binding state free;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; hardware ethernet 00:0c:29:4b:70:fc;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; uid &#8220;\\001\\000\\014)Kp\\374&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp; client-hostname &#8220;ks3&#8221;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">}<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/a1.qpic.cn\/psc?\/V11gmrL81dwXIQ\/bqQfVz5yrrGYSXMvKr.cqTk99pwT6hv6S7KfP3yiS7WDBbRmrVdW.QZYM7llCuvowwz.BQfeHH.g7sJkqM82vv1b0lw0wTFcD3l3fOBZmh8!\/b&amp;ek=1&amp;kp=1&amp;pt=0&amp;bo=yQL*AckC*wERECc!&amp;t=5&amp;tl=3&amp;su=0141782703&amp;tm=1788310800&amp;dis_t=1788312876&amp;dis_k=a8c13a2f5702ef25ec4e148f995415c1&amp;sce=0-12-12&amp;rf=0-2-9\" alt=\"\u56fe\u7247\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/a1.qpic.cn\/psc?\/V11gmrL81dwXIQ\/bqQfVz5yrrGYSXMvKr.cqVN*aPI37*G2Ee3.bWF*mbC9Uv2p.zhwDhJpEez4yK0ylWc4fRKzRksNegZ9uky6YyGbUoDTLwczDOUBrJbtGv0!\/b&amp;ek=1&amp;kp=1&amp;pt=0&amp;bo=FgPBAhYDwQIRECc!&amp;t=5&amp;tl=3&amp;su=0806623&amp;tm=1788310800&amp;dis_t=1788312876&amp;dis_k=165f773249d42f386ad554d233c95470&amp;sce=0-12-12&amp;rf=0-2-9\" alt=\"\u56fe\u7247\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8c\u3001dhcp\u670d\u52a1\u5b89\u88c5 [root@BenX \/]# yum install -y dhcp Loaded pl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":21,"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions\/21"}],"wp:attachment":[{"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiayanxi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}