{"id":110689,"date":"2026-09-29T08:16:56","date_gmt":"2026-09-29T00:16:56","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/110689.html"},"modified":"2026-09-29T08:16:56","modified_gmt":"2026-09-29T00:16:56","slug":"linux%e8%bf%90%e7%bb%b4%ef%bc%9aselinux%e3%80%81dhcp%e3%80%81dns-%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/110689.html","title":{"rendered":"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218"},"content":{"rendered":"<h2>SELinux\u3001DHCP\u3001DNS \u5b9e\u6218<\/h2>\n<h3>SELinux<\/h3>\n<p>SELinux \u662f\u4f20\u7edfrwx\u81ea\u4e3b\u8bbf\u95ee\u63a7\u5236(DAC)\u4e4b\u5916&#xff0c;\u589e\u52a0\u7684\u5f3a\u5236\u8bbf\u95ee\u63a7\u5236MAC\u5b89\u5168\u5c42\u3002<br \/>\nDAC&#xff1a;\u7531\u6587\u4ef6\u5c5e\u4e3b\u51b3\u5b9a\u6743\u9650&#xff1b;MAC&#xff1a;\u7cfb\u7edf\u7b56\u7565\u5f3a\u5236\u7ba1\u63a7&#xff0c;\u9ed8\u8ba4\u62d2\u7edd&#xff0c;\u53ea\u6709\u7b56\u7565\u663e\u5f0f\u5141\u8bb8\u624d\u53ef\u4ee5\u8bbf\u95ee\u3002<br \/>\n\u6838\u5fc3\u76ee\u6807&#xff1a;\u9632\u6b62\u88ab\u5165\u4fb5\u7684\u670d\u52a1\u8fdb\u7a0b\u8d8a\u6743\u8bbf\u95ee\u7cfb\u7edf\u5176\u4ed6\u6570\u636e\u3002<\/p>\n<h4>SELinux\u4e0a\u4e0b\u6587&#xff08;\u6807\u7b7e&#xff09;<\/h4>\n<p>\u6bcf\u4e2a\u8fdb\u7a0b\u3001\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u7aef\u53e3\u90fd\u62e5\u6709SELinux\u4e0a\u4e0b\u6587&#xff08;\u5b89\u5168\u6807\u7b7e&#xff09;<br \/>\n\u683c\u5f0f&#xff1a;user:role:type:level<\/p>\n<ul>\n<li>user&#xff1a;selinux\u7528\u6237<\/li>\n<li>role&#xff1a;\u89d2\u8272&#xff1b;\u6587\u4ef6\/\u76ee\u5f55\u89d2\u8272\u56fa\u5b9a\u662fobject_r&#xff1b;\u8fdb\u7a0b\u662fxxx_r<\/li>\n<li>type&#xff08;\u6700\u91cd\u8981&#xff0c;\u8003\u8bd5\u91cd\u70b9&#xff0c;\u4ee5_t\u7ed3\u5c3e&#xff09;&#xff1a;\u7b56\u7565\u4e3b\u8981\u4f9d\u9760type\u505a\u8bbf\u95ee\u63a7\u5236<\/li>\n<li>level&#xff1a;\u5b89\u5168\u7ea7\u522b&#xff0c;MLS&#xff0c;RHCSA\u57fa\u672c\u4e0d\u8003<\/li>\n<\/ul>\n<p>\u793a\u4f8b<\/p>\n<p><span class=\"token comment\">#\u8fdb\u7a0b\u4e0a\u4e0b\u6587<\/span><br \/>\nsystem_u:system_r:sshd_t:s0\u2011s0:c0.c1023<br \/>\n<span class=\"token comment\">#\u6587\u4ef6\u4e0a\u4e0b\u6587<\/span><br \/>\nunconfined_u:object_r:user_home_dir_t:s0<\/p>\n<p>\u91cd\u8981\u7406\u89e3&#xff1a;\u4e0d\u662ftype\u76f8\u540c\u624d\u53ef\u4ee5\u8bbf\u95ee&#xff0c;\u770b\u7b56\u7565\u89c4\u5219\u662f\u5426\u5141\u8bb8\u67d0\u8fdb\u7a0btype\u8bbf\u95ee\u67d0\u6587\u4ef6type<br \/>\n\u4f8b&#xff1a;httpd_t(apache\u8fdb\u7a0b)&#xff0c;\u7b56\u7565\u5141\u8bb8\u8bfb\u53d6httpd_sys_content_t&#xff1b;\u62d2\u7edd\u8bfb\u53d6tmp_t(\/tmp\u76ee\u5f55)&#xff0c;\u54ea\u6015\u6587\u4ef6777\u4e5f\u4f1a\u62e6\u622a\u3002<\/p>\n<h5>-Z \u53c2\u6570\u67e5\u770b\u6807\u7b7e<\/h5>\n<p><span class=\"token function\">ps<\/span> <span class=\"token parameter variable\">-Z<\/span>        <span class=\"token comment\">#\u67e5\u770b\u8fdb\u7a0bselinux\u4e0a\u4e0b\u6587<\/span><br \/>\n<span class=\"token function\">ls<\/span> <span class=\"token parameter variable\">-Z<\/span>        <span class=\"token comment\">#\u67e5\u770b\u6587\u4ef6\/\u76ee\u5f55selinux\u4e0a\u4e0b\u6587<\/span><br \/>\nll <span class=\"token parameter variable\">-Z<\/span>        <span class=\"token comment\">#\u540c\u65f6\u770b\u666e\u901a\u6743\u9650&#043;selinux\u6807\u7b7e<\/span><\/p>\n<h4>SELinux\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f<\/h4>\n<table>\n<tr>\u6a21\u5f0f\u884c\u4e3a<\/tr>\n<tbody>\n<tr>\n<td>enforcing&#xff08;\u5f3a\u5236&#xff09;<\/td>\n<td>\u52a0\u8f7d\u7b56\u7565&#xff0c;\u8fdd\u53cd\u7b56\u7565\u76f4\u63a5\u62d2\u7edd\u8bbf\u95ee&#xff0c;\u8bb0\u5f55AVC\u5ba1\u8ba1\u65e5\u5fd7&#xff08;\u751f\u4ea7\u63a8\u8350&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>permissive&#xff08;\u5bbd\u5bb9&#xff09;<\/td>\n<td>\u52a0\u8f7d\u7b56\u7565&#xff0c;\u4e0d\u62e6\u622a\u64cd\u4f5c&#xff0c;\u53ea\u8bb0\u5f55AVC\u65e5\u5fd7&#xff0c;\u7528\u4e8e\u6392\u9519<\/td>\n<\/tr>\n<tr>\n<td>disabled&#xff08;\u5b8c\u5168\u5173\u95ed&#xff09;<\/td>\n<td>\u5185\u6838\u4e0d\u52a0\u8f7dSELinux\u7b56\u7565&#xff1b;\u8fdb\u7a0b\u65e0selinux\u6807\u7b7e&#xff0c;ps -Z\u663e\u793a\u2011&#xff1b;\u78c1\u76d8\u4e0a\u6587\u4ef6\u6807\u7b7e\u4f1a\u4fdd\u7559&#xff0c;ls -Z\u4f9d\u65e7\u53ef\u4ee5\u770b\u5230<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>getenforce                     <span class=\"token comment\">#\u67e5\u770b\u5f53\u524dselinux\u6a21\u5f0f<\/span><br \/>\nsestatus                       <span class=\"token comment\">#\u5b8c\u6574selinux\u72b6\u6001\u4fe1\u606f<\/span><\/p>\n<p>setenforce <span class=\"token number\">1<\/span> \/ setenforce Enforcing    <span class=\"token comment\">#\u4e34\u65f6\u5207\u6362\u5f3a\u5236\u6a21\u5f0f<\/span><br \/>\nsetenforce <span class=\"token number\">0<\/span> \/ setenforce Permissive   <span class=\"token comment\">#\u4e34\u65f6\u5207\u6362\u5bbd\u5bb9\u6a21\u5f0f<\/span><\/p>\n<p>\u26a0\ufe0fsetenforce\u9650\u5236&#xff1a;\u4ec5\u80fd\u5728 enforcing \u2194 permissive \u4e4b\u95f4\u5207\u6362&#xff1b;\u5982\u679c\u662fdisabled&#xff0c;setenforce\u547d\u4ee4\u76f4\u63a5\u62a5\u9519&#xff1a;setenforce: SELinux is disabled<\/p>\n<p>\u6c38\u4e45\u914d\u7f6e\u6587\u4ef6&#xff1a;\/etc\/selinux\/config<\/p>\n<p>SELINUX&#061;enforcing      # enforcing \/ permissive \/ disabled<br \/>\nSELINUXTYPE&#061;targeted   # \u9ed8\u8ba4targeted\u7b56\u7565&#xff0c;\u53ea\u7ba1\u63a7\u7f51\u7edc\u670d\u52a1<\/p>\n<ul>\n<li>enforcing \u2194 permissive&#xff1a;setenforce\u4e34\u65f6\u5207\u6362&#xff0c;\u4e0d\u9700\u8981\u4fee\u6539\u914d\u7f6e\u3001\u4e0d\u9700\u8981\u91cd\u542f&#xff0c;\u91cd\u542f\u4f1a\u8fd8\u539f\u4e3a\u914d\u7f6e\u6587\u4ef6\u5b9a\u4e49\u7684\u6a21\u5f0f<\/li>\n<li>disabled &lt;\u2011\u2011&gt; enforcing\/permissive&#xff1a;\u5fc5\u987b\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 &#043; \u91cd\u542f\u7cfb\u7edf<\/li>\n<\/ul>\n<p>\u6ce8\u610f&#xff1a;disabled\u5207\u6362\u5230enforcing\/permissive&#xff0c;\u91cd\u542f\u7cfb\u7edf\u4f1a\u5168\u76d8\u81ea\u52a8\u91cd\u65b0\u6253SELinux\u6807\u7b7e&#xff0c;\u5f00\u673a\u65f6\u95f4\u53d8\u957f&#xff0c;\u4e0d\u53ef\u65ad\u7535\u3002<\/p>\n<h4>\u4fee\u6539SELinux\u6587\u4ef6\u4e0a\u4e0b\u6587\u6807\u7b7e<\/h4>\n<li>chcon&#xff1a;\u4e34\u65f6\u4fee\u6539\u6807\u7b7e&#xff1b;\u79fb\u52a8\u6587\u4ef6\u3001restorecon\u6267\u884c\u540e\u6807\u7b7e\u4f1a\u590d\u539f&#xff0c;\u91cd\u542f\u4e0d\u4fdd\u5b58<\/li>\n<p>chcon <span class=\"token parameter variable\">-t<\/span> httpd_sys_content_t \/web\/index.html<\/p>\n<li>semanage fcontext&#xff1a;\u5199\u5165selinux\u6570\u636e\u5e93&#xff0c;\u6c38\u4e45\u5b9a\u4e49\u9ed8\u8ba4\u6807\u7b7e&#xff0c;\u5199\u5b8c\u5fc5\u987b\u6267\u884crestorecon\u751f\u6548<\/li>\n<p>semanage fcontext <span class=\"token parameter variable\">-a<\/span> <span class=\"token parameter variable\">-t<\/span> httpd_sys_content_t <span class=\"token string\">&#034;\/web(\/.*)?&#034;<\/span><br \/>\nrestorecon <span class=\"token parameter variable\">-Rv<\/span> \/web<\/p>\n<p>restorecon&#xff1a;\u8bfb\u53d6semanage\u6570\u636e\u5e93&#xff0c;\u6062\u590d\u76ee\u5f55\/\u6587\u4ef6\u7684\u9ed8\u8ba4selinux\u6807\u7b7e\u3002<\/p>\n<p>\u590d\u5236\u79fb\u52a8\u6587\u4ef6\u5c0f\u8003\u70b9<\/p>\n<ul>\n<li>cp\u590d\u5236\u6587\u4ef6&#xff1a;\u65b0\u6587\u4ef6\u7ee7\u627f\u76ee\u6807\u76ee\u5f55\u7684selinux\u6807\u7b7e<\/li>\n<li>mv\u79fb\u52a8\u6587\u4ef6&#xff1a;\u4fdd\u7559\u6587\u4ef6\u539f\u6765\u7684selinux\u6807\u7b7e&#xff0c;\u4e0d\u4f1a\u7ee7\u627f\u76ee\u6807\u76ee\u5f55<\/li>\n<\/ul>\n<h4>SELinux\u5e03\u5c14\u503c boolean<\/h4>\n<p>\u5e03\u5c14\u503c\u662f\u7b56\u7565\u5f00\u5173&#xff0c;on\/off&#xff0c;\u5feb\u901f\u653e\u5f00\u9650\u5236&#xff0c;\u4e0d\u7528\u5199\u590d\u6742\u7b56\u7565\u3002<\/p>\n<p>getsebool <span class=\"token parameter variable\">-a<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> http<br \/>\nsetsebool <span class=\"token parameter variable\">-P<\/span> httpd_can_network_connect on<\/p>\n<p>-P\u4ee3\u8868permanent\u6c38\u4e45&#xff1b;\u4e0d\u52a0\u2011P&#xff0c;\u4fee\u6539\u4e34\u65f6\u751f\u6548&#xff0c;\u91cd\u542f\u5931\u6548\u3002<\/p>\n<h4>SELinux\u7aef\u53e3\u6807\u7b7e<\/h4>\n<p>SELinux\u9650\u5236\u670d\u52a1\u76d1\u542c\u7aef\u53e3&#xff0c;\u4f8b\u5982http\u9ed8\u8ba4\u53ea\u5141\u8bb8http_port_t\u7c7b\u578b\u7aef\u53e3\u3002<\/p>\n<p>semanage port <span class=\"token parameter variable\">-l<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> http                     <span class=\"token comment\">#\u67e5\u770b\u7aef\u53e3\u6807\u7b7e<\/span><br \/>\nsemanage port <span class=\"token parameter variable\">-a<\/span> <span class=\"token parameter variable\">-t<\/span> http_port_t <span class=\"token parameter variable\">-p<\/span> tcp <span class=\"token number\">8080<\/span>      <span class=\"token comment\">#\u6dfb\u52a0\u7aef\u53e3\u6807\u7b7e<\/span><br \/>\nsemanage port <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">-t<\/span> http_port_t <span class=\"token parameter variable\">-p<\/span> tcp <span class=\"token number\">8080<\/span>      <span class=\"token comment\">#\u5220\u9664\u7aef\u53e3\u6807\u7b7e<\/span><\/p>\n<h4>SELinux\u6392\u9519<\/h4>\n<p>ausearch <span class=\"token parameter variable\">-m<\/span> AVC <span class=\"token parameter variable\">-ts<\/span> recent           <span class=\"token comment\">#\u67e5\u770bavc\u62d2\u7edd\u65e5\u5fd7<\/span><br \/>\nsealert <span class=\"token parameter variable\">-a<\/span> \/var\/log\/audit\/audit.log  <span class=\"token comment\">#\u5206\u6790selinux\u95ee\u9898\u62a5\u544a<\/span><\/p>\n<p>\u6392\u9519\u601d\u8def&#xff1a;\u8bbf\u95ee\u88ab\u62e6\u622a \u2192 setenforce 0\u6d4b\u8bd5&#xff1b;\u6062\u590d\u6b63\u5e38\u8bf4\u660e\u662fSELinux\u95ee\u9898&#xff0c;\u6392\u67e5\u6807\u7b7e\/\u5e03\u5c14\/\u7aef\u53e3\u3002<\/p>\n<p>DAC\u4e0eMAC\u68c0\u67e5\u987a\u5e8f&#xff1a;\u5148\u68c0\u67e5\u4f20\u7edfrwx(DAC)&#xff0c;DAC\u62d2\u7edd\u76f4\u63a5\u62e6\u622a&#xff1b;DAC\u653e\u884c\u540e\u624d\u68c0\u67e5SELinux(MAC)<\/p>\n<hr \/>\n<h2>DHCP<\/h2>\n<p>DHCP&#xff08;Dynamic Host Configuration Protocol&#xff09;\u52a8\u6001\u4e3b\u673a\u914d\u7f6e\u534f\u8bae\u3002\u81ea\u52a8\u7ed9\u5ba2\u6237\u7aef\u4e0b\u53d1IP\u3001\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS\u3001\u57df\u540d\u641c\u7d22\u57df\u3002<\/p>\n<ul>\n<li>\u7aef\u53e3&#xff1a;\u670d\u52a1\u5668UDP 67&#xff0c;\u5ba2\u6237\u7aefUDP 68<\/li>\n<li>\u5e7f\u64ad\u62a5\u6587&#xff0c;\u8def\u7531\u5668\u9ed8\u8ba4\u4e0d\u8f6c\u53d1DHCP\u5e7f\u64ad&#xff1b;\u8de8\u7f51\u6bb5\u9700\u8981DHCP\u4e2d\u7ee7dhcrelay\u3002<\/li>\n<\/ul>\n<h3>DORA \u56db\u6b65\u5de5\u4f5c\u6d41\u7a0b<\/h3>\n<li>Discover \u53d1\u73b0&#xff1a;\u5ba2\u6237\u7aef\u65e0IP&#xff0c;\u5e7f\u64adDHCPDISCOVER&#xff0c;\u5168\u7f51\u5bfb\u627eDHCP\u670d\u52a1\u5668<\/li>\n<li>Offer \u63d0\u4f9b&#xff1a;DHCP\u670d\u52a1\u5668\u56de\u590dDHCPOFFER&#xff0c;\u643a\u5e26\u7a7a\u95f2IP\u3001\u79df\u671f\u3001\u7f51\u7edc\u53c2\u6570&#xff0c;\u5e7f\u64ad\u53d1\u7ed9\u5ba2\u6237\u7aef<\/li>\n<li>Request \u8bf7\u6c42&#xff1a;\u5ba2\u6237\u7aef\u5e7f\u64adDHCPREQUEST&#xff0c;\u6b63\u5f0f\u7533\u8bf7\u67d0\u4e2a\u670d\u52a1\u5668\u63d0\u4f9b\u7684IP&#xff1b;\u7f51\u7edc\u591a\u53f0DHCP\u670d\u52a1\u5668\u65f6&#xff0c;\u5ba2\u6237\u7aef\u53ea\u9009\u7528\u5176\u4e2d\u4e00\u53f0\u3002<\/li>\n<li>Ack \u786e\u8ba4&#xff1a;DHCP\u670d\u52a1\u5668\u56de\u590dDHCPACK&#xff0c;\u786e\u8ba4\u79df\u7ea6&#xff0c;\u4e0b\u53d1\u5b8c\u6574\u7f51\u7edc\u53c2\u6570\u3002<\/li>\n<h3>\u79df\u7ea6\u673a\u5236<\/h3>\n<li>\u79df\u671f\u5230\u8fbe 50%&#xff1a;\u5ba2\u6237\u7aef\u5355\u64ad\u5411\u539fDHCP\u670d\u52a1\u5668\u7eed\u79df<\/li>\n<li>\u79df\u671f\u5230\u8fbe 87.5%&#xff1a;\u7eed\u79df\u5931\u8d25&#xff0c;\u5168\u7f51\u5e7f\u64ad&#xff0c;\u5411\u4efb\u610fDHCP\u670d\u52a1\u5668\u7533\u8bf7\u5730\u5740<\/li>\n<li>\u79df\u7ea6\u5230\u671f\u672a\u7eed\u7ea6&#xff0c;IP\u91ca\u653e\u3002<\/li>\n<p>\u5ba2\u6237\u7aef\u83b7\u53d6\u4e0d\u5230DHCP\u5730\u5740&#xff0c;\u81ea\u52a8\u5206\u914dAPIPA\u5730\u5740 169.254.0.0\/16\u3002<\/p>\n<h3>DHCP\u670d\u52a1\u5668\u90e8\u7f72&#xff08;ISC dhcpd&#xff09;<\/h3>\n<h4>\u5b89\u88c5<\/h4>\n<p>yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> dhcp<\/p>\n<h4>\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>\u4e3b\u914d\u7f6e\u6587\u4ef6&#xff1a;\/etc\/dhcp\/dhcpd.conf&#xff0c;\u9ed8\u8ba4\u662f\u7a7a&#xff0c;\u590d\u5236\u793a\u4f8b\u6a21\u677f<\/p>\n<p><span class=\"token function\">cp<\/span> \/usr\/share\/doc\/dhcp*\/dhcpd.conf.example \/etc\/dhcp\/dhcpd.conf<\/p>\n<p>\u57fa\u7840\u914d\u7f6e\u793a\u4f8b<\/p>\n<p>authoritative;                 #\u6743\u5a01DHCP\u670d\u52a1\u5668<br \/>\nsubnet 10.1.8.0 netmask 255.255.255.0 {<br \/>\n  range 10.1.8.101 10.1.8.130;          #\u52a8\u6001\u5206\u914dIP\u5730\u5740\u6c60<br \/>\n  option domain-name-servers 223.5.5.5; #\u4e0b\u53d1DNS\u670d\u52a1\u5668<br \/>\n  option domain-name &#034;laoma.cloud&#034;;     #\u57df\u540d\u540e\u7f00<br \/>\n  option routers 10.1.8.2;              #\u9ed8\u8ba4\u7f51\u5173<br \/>\n  option broadcast-address 10.1.8.255;  #\u5e7f\u64ad\u5730\u5740<br \/>\n  default-lease-time 600;              #\u9ed8\u8ba4\u79df\u7ea6&#xff0c;\u5355\u4f4d\u79d2<br \/>\n  max-lease-time 7200;                 #\u5ba2\u6237\u7aef\u53ef\u8bf7\u6c42\u6700\u5927\u79df\u7ea6&#xff0c;\u5355\u4f4d\u79d2<br \/>\n}<br \/>\n#MAC\u5730\u5740\u7ed1\u5b9a\u56fa\u5b9aIP&#xff08;\u4fdd\u7559\u5730\u5740&#xff09;<br \/>\nhost client {<br \/>\n  hardware ethernet 00:0c:29:26:13:b5;<br \/>\n  fixed-address 10.1.8.30;<br \/>\n}<\/p>\n<p>\u6ce8\u610f&#xff1a;\u6bcf\u4e00\u884c\u672b\u5c3e\u5fc5\u987b\u5206\u53f7;&#xff0c;\u7f3a\u5c11\u5206\u53f7dhcpd\u542f\u52a8\u5931\u8d25\u3002<br \/>\nfixed\u2011address\u4fdd\u7559IP&#xff1a;\u53ef\u4ee5\u4e0d\u5728range\u5730\u5740\u6c60\u5185&#xff0c;\u4f46\u5fc5\u987b\u5c5e\u4e8e\u672c\u5b50\u7f51\u7f51\u6bb5\u3002<\/p>\n<h4>\u8bed\u6cd5\u6821\u9a8c\u3001\u542f\u52a8\u3001\u9632\u706b\u5899<\/h4>\n<p>dhcpd <span class=\"token parameter variable\">-t<\/span>                                  <span class=\"token comment\">#\u6821\u9a8cdhcp\u914d\u7f6e\u8bed\u6cd5<\/span><br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> <span class=\"token parameter variable\">&#8211;now<\/span> dhcpd<br \/>\nfirewall\u2011cmd &#8211;add\u2011service<span class=\"token operator\">&#061;<\/span>dhcp <span class=\"token parameter variable\">&#8211;permanent<\/span><br \/>\nfirewall\u2011cmd <span class=\"token parameter variable\">&#8211;reload<\/span><\/p>\n<p>\u79df\u7ea6\u6570\u636e\u5e93&#xff0c;\u8bb0\u5f55\u5df2\u7ecf\u5206\u914d\u51fa\u53bb\u7684IP\u3001MAC\u3001\u79df\u671f<\/p>\n<p><span class=\"token function\">cat<\/span> \/var\/lib\/dhcpd\/dhcpd.leases<\/p>\n<h3>DHCP\u5ba2\u6237\u7aef<\/h3>\n<p>\u7f51\u5361\u8bbe\u7f6eBOOTPROTO&#061;dhcp\u81ea\u52a8\u83b7\u53d6IP<\/p>\n<p>dhclient <span class=\"token parameter variable\">-r<\/span> ens35          <span class=\"token comment\">#\u91ca\u653eIP<\/span><br \/>\ndhclient <span class=\"token parameter variable\">-v<\/span> ens35          <span class=\"token comment\">#\u91cd\u65b0\u5411dhcp\u670d\u52a1\u5668\u7533\u8bf7IP<\/span><\/p>\n<p><span class=\"token comment\">#nmcli\u8bbe\u7f6edhcp\u83b7\u53d6<\/span><br \/>\nnmcli connection modify ens35 ipv4.method auto<br \/>\nnmcli connection up ens35<\/p>\n<h3>DHCP\u4e2d\u7ee7 dhcrelay<\/h3>\n<p>\u5ba2\u6237\u7aef\u4e0eDHCP\u670d\u52a1\u5668\u4e0d\u5728\u540c\u4e00\u4e2a\u7f51\u6bb5&#xff0c;\u8def\u7531\u5668\u4e0d\u8f6c\u53d1DHCP\u5e7f\u64ad&#xff0c;\u9700\u8981\u4e2d\u7ee7\u4ee3\u7406\u8f6c\u53d1\u62a5\u6587\u3002<\/p>\n<p>yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> dhcp<br \/>\ndhcrelay <span class=\"token number\">10.1<\/span>.8.10     <span class=\"token comment\">#\u6307\u5411DHCP\u670d\u52a1\u5668IP<\/span><br \/>\nsystemctl <span class=\"token builtin class-name\">enable<\/span> <span class=\"token parameter variable\">&#8211;now<\/span> dhcrelay<\/p>\n<h4>DHCP\u9ad8\u9891\u8003\u70b9\u5751<\/h4>\n<li>dhcpd\u670d\u52a1\u53ea\u4f1a\u76d1\u542c\u672c\u673a\u548csubnet\u540c\u7f51\u6bb5\u7f51\u5361&#xff1b;\u670d\u52a1\u5668\u7f51\u5361\u5fc5\u987b\u62e5\u6709\u8be5\u7f51\u6bb5IP&#xff0c;\u5426\u5219dhcpd\u542f\u52a8\u5931\u8d25\u3002<\/li>\n<li>authoritative&#xff1b;\u6743\u5a01\u670d\u52a1\u5668&#xff1b;\u975e\u6743\u5a01\u670d\u52a1\u5668\u6536\u5230\u672a\u77e5\u5ba2\u6237\u7aef\u8bf7\u6c42\u4f1a\u5ffd\u7565\u3002<\/li>\n<li>\u5ba2\u6237\u7aef\u62ff\u5230169.254.x.x&#xff1a;\u5ba2\u6237\u7aef\u65e0\u6cd5\u6536\u5230DHCP\u670d\u52a1\u5668\u56de\u590d&#xff08;\u9632\u706b\u5899\u3001\u7f51\u7edc\u4e0d\u901a\u3001dhcpd\u672a\u542f\u52a8\u3001\u914d\u7f6e\u9519\u8bef&#xff09;\u3002<\/li>\n<hr \/>\n<h2>DNS&#xff08;BIND named\u670d\u52a1&#xff09;<\/h2>\n<p>DNS&#xff1a;\u57df\u540d\u7cfb\u7edf&#xff0c;\u57df\u540d\u548cIP\u76f8\u4e92\u6620\u5c04\u7684\u5206\u5e03\u5f0f\u6570\u636e\u5e93\u3002<br \/>\n\u8f6f\u4ef6\u5305&#xff1a;<\/p>\n<ul>\n<li>bind&#xff1a;dns\u670d\u52a1\u7a0b\u5e8f&#xff0c;\u540e\u53f0\u8fdb\u7a0bnamed<\/li>\n<li>bind\u2011utils&#xff1a;\u6d4b\u8bd5\u5de5\u5177&#xff0c;dig\u3001host<br \/>\n\u7aef\u53e3&#xff1a;UDP\/TCP 53<\/li>\n<\/ul>\n<h3>DNS\u67e5\u8be2\u6a21\u5f0f<\/h3>\n<li>\u9012\u5f52\u67e5\u8be2&#xff1a;\u5ba2\u6237\u7aef\u628a\u67e5\u8be2\u4e22\u7ed9\u672c\u5730DNS\u670d\u52a1\u5668&#xff0c;DNS\u670d\u52a1\u5668\u66ff\u5ba2\u6237\u7aef\u5b8c\u6210\u5168\u90e8\u67e5\u8be2&#xff0c;\u8fd4\u56de\u6700\u7ec8\u7ed3\u679c&#xff1b;\u5ba2\u6237\u7aef\u5168\u7a0b\u7b49\u5f85\u3002\u666e\u901a\u5ba2\u6237\u7aef\u9ed8\u8ba4\u4f7f\u7528\u9012\u5f52\u3002<\/li>\n<li>\u8fed\u4ee3\u67e5\u8be2&#xff1a;\u5ba2\u6237\u7aef\u81ea\u5df1\u9010\u7ea7\u5411\u6839\u3001\u9876\u7ea7\u57df\u3001\u6743\u5a01\u670d\u52a1\u5668\u67e5\u8be2&#xff1b;dig &#043;trace\u6a21\u62df\u8fed\u4ee3\u67e5\u8be2\u5168\u8fc7\u7a0b\u3002<\/li>\n<p>\u6743\u5a01\u670d\u52a1\u5668\u6700\u4f73\u5b9e\u8df5&#xff1a;\u5173\u95ed\u9012\u5f52 recursion no;&#xff0c;\u9632\u6b62DNS\u653e\u5927\u653b\u51fb\u3002<\/p>\n<h3>DNS\u8d44\u6e90\u8bb0\u5f55\u901f\u67e5\u8868<\/h3>\n<table>\n<tr>\u8bb0\u5f55\u5168\u79f0\u4f5c\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>A<\/td>\n<td>\u5730\u5740\u8bb0\u5f55<\/td>\n<td>\u57df\u540d\u2192IPv4\u5730\u5740<\/td>\n<td>www IN A 10.1.8.10<\/td>\n<\/tr>\n<tr>\n<td>AAAA<\/td>\n<td>\u5730\u5740\u8bb0\u5f55<\/td>\n<td>\u57df\u540d\u2192IPv6\u5730\u5740<\/td>\n<td>www IN AAAA ::1<\/td>\n<\/tr>\n<tr>\n<td>CNAME<\/td>\n<td>\u522b\u540d\u8bb0\u5f55<\/td>\n<td>\u57df\u540d\u6307\u5411\u53e6\u4e00\u4e2a\u57df\u540d&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u5199IP<\/td>\n<td>web IN CNAME www<\/td>\n<\/tr>\n<tr>\n<td>MX<\/td>\n<td>\u90ae\u4ef6\u4ea4\u6362\u8bb0\u5f55<\/td>\n<td>\u90ae\u4ef6\u670d\u52a1\u5668&#xff0c;\u6570\u5b57\u8d8a\u5c0f\u4f18\u5148\u7ea7\u8d8a\u9ad8<\/td>\n<td>&#064; IN MX 10 mail1.laoma.cloud.<\/td>\n<\/tr>\n<tr>\n<td>NS<\/td>\n<td>\u57df\u540d\u670d\u52a1\u5668\u8bb0\u5f55<\/td>\n<td>\u58f0\u660e\u672c\u57df\u7684\u6743\u5a01DNS\u670d\u52a1\u5668<\/td>\n<td>IN NS dns.laoma.cloud.<\/td>\n<\/tr>\n<tr>\n<td>PTR<\/td>\n<td>\u6307\u9488\u8bb0\u5f55<\/td>\n<td>IP\u53cd\u5411\u89e3\u6790\u4e3a\u57df\u540d&#xff0c;\u7528\u4e8e\u53cd\u5411zone<\/td>\n<td>10 IN PTR dns.laoma.cloud.<\/td>\n<\/tr>\n<tr>\n<td>SOA<\/td>\n<td>\u8d77\u59cb\u6388\u6743\u8bb0\u5f55<\/td>\n<td>zone\u6587\u4ef6\u5f00\u5934&#xff0c;\u5b9a\u4e49\u57df\u540c\u6b65\u53c2\u6570serial\/refresh\/retry\/expire\/minimum<\/td>\n<td>&#064; IN SOA dns.laoma.cloud. admin.laoma.cloud. (&#8230;)<\/td>\n<\/tr>\n<tr>\n<td>TXT<\/td>\n<td>\u6587\u672c\u8bb0\u5f55<\/td>\n<td>\u5b58\u653e\u6587\u672c\u4fe1\u606f&#xff0c;\u57df\u540d\u6240\u6709\u6743\u9a8c\u8bc1\u3001SPF<\/td>\n<td>&#064; IN TXT &#034;v&#061;spf1 &#8230;&#034;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>zone\u6587\u4ef6\u8bed\u6cd5\u91cd\u70b9&#xff1a;<\/p>\n<li>&#064;&#xff1a;\u4ee3\u8868\u5f53\u524dzone\u5b9a\u4e49\u7684\u57df\u540d&#xff1b;\u7531zone &#034;xxx&#034;\u5b9a\u4e49&#xff1b;zone\u6587\u4ef6\u5185\u90e8&#064; &#061; xxx.<\/li>\n<li>\u57df\u540d\u672b\u5c3e\u5e26.\u4ee3\u8868\u5b8c\u6574FQDN&#xff0c;\u4e0d\u5e26.\u81ea\u52a8\u8ffd\u52a0\u5f53\u524dzone\u57df\u540d\u3002<\/li>\n<li>\u8bb0\u5f55\u884c\u524d\u9762\u4e3a\u7a7a&#xff0c;\u7ee7\u627f\u4e0a\u4e00\u884c\u7684owner&#xff08;\u57df\u540d&#xff09;\u3002<\/li>\n<h3>BIND\u914d\u7f6e\u6587\u4ef6<\/h3>\n<li>\u4e3b\u914d\u7f6e\u6587\u4ef6 \/etc\/named.conf<\/li>\n<li>zone\u5b9a\u4e49\u6587\u4ef6&#xff1a;\u53ef\u4ee5include\u5916\u90e8\u6587\u4ef6<\/li>\n<li>\u533a\u57df\u6570\u636e\u5e93\u6587\u4ef6\u5b58\u653e\u76ee\u5f55&#xff1a;\/var\/named\/<\/li>\n<p>zone\u6587\u4ef6\u6743\u9650&#xff1a;root:named 640&#xff1b;selinux\u6807\u7b7e named_zone_t&#xff1b;\u590d\u5236zone\u6a21\u677f\u52a1\u5fc5\u4f7f\u7528\u2011a\u53c2\u6570&#xff0c;\u4fdd\u7559\u6743\u9650\u548c\u6807\u7b7e\u3002<\/p>\n<h4>\/etc\/named.conf options{}\u5168\u5c40\u6bb5<\/h4>\n<p>options {<br \/>\n listen\u2011on port 53 {127.0.0.1;10.1.8.10;};    #\u76d1\u542c\u672c\u673a\u54ea\u4e9bIP\u768453\u7aef\u53e3<br \/>\n allow\u2011query {any;};                           #\u5141\u8bb8\u54ea\u4e9b\u4e3b\u673a\u67e5\u8be2dns<br \/>\n recursion no;                                 #\u6743\u5a01\u670d\u52a1\u5668\u5173\u95ed\u9012\u5f52<br \/>\n allow\u2011transfer {none;};                       #\u7981\u6b62\u533a\u57df\u4f20\u8f93&#xff0c;\u9632\u6b62\u6cc4\u9732\u5168\u90e8\u8bb0\u5f55<br \/>\n dnssec\u2011enable no;<br \/>\n};<br \/>\ninclude &#034;\/etc\/named.laoma.cloud.zone&#034;;          #\u5f15\u5165\u5916\u90e8zone\u5b9a\u4e49\u914d\u7f6e<\/p>\n<h4>zone\u5b9a\u4e49&#xff08;\/etc\/named.laoma.cloud.zone&#xff09;<\/h4>\n<p>#\u6b63\u5411zone&#xff0c;\u7ba1\u7406laoma.cloud<br \/>\nzone &#034;laoma.cloud&#034; IN {<br \/>\n  type master;                     #master\u4e3b\u670d\u52a1\u5668&#xff1b;slave\u4ece\u670d\u52a1\u5668<br \/>\n  file &#034;named.laoma.cloud&#034;;        #zone\u6570\u636e\u5e93\u6587\u4ef6\u540d&#xff0c;\u4f4d\u4e8e\/var\/named<br \/>\n  allow\u2011update { none; };          #\u5173\u95ed\u52a8\u6001\u66f4\u65b0&#xff0c;\u7981\u6b62\u5ba2\u6237\u7aef\u8fdc\u7a0b\u4fee\u6539\u8bb0\u5f55<br \/>\n};<br \/>\n#\u53cd\u5411zone&#xff0c;\u7f51\u6bb510.1.8.0\/24&#xff0c;\u7f51\u6bb5\u5012\u5199.in\u2011addr.arpa<br \/>\nzone &#034;8.1.10.in\u2011addr.arpa&#034; IN {<br \/>\n  type master;<br \/>\n  file &#034;named.10.1.8&#034;;<br \/>\n  allow\u2011update { none; };<br \/>\n};<\/p>\n<h3>\u6b63\u5411zone\u6570\u636e\u5e93\u793a\u4f8b \/var\/named\/named.laoma.cloud<\/h3>\n<p>$TTL 1D<br \/>\n&#064; IN SOA dns.laoma.cloud. admin.laoma.cloud. (<br \/>\n    0        ;serial\u5e8f\u5217\u53f7&#xff1a;**\u4fee\u6539zone\u8bb0\u5f55\u5fc5\u987b\u624b\u52a8&#043;1&#xff0c;\u4ece\u670d\u52a1\u5668\u6839\u636e\u6b64\u5b57\u6bb5\u540c\u6b65\u66f4\u65b0**<br \/>\n    1D       ;refresh&#xff1a;\u4ece\u670d\u52a1\u5668\u591a\u4e45\u6765\u4e3b\u670d\u52a1\u5668\u62c9\u53d6\u66f4\u65b0<br \/>\n    1H       ;retry&#xff1a;\u540c\u6b65\u5931\u8d25\u91cd\u8bd5\u95f4\u9694<br \/>\n    1W       ;expire&#xff1a;\u4ece\u670d\u52a1\u5668\u8fde\u4e0d\u4e0a\u4e3b\u670d\u52a1\u5668\u591a\u4e45\u505c\u6b62\u63d0\u4f9b\u89e3\u6790<br \/>\n    3H )     ;minimum&#xff1a;\u4e0d\u5b58\u5728\u57df\u540d(NXDOMAIN)\u8d1f\u54cd\u5e94\u7f13\u5b58\u65f6\u95f4<\/p>\n<p>IN NS dns.laoma.cloud.           #\u672c\u57dfDNS\u670d\u52a1\u5668<br \/>\nIN MX 10 mail1                   #\u4f18\u5148\u7ea710&#xff0c;\u4e3b\u90ae\u4ef6\u670d\u52a1\u5668<br \/>\nIN MX 20 mail2                   #\u4f18\u5148\u7ea720&#xff0c;\u5907\u7528\u90ae\u4ef6\u670d\u52a1\u5668<\/p>\n<p>dns     IN A 10.1.8.10<br \/>\nweb     IN CNAME www<br \/>\nwww     IN A 10.1.8.10<br \/>\nmail1   IN A 10.1.8.101<br \/>\nmail2   IN A 10.1.8.102<br \/>\nclient  IN A 10.1.8.11<\/p>\n<p>IN NS dns.laoma.cloud.\u3001IN MX 10 mail1\u884c\u9996\u4e3a\u7a7a&#xff0c;\u7ee7\u627f&#064;\u4e5f\u5c31\u662flaoma.cloud.\u3002<\/p>\n<h3>\u53cd\u5411zone\u6570\u636e\u5e93\u793a\u4f8b \/var\/named\/named.10.1.8<\/h3>\n<p>$TTL 1D<br \/>\n&#064; IN SOA dns.laoma.cloud. admin.laoma.cloud. (<br \/>\n    0 1D 1H 1W 3H )<\/p>\n<p>IN NS dns.laoma.cloud.<br \/>\n10      IN PTR dns.laoma.cloud.<br \/>\n10      IN PTR www.laoma.cloud.<br \/>\n11      IN PTR client.laoma.cloud.<br \/>\n101     IN PTR mail1.laoma.cloud.<br \/>\n102     IN PTR mail2.laoma.cloud.<\/p>\n<p>\u53cd\u5411zone\u4e2d\u5de6\u8fb9\u53ea\u5199IP\u6700\u540e\u4e00\u6bb5&#xff0c;10\u7b49\u4ef710.1.8.10&#xff1b;PTR\u540e\u9762\u57df\u540d\u5fc5\u987b\u5199\u5b8c\u6574FQDN&#xff0c;\u672b\u5c3e\u5e26.&#xff0c;\u4e0d\u80fd\u5199http\u7f51\u5740\u3002<\/p>\n<h3>\u6821\u9a8c\u914d\u7f6e\u8bed\u6cd5<\/h3>\n<p>named\u2011checkconf                                      <span class=\"token comment\">#\u6821\u9a8c\u4e3b\u914d\u7f6e\/etc\/named.conf<\/span><br \/>\nnamed\u2011checkzone laoma.cloud \/var\/named\/named.laoma.cloud   <span class=\"token comment\">#\u6821\u9a8c\u6b63\u5411zone<\/span><br \/>\nnamed\u2011checkzone <span class=\"token number\">8.1<\/span>.10.in\u2011addr.arpa \/var\/named\/named.10.1.8 <span class=\"token comment\">#\u6821\u9a8c\u53cd\u5411zone<\/span><\/p>\n<h3>\u542f\u52a8\u670d\u52a1\u3001\u9632\u706b\u5899<\/h3>\n<p>systemctl <span class=\"token builtin class-name\">enable<\/span> <span class=\"token parameter variable\">&#8211;now<\/span> named<br \/>\nfirewall\u2011cmd &#8211;add\u2011service<span class=\"token operator\">&#061;<\/span>dns <span class=\"token parameter variable\">&#8211;permanent<\/span><br \/>\nfirewall\u2011cmd <span class=\"token parameter variable\">&#8211;reload<\/span><\/p>\n<p>journalctl <span class=\"token parameter variable\">-u<\/span> named    <span class=\"token comment\">#\u67e5\u770bnamed\u8fd0\u884c\u65e5\u5fd7&#xff0c;\u6392\u9519\u4f18\u5148\u770b\u65e5\u5fd7<\/span><\/p>\n<h3>\u5ba2\u6237\u7aef\u6d4b\u8bd5\u547d\u4ee4<\/h3>\n<p><span class=\"token function\">dig<\/span> &#064;10.1.8.10 www.laoma.cloud         <span class=\"token comment\">#\u6307\u5b9adns\u670d\u52a1\u5668\u67e5\u8be2A\u8bb0\u5f55<\/span><br \/>\n<span class=\"token function\">dig<\/span> &#064;10.1.8.10 laoma.cloud MX          <span class=\"token comment\">#\u67e5\u8be2MX\u90ae\u4ef6\u8bb0\u5f55<\/span><br \/>\n<span class=\"token function\">dig<\/span> &#064;10.1.8.10 <span class=\"token parameter variable\">-x<\/span> <span class=\"token number\">10.1<\/span>.8.101          <span class=\"token comment\">#\u2011x\u53cd\u5411PTR\u67e5\u8be2&#xff0c;IP\u67e5\u57df\u540d<\/span><br \/>\n<span class=\"token function\">dig<\/span> &#043;trace www.baidu.com               <span class=\"token comment\">#\u8fed\u4ee3\u8ffd\u8e2a\u5b8c\u6574\u67e5\u8be2\u8fc7\u7a0b<\/span><\/p>\n<p><span class=\"token function\">host<\/span> \u57df\u540d<br \/>\ngetent hosts \u57df\u540d<\/p>\n<h4>DNS\u9ad8\u9891\u5751<\/h4>\n<li>zone\u6570\u636e\u5e93\u57df\u540d\u672b\u5c3e\u7f3a\u5c11.&#xff0c;\u4f1a\u81ea\u52a8\u62fc\u63a5\u672c\u57df\u57df\u540d&#xff0c;\u89e3\u6790\u51fa\u9519\u3002<\/li>\n<li>\u4fee\u6539zone\u8bb0\u5f55\u540e&#xff0c;serial\u5e8f\u5217\u53f7\u5fd8\u8bb0\u52a01&#xff0c;slave\u4ece\u670d\u52a1\u5668\u4e0d\u4f1a\u540c\u6b65\u66f4\u65b0\u3002<\/li>\n<li>\u590d\u5236zone\u6587\u4ef6\u4e0d\u4f7f\u7528\u2011a&#xff0c;\u4e22\u5931\u6743\u9650\u3001SELinux\u6807\u7b7e&#xff0c;named\u65e0\u6cd5\u8bfb\u53d6zone\u6587\u4ef6\u3002<\/li>\n<li>\u6743\u5a01\u670d\u52a1\u5668\u6ca1\u6709\u8bbe\u7f6erecursion no&#xff0c;\u5b58\u5728\u5b89\u5168\u98ce\u9669\u3002<\/li>\n<li>allow\u2011transfer\u6ca1\u6709\u8bbe\u7f6e\u4e3anone&#xff0c;\u653b\u51fb\u8005\u53ef\u4ee5\u6267\u884cdig axfr\u83b7\u53d6\u5168\u90e8\u57df\u540d\u8bb0\u5f55\u3002<\/li>\n<li>PTR\u8bb0\u5f55\u53ea\u5141\u8bb8\u586b\u5199\u57df\u540d&#xff0c;\u4e0d\u80fd\u586b\u5199http\u94fe\u63a5url\u3002<\/li>\n<li>zone &#034;8.1.10.in\u2011addr.arpa&#034;\u53cd\u5411\u533a\u57df\u7f51\u6bb5\u9700\u8981\u5012\u5e8f\u4e66\u5199\u3002<\/li>\n<p>\u4e3b\u4eceDNS\u8865\u5145&#xff1a;type slave&#xff0c;\u4ece\u670d\u52a1\u5668&#xff0c;\u901a\u8fc7\u533a\u57df\u4f20\u8f93AXFR\u4ecemaster\u4e3b\u670d\u52a1\u5668\u83b7\u53d6zone\u6570\u636e\u3002master\u9700\u8981allow\u2011transfer\u5141\u8bb8\u4ece\u670d\u52a1\u5668IP\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SELinux\u3001DHCP\u3001DNS \u5b9e\u6218<br \/>\nSELinuxSELinux \u662f\u4f20\u7edfrwx\u81ea\u4e3b\u8bbf\u95ee\u63a7\u5236(DAC)\u4e4b\u5916&#xff0c;\u589e\u52a0\u7684\u5f3a\u5236\u8bbf\u95ee\u63a7\u5236MAC\u5b89\u5168\u5c42\u3002<br \/>\nDAC&#xff1a;\u7531\u6587\u4ef6\u5c5e\u4e3b\u51b3\u5b9a\u6743\u9650&#xff1b;MAC&#xff1a;\u7cfb\u7edf\u7b56\u7565\u5f3a\u5236\u7ba1\u63a7&#xff0c;\u9ed8\u8ba4\u62d2\u7edd&#xff0c;\u53ea\u6709\u7b56\u7565\u663e\u5f0f\u5141\u8bb8\u624d\u53ef\u4ee5\u8bbf\u95ee\u3002<br \/>\n\u6838\u5fc3\u76ee\u6807&#xff1a;\u9632\u6b62\u88ab\u5165\u4fb5\u7684\u670d\u52a1\u8fdb\u7a0b\u8d8a\u6743\u8bbf\u95ee\u7cfb\u7edf\u5176\u4ed6\u6570\u636e\u3002SELinux\u4e0a\u4e0b\u6587&#xff08;\u6807\u7b7e&#xff09;<br \/>\n\u6bcf\u4e2a\u8fdb\u7a0b\u3001\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u7aef\u53e3\u90fd\u62e5\u6709S<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-110689","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/110689.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"SELinux\u3001DHCP\u3001DNS \u5b9e\u6218 SELinuxSELinux \u662f\u4f20\u7edfrwx\u81ea\u4e3b\u8bbf\u95ee\u63a7\u5236(DAC)\u4e4b\u5916&#xff0c;\u589e\u52a0\u7684\u5f3a\u5236\u8bbf\u95ee\u63a7\u5236MAC\u5b89\u5168\u5c42\u3002 DAC&#xff1a;\u7531\u6587\u4ef6\u5c5e\u4e3b\u51b3\u5b9a\u6743\u9650&#xff1b;MAC&#xff1a;\u7cfb\u7edf\u7b56\u7565\u5f3a\u5236\u7ba1\u63a7&#xff0c;\u9ed8\u8ba4\u62d2\u7edd&#xff0c;\u53ea\u6709\u7b56\u7565\u663e\u5f0f\u5141\u8bb8\u624d\u53ef\u4ee5\u8bbf\u95ee\u3002 \u6838\u5fc3\u76ee\u6807&#xff1a;\u9632\u6b62\u88ab\u5165\u4fb5\u7684\u670d\u52a1\u8fdb\u7a0b\u8d8a\u6743\u8bbf\u95ee\u7cfb\u7edf\u5176\u4ed6\u6570\u636e\u3002SELinux\u4e0a\u4e0b\u6587&#xff08;\u6807\u7b7e&#xff09; \u6bcf\u4e2a\u8fdb\u7a0b\u3001\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u7aef\u53e3\u90fd\u62e5\u6709S\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/110689.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-29T00:16:56+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110689.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/110689.html\",\"name\":\"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-29T00:16:56+00:00\",\"dateModified\":\"2026-09-29T00:16:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/110689.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/110689.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110689.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/110689.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"SELinux\u3001DHCP\u3001DNS \u5b9e\u6218 SELinuxSELinux \u662f\u4f20\u7edfrwx\u81ea\u4e3b\u8bbf\u95ee\u63a7\u5236(DAC)\u4e4b\u5916&#xff0c;\u589e\u52a0\u7684\u5f3a\u5236\u8bbf\u95ee\u63a7\u5236MAC\u5b89\u5168\u5c42\u3002 DAC&#xff1a;\u7531\u6587\u4ef6\u5c5e\u4e3b\u51b3\u5b9a\u6743\u9650&#xff1b;MAC&#xff1a;\u7cfb\u7edf\u7b56\u7565\u5f3a\u5236\u7ba1\u63a7&#xff0c;\u9ed8\u8ba4\u62d2\u7edd&#xff0c;\u53ea\u6709\u7b56\u7565\u663e\u5f0f\u5141\u8bb8\u624d\u53ef\u4ee5\u8bbf\u95ee\u3002 \u6838\u5fc3\u76ee\u6807&#xff1a;\u9632\u6b62\u88ab\u5165\u4fb5\u7684\u670d\u52a1\u8fdb\u7a0b\u8d8a\u6743\u8bbf\u95ee\u7cfb\u7edf\u5176\u4ed6\u6570\u636e\u3002SELinux\u4e0a\u4e0b\u6587&#xff08;\u6807\u7b7e&#xff09; \u6bcf\u4e2a\u8fdb\u7a0b\u3001\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u7aef\u53e3\u90fd\u62e5\u6709S","og_url":"https:\/\/www.wsisp.com\/helps\/110689.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-29T00:16:56+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/110689.html","url":"https:\/\/www.wsisp.com\/helps\/110689.html","name":"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-29T00:16:56+00:00","dateModified":"2026-09-29T00:16:56+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/110689.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/110689.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/110689.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux\u8fd0\u7ef4\uff1aSELinux\u3001DHCP\u3001DNS \u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/110689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=110689"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/110689\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=110689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=110689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=110689"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=110689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}