{"id":97,"date":"2010-12-10T22:58:32","date_gmt":"2010-12-10T14:58:32","guid":{"rendered":"http:\/\/www.microwolf.net\/?p=97"},"modified":"2010-12-10T23:17:15","modified_gmt":"2010-12-10T15:17:15","slug":"linux-%e9%85%8d%e7%bd%aedhcp%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"http:\/\/www.microwolf.net\/?p=97","title":{"rendered":"Linux \u914d\u7f6eDHCP\u670d\u52a1\u5668"},"content":{"rendered":"<table border=\"0\" width=\"100%\">\n<tr>\n<td width=\"100%\">\u3000\u3000Redhat\u4f7f\u7528dhcpd\u8fdb\u7a0b\u63d0\u4f9bDHCP\u670d\u52a1\uff0c\u542f\u52a8\u65f6dhcpd\u81ea\u52a8\u8bfb\u5b83\u7684\u914d\u7f6e\u6587\u4ef6\/etc\/dhcpd.conf\u3002dhcpd\u5c06\u5ba2\u6237\u7684\u79df\u7528\u4fe1\u606f\u4fdd\u5b58\u5728\/var\/lib\/dhcp\/dhcpd.leases\u6587\u4ef6\u4e2d\uff0c\u8be5\u6587\u4ef6\u4e0d\u65ad\u88ab\u66f4\u65b0\uff0c\u4ece\u8fd9\u91cc\u9762\u53ef\u4ee5\u67e5\u5230IP\u5730\u5740\u5206\u914d\u7684\u60c5\u51b5\u3002<\/p>\n<p>      \u3000\u3000dhcpd\u4e3a\u4e86\u5411\u4e00\u4e2a\u5b50\u7f51\u63d0\u4f9b\u670d\u52a1\uff0c\u9700\u8981\u77e5\u9053\u5b50\u7f51\u7684\u7f51\u7edc\u5730\u5740\u548c\u7f51\u7edc\u63a9\u7801\uff0c\u5e76\u4e14\u8fd8\u8981\u77e5\u9053\u5730\u5740\u5206\u914d\u7684\u8303\u56f4\uff0c\u4e0b\u9762\u7ed9\u51fa\u4e00\u4e2a\u7b80\u5355\u7684dhcpd.conf\u6587\u4ef6\uff1a<\/p>\n<p>      \u3000\u3000subnet 192.168.100.0 netmask 255.255.255.0 {<\/p>\n<p>      \u3000\u3000range 192.168.100.10 192.168.100.253;<\/p>\n<p>      \u3000\u3000}<\/p>\n<p>      \u3000\u3000\u6b64\u4f8b\u4e2d\uff0cdhcpd\u5c06\u7ed9192.168.100.0\u7f51\u7edc\u5206\u914d192.168.100.10\u5230192.168.100.253\u7684IP\u5730\u5740\u3002<\/p>\n<p>      \u3000\u3000\u79df\u671f\u65f6\u95f4\u53ef\u4ee5\u4ece0\u79d2\u5230\u65e0\u9650\u957f\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u6765\u5b9a\u3002\u7f3a\u7701\u7684\u79df\u671f\u65f6\u95f4\u4e3a\u4e00\u5929\uff0c\u537386400\u79d2\u3002\u53ef\u4ee5\u4e3a\u4e3b\u673a\u5b9a\u4e49\u4e24\u4e2a\u79df\u671f\u957f\u5ea6\uff1a<\/p>\n<p>      \u3000\u3000default-lease-time \u9ed8\u8ba4\u79df\u671f\u65f6\u95f4\uff1b<\/p>\n<p>      \u3000\u3000max-lease-time \u7528\u6237\u53ef\u4ee5\u83b7\u5f97\u7684\u6700\u957f\u79df\u671f\u65f6\u95f4\u3002<\/p>\n<p>      \u3000\u3000\u4e0b\u9762\u7684\u914d\u7f6e\u5c06\u7f3a\u7701\u7684\u79df\u671f\u65f6\u95f4\u8bbe\u7f6e\u4e3a10\u5206\u949f\uff0c\u6700\u957f\u79df\u7528\u65f6\u95f4\u4e3a1\u5c0f\u65f6\uff1a<\/p>\n<p>      \u3000\u3000subnet 192.168.100.0 netmask 255.255.255.0 {<\/p>\n<p>      \u3000\u3000 range 192.168.100.10 192.168.100.253;<\/p>\n<p>      \u3000\u3000 default-lease-time 600;<\/p>\n<p>      \u3000\u3000 max-lease-time 3600;<\/p>\n<p>      \u3000\u3000}<\/p>\n<p>      \u3000\u3000DHCP\u8fd8\u53ef\u4ee5\u5411\u5ba2\u6237\u63d0\u4f9b\u66f4\u591a\u7684\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u7528option\u6765\u6307\u5b9a\uff0c\u4f8b\u5982\uff1a<\/p>\n<p>      \u3000\u3000subnet 192.168.100.0 netmask 255.255.255.0 {<\/p>\n<p>      \u3000\u3000range 192.168.100.10 192.168.100.253;<\/p>\n<p>      \u3000\u3000 default-lease-time 600;<\/p>\n<p>      \u3000\u3000 max-lease-time 3600;<\/p>\n<p>      \u3000\u3000 option subnet-mask 255.255.255.0;<\/p>\n<p>      \u3000\u3000 option routers 192.168.100.254; \u9ed8\u8ba4\u8def\u7531<\/p>\n<p>      \u3000\u3000 option domain-name-servers 202.102.134.68; DNS\u670d\u52a1\u5668<\/p>\n<p>      \u3000\u3000}<\/p>\n<p>\u6709\u4e9b\u9009\u9879\u4e5f\u53ef\u4ee5\u5728\u4f5c\u7528\u57df\u4e4b\u5916\u4f7f\u7528\u6210\u4e3a\u5168\u5c40\u4f5c\u7528\u9879<\/p>\n<p>default-lease-time 86400;<br \/> <br \/>\n      max-lease-time 864000;<br \/> <br \/>\n      ddns-update-style interim;<br \/> <br \/>\n      option domain-name-servers 218.2.135.1, 202.102.24.35, 202.96.199.132, 202.96.199.133, 202.96.209.5, 202.96.209.133;<br \/> <br \/>\n      option netbios-name-servers 192.168.0.10, 192.168.0.11;<br \/>\n      option netbios-node-type 8;<\/p>\n<p>\n      subnet 192.168.1.0 netmask 255.255.255.0 {<br \/> <br \/>\n        range 192.168.1.10 192.168.1.250;<br \/> <br \/>\n        option subnet-mask 255.255.255.0;<br \/> <br \/>\n        option broadcast-address 192.168.1.255;<br \/> <br \/>\n        option routers 192.168.1.1;<br \/> <br \/>\n      }<\/p>\n<p>\n      \u8981\u542f\u52a8DHCPd\uff0c \u7b80\u5355\u5730\u952e\u5165 \/usr\/sbin\/dhcpd \u6216\u7528ntsysv \u628aDHCPd\u670d\u52a1\u81ea\u52a8\u542f\u52a8\uff0c\u4e5f\u53ef\u4ee5\u7528<\/p>\n<p>      \/etc\/rc.d\/init.d\/dhcpd start\uff0c<\/p>\n<p>      \u8fd9\u6837\u542f\u52a8\u540e\uff0cDHCPd\u662f\u542f\u52a8\u5728eth0 \u4e0a\uff0c\u5982\u679cDHCPd\u4e0a\u7684\u670d\u52a1\u5668\u8fd8\u6709\u53e6\u5916\u4e00\u5757\u7f51\u5361eth1\uff0c \u60f3\u5728eth1\u4e0a\u542f\u52a8<\/p>\n<p>      dhcpd\uff0c\u5c31\u952e\u5165<\/p>\n<p>      #\/usr\/sbin\/dhcpd eth1<br \/> \n      <\/p>\n<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3000Redhat\u4f7f\u7528dhcpd\u8fdb\u7a0b\u63d0\u4f9bDHCP\u670d\u52a1\uff0c\u542f\u52a8\u65f6dhcpd\u81ea\u52a8\u8bfb\u5b83\u7684\u914d\u7f6e\u6587\u4ef6\/etc\/dhcpd.c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/www.microwolf.net\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"http:\/\/www.microwolf.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.microwolf.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.microwolf.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.microwolf.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":2,"href":"http:\/\/www.microwolf.net\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":118,"href":"http:\/\/www.microwolf.net\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions\/118"}],"wp:attachment":[{"href":"http:\/\/www.microwolf.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.microwolf.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.microwolf.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}