{"id":3744,"date":"2019-11-12T21:49:27","date_gmt":"2019-11-12T13:49:27","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=3744"},"modified":"2021-07-24T11:08:58","modified_gmt":"2021-07-24T03:08:58","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8opnsense%e4%b8%ad%e9%85%8d%e7%bd%ae%e9%98%b2%e7%81%ab%e5%a2%99%e8%a7%84%e5%88%99","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=3744","title":{"rendered":"\u5982\u4f55\u5728OPNsense\u4e2d\u914d\u7f6e\u9632\u706b\u5899\u89c4\u5219"},"content":{"rendered":"<p style=\"text-align: justify;\">\u5728\u914d\u7f6e\u9632\u706b\u5899\u7684\u89c4\u5219\u4e4b\u524d\uff0c\u5e94\u8be5\u505a\u7684\u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u82b1\u4e00\u4e9b\u65f6\u95f4\u601d\u8003\u901a\u8fc7\u6784\u5efa\u81ea\u5df1\u7684\u9632\u706b\u5899\u8981\u5b9e\u73b0\u7684\u76ee\u6807\u3002\u4f8b\u5982\uff0c\u6211\u60f3\u5c06\u7f51\u7edc\u5206\u6210\u51e0\u4e2a\u903b\u8f91\u7f51\u7edc\uff08\u901a\u8fc7VLAN\uff09\uff0c\u90a3\u4e48\u5728\u7f51\u7edc\u5185\u90e8\u548c\u7f51\u7edc\u5916\u90e8\u963b\u6b62\u6216\u5141\u8bb8\u54ea\u4e9b\u670d\u52a1\uff1f\u5185\u90e8\u7f51\u7edc\u7684\u8bbe\u5907\u5e94\u8be5\u653e\u5165\u54ea\u4e2aVLAN\uff1f\u5982\u4f55\u5728\u4e0d\u589e\u52a0\u7f51\u7edc\u4f7f\u7528\u96be\u5ea6\u7684\u60c5\u51b5\u4e0b\u9650\u5236\u5c3d\u53ef\u80fd\u591a\u7684\u7f51\u7edc\u6d41\u91cf\uff1f<\/p>\n<h1 id=\"the-default-opnsense-firewall-configuration\" style=\"text-align: justify;\">\u4e00\u3001\u9ed8\u8ba4\u7684OPNsense\u9632\u706b\u5899\u914d\u7f6e<\/h1>\n<p style=\"text-align: justify;\">\u5728\u5b89\u88c5OPNsense\u65f6\u8bbe\u7f6eLAN \/ WAN\u63a5\u53e3\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cOPNsense\u4f1a\u81ea\u52a8\u4e3aLAN\u63a5\u53e3\u7684IPv4\u548cIPv6\u81ea\u52a8\u521b\u5efaWeb\u7ba1\u7406\u9632\u9501\u5b9a\u89c4\u5219\u548c\u201c\u5141\u8bb8\u6240\u6709\u201d\u89c4\u5219\u3002\u8fd9\u4e9b\u89c4\u5219\u53ef\u9632\u6b62\u5c06\u81ea\u5df1\u9501\u5b9a\u5728\u9632\u706b\u5899\u7684Web\u7ba1\u7406\u9875\u9762\u4e4b\u5916\uff0c\u5e76\u5141\u8bb8\u4f60\u7684\u7f51\u7edc\u4e0d\u53d7\u9650\u5236\u5730\u8bbf\u95eeInternet\u3002\u9ed8\u8ba4\u7684\u9632\u706b\u5899\u914d\u7f6e\u4f7f\u4f60\u7684OPNsense\u9632\u706b\u5899\u7684\u884c\u4e3a\u7c7b\u4f3c\u4e8e\u5178\u578b\u7684\u6d88\u8d39\u7ea7\u8def\u7531\u5668\u3002\u5c06\u8bbe\u5907\u76f4\u63a5\u63d2\u5165\u8def\u7531\u5668\uff08\u6216\u8fde\u63a5\u5230\u8def\u7531\u5668\u7684\u4ea4\u6362\u673a\uff09\uff0c\u5b83\u4eec\u5c31\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002\u5982\u679c\u201c\u5141\u8bb8\u6240\u6709\u201d\u89c4\u5219\u88ab\u7981\u7528\u6216\u5220\u9664\uff0c\u5219\u9664\u8bbf\u95eeOPNsense Web\u7ba1\u7406\u9875\u9762\u5916\uff0c\u6240\u6709\u5230Internet\u548c\u5176\u4ed6\u672c\u5730\u7f51\u7edc\u7684\u6d41\u91cf\u90fd\u5c06\u88ab\u963b\u6b62\u3002<\/p>\n<p style=\"text-align: justify;\">\u67e5\u770b\u9ed8\u8ba4\u89c4\u5219\uff0c\u8bf7\u8f6c\u5230Firewall &gt; Rules &gt; LAN\u9875\u9762\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3753\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules.png\" width=\"1280\" height=\"216\" alt=\"\u9ed8\u8ba4\u9632\u706b\u5899\u89c4\u5219\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules.png 1280w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules-1024x173.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules-300x51.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules-768x130.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/default-firewall-rules-500x84.png 500w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><\/p>\n<h1 id=\"rule-processing-order\" style=\"text-align: justify;\">\u4e8c\u3001\u89c4\u5219\u5904\u7406\u987a\u5e8f<\/h1>\n<p style=\"text-align: justify;\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u9632\u706b\u5899\u89c4\u5219\u5904\u7406\u65e8\u5728\u963b\u6b62\u6240\u6709\u6d41\u91cf\uff1a\u65e0\u89c4\u5219=\u963b\u6b62\u6240\u6709\u6d41\u91cf\u3002\u89c4\u5219\u4ece\u5217\u8868\u7684\u9876\u90e8\u5230\u5e95\u90e8\u8fdb\u884c\u5904\u7406\uff0c\u56e0\u6b64\u5217\u8868\u4e2d\u89c4\u5219\u7684\u987a\u5e8f\u5f88\u91cd\u8981\u3002\u5f53\u7f51\u7edc\u6d41\u91cf\u5339\u914d\u4efb\u610f\u89c4\u5219\uff08\u65e0\u8bba\u662f\u201c\u5141\u8bb8\u201d\u89c4\u5219\u8fd8\u662f\u201c\u963b\u6b62\u201d\u89c4\u5219\uff09\u65f6\uff0c\u5c06\u4e0d\u5904\u7406\u540e\u7eed\u89c4\u5219\u3002\u6267\u884c\u7b2c\u4e00\u4e2a\u5339\u914d\u7684\u89c4\u5219\uff0c\u540e\u9762\u6240\u6709\u89c4\u5219\u5c06\u88ab\u5ffd\u7565\u3002\u8fd9\u610f\u5473\u7740\u4f60\u5fc5\u987b\u5bf9\u89c4\u5219\u7684\u6b63\u786e\u987a\u5e8f\u8fdb\u884c\u4e00\u4e9b\u8003\u8651\uff0c\u800c\u4e0d\u80fd\u7b80\u5355\u5730\u968f\u673a\u6dfb\u52a0\u5b83\u4eec\u5e76\u671f\u671b\u5b83\u4eec\u6309\u9884\u671f\u5de5\u4f5c\u3002<\/p>\n<p style=\"text-align: justify;\">\u521b\u5efa\u9632\u706b\u5899\u89c4\u5219\u65f6\uff0c\u5e94\u8be5\u8003\u8651\u5c06\u6700\u5177\u4f53\u7684\u89c4\u5219\u653e\u5728\u5217\u8868\u9876\u90e8\uff0c\u5c06\u6700\u4e00\u822c\u7684\u89c4\u5219\u653e\u5728\u5217\u8868\u5e95\u90e8\u3002\u5f53\u8fd9\u6837\u505a\u65f6\uff0c\u9996\u5148\u5141\u8bb8\u6216\u62d2\u7edd\u66f4\u7279\u5b9a\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u800c\u4e0e\u4efb\u610f\u7279\u5b9a\u89c4\u5219\u90fd\u4e0d\u5339\u914d\u7684\u7f51\u7edc\u6d41\u91cf\u5c06\u7531\u66f4\u5e7f\u6cdb\u7684\u89c4\u5219\u5904\u7406\u3002\u8f83\u5bbd\u6cdb\u7684\u89c4\u5219\u5c31\u50cf\u201c\u5168\u90e8\u6355\u83b7\u201d\u89c4\u5219\u4e00\u6837\uff0c\u53ef\u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6240\u6709\u5176\u4ed6\u672a\u6307\u5b9a\u7684\u7f51\u7edc\u6d41\u91cf\u3002\u5728\u9650\u5236\u6027\u66f4\u5f3a\u7684\u73af\u5883\u4e2d\uff0c\u201c\u62d2\u7edd\u6240\u6709\u5176\u4ed6\u201d\u89c4\u5219\u53ef\u80fd\u4f4d\u4e8e\u5e95\u90e8\uff0c\u800c\u5728\u4e00\u822c\u7684\u5bb6\u5ead\u73af\u5883\u4e2d\uff0c\u201c\u5141\u8bb8\u6240\u6709\u5176\u4ed6\u201d\u89c4\u5219\u53ef\u80fd\u66f4\u5408\u9002\uff0c\u56e0\u4e3a\u5b83\u7684\u9650\u5236\u6027\u548c\u5b89\u5168\u6027\u8f83\u5c0f\u3002<\/p>\n<h1 id=\"creating-rules\" style=\"text-align: justify;\">\u4e09\u3001\u5efa\u7acb\u89c4\u5219<\/h1>\n<p style=\"text-align: justify;\">\u4e0b\u9762\u6211\u4eec\u6765\u6f14\u793a\u5efa\u7acb\u4e00\u4e9b\u89c4\u5219\u3002<\/p>\n<h2 id=\"allow-only-specific-dns-servers\" style=\"text-align: justify;\">(\u4e00)\u3001\u4ec5\u5141\u8bb8\u7279\u5b9a\u7684DNS\u670d\u52a1\u5668<\/h2>\n<p style=\"text-align: justify;\">\u521b\u5efa\u8981\u63d0\u9ad8\u5b89\u5168\u6027\u7684\u524d\u51e0\u4e2a\u89c4\u5219\u4e4b\u4e00\u662f\u4ec5\u5141\u8bb8\u9632\u706b\u5899\u6307\u5b9a\u7684DNS\u670d\u52a1\u5668\u3002\u8fd9\u53ef\u4ee5\u63a7\u5236\u7f51\u7edc\u4e2d\u4f7f\u7528\u7684DNS\u670d\u52a1\u5668\uff0c\u5e76\u9632\u6b62\u7528\u6237\u548c\u8bbe\u5907\u4f7f\u7528\u5176\u4ed6\u5916\u90e8DNS\u670d\u52a1\u5668\u6216\u5728\u7f51\u7edc\u4e2d\u8fd0\u884c\u81ea\u5df1\u7684DNS\u670d\u52a1\u5668\u3002\u5982\u679c\u4f60\u5e0c\u671b\u8fd0\u884c\u81ea\u5df1\u7684DNS\u670d\u52a1\u5668\u6216\u4f7f\u7528\u63d0\u4f9b\u5185\u5bb9\u8fc7\u6ee4\/\u963b\u6b62\u529f\u80fd\u7684\u5916\u90e8DNS\u670d\u52a1\u5668\uff0c\u5219\u6267\u884c\u6b64\u64cd\u4f5c\u5c24\u4e3a\u91cd\u8981\u3002\u8fd9\u4e9bDNS\u9632\u706b\u5899\u89c4\u5219\u5c06\u9632\u6b62\u7528\u6237\/\u8bbe\u5907\u7ed5\u5f00\u4e3a\u7f51\u7edc\u5b9e\u65bd\u7684\u8fc7\u6ee4\/\u963b\u6b62\u884c\u4e3a\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728\u672c\u793a\u4f8b\u4e2d\u6211\u4eec\u4f7f\u7528LAN\u63a5\u53e3\uff0c\u8fd9\u662fOPNsense\u4e2d\u5185\u90e8LAN\u7f51\u7edc\u7684\u9ed8\u8ba4\u63a5\u53e3\u3002\u8fd9\u9002\u7528\u4e8e\u672c\u6587\u4e2d\u7684\u6240\u6709\u89c4\u5219\u793a\u4f8b\u3002<\/p>\n<p style=\"text-align: justify;\">\u8981\u6dfb\u52a0DNS\u670d\u52a1\u5668\u4fdd\u62a4\uff0c\u8bf7\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u4e2a\u89c4\u5219\uff1a<\/p>\n<h4 id=\"1-allow-the-internal-dns-server\" style=\"text-align: justify;\">1\u3001\u5141\u8bb8\u5185\u90e8DNS\u670d\u52a1\u5668<\/h4>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3746\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense.png\" alt=\"\" width=\"828\" height=\"85\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense.png 828w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense-300x31.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense-768x79.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense-500x51.png 500w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5728\u4e00\u822c\u7684\u7f51\u7edc\u914d\u7f6e\u4e2d\uff0cDNS IP\u5730\u5740\u53ef\u4ee5\u4e0e\u7f51\u5173IP\u5730\u5740\u4e0d\u540c\uff0c\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5047\u8bbe\u5b83\u4eec\u662f\u76f8\u540c\u7684\uff0c\u56e0\u4e3a\u6211\u4eec\u5728OPNsense\u4e2d\u4f7f\u7528DNS\u670d\u52a1\u5668\u914d\u7f6e\uff0c\u800c\u4e0d\u662f\u5916\u90e8DNS\u670d\u52a1\u5668\u3002\u63a5\u53e3\u7684IP\u5730\u5740\u4e5f\u7528\u4f5c\u8be5\u7f51\u7edc\u4e0a\u8bbe\u5907\u7684\u7f51\u5173\u5730\u5740\u3002\u67e5\u770b\u6bcf\u4e2a\u8bbe\u5907\u7684DHCP\u4fe1\u606f\u65f6\uff0c\u5c06\u4f1a\u770b\u5230\u7f51\u5173\u670d\u52a1\u5668\u548cDNS\u670d\u52a1\u5668\u4e3aLAN\u5730\u5740\u3002\u5728\u672c\u793a\u4f8b\u7f51\u7edc\u73af\u5883\u4e2d\uff0cLAN\u5730\u5740\u4e3a192.168.1.1\u3002\u9009\u62e9\u201cpass(\u901a\u8fc7)\u201d\u4f5c\u4e3a\u5141\u8bb8\u89c4\u5219\u3002\u9009\u62e9*\u8868\u793a\u6e90\u5730\u5740\u548c\u6e90\u7aef\u53e3\u5747\u4e3a\u201c any\u201d\u3002\u8fd9\u5c06\u6355\u83b7\u5c06\u8981\u5230\u8fbe\u6307\u5b9a\u76ee\u7684\u5730LAN\u63a5\u53e3\u4e0a\u7684\u6240\u6709\u6d41\u91cf\u3002\u76ee\u6807\u5730\u5740\u9009\u62e9LAN\u5730\u5740\uff0c\u76ee\u6807\u7aef\u53e3\u9009\u62e9DNS\u670d\u52a1\u4f7f\u7528\u768453\u7aef\u53e3\u3002<\/p>\n<h4 id=\"2-block-any-external-dns-server\" style=\"text-align: justify;\">2\u3001\u963b\u6b62\u4efb\u610f\u5916\u90e8DNS\u670d\u52a1\u5668<\/h4>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3748\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense1.png\" alt=\"\" width=\"829\" height=\"86\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense1.png 829w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense1-300x31.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense1-768x80.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/Rules-in-OPNsense1-500x52.png 500w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u9009\u62e9\u201cBlock(\u963b\u6b62)\u201d\u4f5c\u4e3a\u963b\u6b62\u89c4\u5219\u3002\u6e90\u5730\u5740\u548c\u7aef\u53e3\u8bbe\u7f6e\u4e3aLAN\u7f51\u7edc\u4e0a\u7684\u4efb\u610f\u8bbe\u5907\uff0c\u76ee\u6807\u4e3aany\uff0c\u7aef\u53e3\u9009\u62e953(DNS)\u3002<\/p>\n<p style=\"text-align: justify;\">\u8fd9\u91cc\u8981\u6ce8\u610f\uff0c\u7531\u4e8e\u89c4\u5219\u5904\u7406\u987a\u5e8f\u7684\u539f\u56e0\uff0c\u201c\u5141\u8bb8\u201d\u89c4\u5219\u4e2d\u4efb\u610f\u8bbf\u95ee\u6307\u5b9aDNS\u670d\u52a1\u5668\u7684\u5c1d\u8bd5\u90fd\u5c06\u6210\u529f\uff0c\u5e76\u4e14\u8be5\u8bf7\u6c42\u7684\u89c4\u5219\u5904\u7406\u5c06\u505c\u6b62\u3002\u4f46\u662f\uff0c\u5982\u679c\u8bbe\u5907\u5c1d\u8bd5\u8bbf\u95ee\u5916\u90e8DNS\u670d\u52a1\u5668\uff0c\u5219\u5b83\u5c06\u88ab\u201c\u963b\u6b62\u201d\u89c4\u5219\u6267\u884c\uff0c\u56e0\u4e3a\u201c\u5141\u8bb8\u201d\u89c4\u5219\u65e0\u6cd5\u901a\u8fc7\uff0c\u4ece\u800c\u62d2\u7edd\u5bf9\u8be5DNS\u670d\u52a1\u5668\u7684\u8bbf\u95ee\u3002<\/p>\n<p style=\"text-align: justify;\">\u89c4\u5219\u5217\u8868\u5e94\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3754\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1.png\" width=\"1061\" height=\"179\" alt=\"\u9632\u706b\u5899\u89c4\u5219\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1.png 1061w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1-1024x173.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1-300x51.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1-768x130.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-1-500x84.png 500w\" sizes=\"auto, (max-width: 1061px) 100vw, 1061px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5728LAN\u63a5\u53e3\u4e2d\uff0c\u4e0d\u80fd\u5c06\u4efb\u4f55\u89c4\u5219\u79fb\u5230\u53cd\u9501\u5b9a\u89c4\u5219\u4e0a\u65b9\uff0c\u4f46\u662f\u5c06\u89c4\u5219\u7f6e\u4e8e\u8be5\u89c4\u5219\u4e4b\u4e0b\u4e0d\u4f1a\u6709\u4efb\u4f55\u95ee\u9898\u3002\u7b2c\u4e00\u6761\u89c4\u5219\u5141\u8bb8\u8bbf\u95ee\u672c\u5730DNS\u670d\u52a1\u5668\uff0c\u800c\u7b2c\u4e8c\u6761\u89c4\u5219\u5219\u963b\u6b62\u5bf9\u6240\u6709\u5176\u4ed6DNS\u670d\u52a1\u5668\u7684\u8bbf\u95ee\uff0c\u65e0\u8bba\u5b83\u4eec\u662f\u672c\u5730\u7684\u8fd8\u662f\u8fdc\u7a0b\u7684\u3002<\/p>\n<h2 id=\"allow-access-to-interface-gateway-address\" style=\"text-align: justify;\">(\u4e8c)\u3001\u5141\u8bb8\u8bbf\u95ee\u63a5\u53e3\u7f51\u5173\u5730\u5740<\/h2>\n<p style=\"text-align: justify;\">\u5f53\u6709\u591a\u4e2aVLAN\u6216\u63a5\u53e3\u65f6\uff0c\u9664\u5c11\u6570\u5141\u8bb8\u7684\u5916\uff0c\u5e94\u8be5\u963b\u6b62\u5bf9\u5176\u4ed6\u7f51\u7edc\u7684\u8bbf\u95ee\u3002\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5141\u8bb8\u6bcf\u4e2aVLAN\u6216\u63a5\u53e3\u5185\u7684\u7f51\u7edc\u6d41\u91cf\u8bbf\u95ee\u81ea\u5df1\u7684\u7f51\u5173IP\u5730\u5740\uff0c\u8be5\u5730\u5740\u4e0e\u63a5\u53e3\u7684\u5206\u914dIP\u5730\u5740\u76f8\u540c\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u7684VLAN\u6807\u8bc6\u4e3aIOT\u3002<\/p>\n<p style=\"text-align: justify;\">\u8981\u5141\u8bb8\u8bbf\u95ee\u63a5\u53e3\u7684\u7f51\u5173IP\u5730\u5740\uff0c\u8bf7\u6dfb\u52a0\u5982\u4e0b\u56fe\u6240\u793a\u89c4\u5219\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3755\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-2.png\" width=\"1021\" height=\"123\" alt=\"\u9632\u706b\u5899\u89c4\u5219\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-2.png 1021w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-2-300x36.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-2-768x93.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-2-500x60.png 500w\" sizes=\"auto, (max-width: 1021px) 100vw, 1021px\" \/><\/a><\/p>\n<h2 id=\"block-access-to-other-vlans\" style=\"text-align: justify;\">(\u4e09)\u3001\u5141\u8bb8\u8de8VLAN\/\u63a5\u53e3\u4e92\u8bbf<\/h2>\n<p style=\"text-align: justify;\">\u5982\u679c\u4f7f\u7528VLAN\u6216\u5177\u6709\u4e0d\u540c\u5b50\u7f51\u7684\u591a\u4e2a\u63a5\u53e3\uff0c\u5e76\u4e14\u6b63\u5728\u8fd0\u884c\u672c\u5730\u670d\u52a1\u5668\uff0c\u53ef\u80fd\u9700\u8981\u4ece\u5176\u4ed6\u7f51\u7edc\u4e0a\u7684\u8bbe\u5907\u8bbf\u95ee\u670d\u52a1\u5668\uff08\u4f8b\u5982Plex Media Server\uff09\u3002\u4e3a\u4e86\u80fd\u5b9e\u73b0\u8bbf\u95ee\uff0c\u9700\u8981\u5728\u5ba2\u6237\u7aef\u8bbe\u5907\u6240\u5728\u7684\u63a5\u53e3\uff0c\u6dfb\u52a0\u5141\u8bb8\u8bbf\u95ee\u7684\u7aef\u53e332400(Plex\u7684\u9ed8\u8ba4\u7aef\u53e3\uff09\u3002\u6e90\u4e3a\u5ba2\u6237\u7aef\u63a5\u53e3\u6240\u5728\u7684\u7f51\u7edc\uff0c\u76ee\u6807\u4e3a\u670d\u52a1\u5668\u7684IP\u5730\u5740\uff0c\u7aef\u53e3\u4e3a32400\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3756\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-3.png\" width=\"1020\" height=\"111\" alt=\"\u9632\u706b\u5899\u89c4\u5219\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-3.png 1020w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-3-300x33.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-3-768x84.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-3-500x54.png 500w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u8be5\u89c4\u5219\u5141\u8bb8IOT\u7f51\u7edc\u4e0a\u7684\u4efb\u610f\u8bbe\u5907\u8bbf\u95ee\u5730\u5740\u4e3a192.168.10.10\u3001\u4e3a\u7aef\u53e332400\u7684Plex Media Server\u670d\u52a1\u5668\u3002Plex Media Server\u4e0eIOT\u7f51\u7edc\u4e0d\u5728\u540c\u4e00\u4e2aVLAN\u7f51\u7edc\u4e2d\u3002<\/p>\n<p style=\"text-align: justify;\">\u4e0b\u9762\u7684\u4f8b\u5b50\u662f\u8fd0\u884cWordpress\u7684Web\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u7684\u5730\u5740\u4e3a192.168.10.10\uff0c\u8be5\u7ad9\u70b9\u901a\u8fc7443\u7aef\u53e3\u8bbf\u95ee\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3757\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-4.png\" width=\"1020\" height=\"114\" alt=\"\u9632\u706b\u5899\u89c4\u5219\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-4.png 1020w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-4-300x34.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-4-768x86.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-4-500x56.png 500w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><\/a><\/p>\n<h2 id=\"block-access-to-other-vlans\" style=\"text-align: justify;\">(\u56db)\u3001\u963b\u6b62\u8bbf\u95ee\u5176\u4ed6VLAN<\/h2>\n<p style=\"text-align: justify;\">\u5728\u5b9a\u4e49\u4e86\u8de8VLAN\u5bf9\u6240\u6709\u672c\u5730\u7f51\u7edc\u670d\u52a1\u7684\u8bbf\u95ee\u6743\u9650\u540e\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528\u89c4\u5219\u6765\u963b\u6b62\u5bf9\u5176\u4ed6VLAN\u7684\u8bbf\u95ee\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u9664\u975e\u5728\u89c4\u5219\u5217\u8868\u7684\u5e95\u90e8\u6709\u4e00\u4e2a\u201c\u5168\u90e8\u5141\u8bb8\u201d\u7684\u89c4\u5219\uff0c\u5426\u5219\u5c06\u7981\u6b62\u8bbf\u95ee\u5176\u4ed6\u7f51\u7edc\u3002\u5982\u679c\u9700\u8981\u963b\u6b62\u5bf9\u5176\u4ed6VLAN\u7684\u8bbf\u95ee\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u6240\u6709\u5176\u4ed6VLAN\u79c1\u6709IP\u5730\u5740\u8303\u56f4\u7684\u522b\u540d\uff0c\u7136\u540e\u6dfb\u52a0\u963b\u6b62\u89c4\u5219\u6765\u5b9e\u73b0\u7981\u6b62VLAN\u4e4b\u524d\u4e92\u76f8\u8bbf\u95ee\u3002<\/p>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230Firewall &gt; Aliases\uff0c\u6dfb\u52a0\u65b0\u7684\u522b\u540d\uff0c\u6dfb\u52a0\u5176\u4ed6VLAN\u7684IP\u8303\u56f4\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/private-networks-alias.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3758\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/private-networks-alias.png\" width=\"664\" height=\"334\" alt=\"\u4e13\u7528\u7f51\u7edc\u522b\u540d\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/private-networks-alias.png 664w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/private-networks-alias-300x151.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/private-networks-alias-500x252.png 500w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u7136\u540e\u6dfb\u52a0\u963b\u6b62\u89c4\u5219\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u76ee\u6807\u4e3a\u4e0a\u9762\u6dfb\u52a0\u7684IP\u8303\u56f4\u522b\u540d\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3759\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5.png\" width=\"1096\" height=\"97\" alt=\"\u9632\u706b\u5899\u89c4\u5219\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5.png 1096w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5-1024x91.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5-300x27.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5-768x68.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/firewall-rules-5-500x44.png 500w\" sizes=\"auto, (max-width: 1096px) 100vw, 1096px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u9700\u8981\u5141\u8bb8\u7279\u5b9a\u8bbe\u5907\u6216VLAN\u7f51\u7edc\u7684\u901a\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u8fd9\u6761(\u201cblock all private IPs)\u201d \u89c4\u5219\u4e0a\u65b9\u521b\u5efa\u201c\u5141\u8bb8\u201d\u89c4\u5219\u3002\u5982\u679c\u4e0d\u5728\u8fd9\u6761\u89c4\u5219\u4e4b\u4e0a\u88ab\u6267\u884c\uff0c\u5219\u6d41\u91cf\u5728\u6267\u884c\u5230\u201c\u5141\u8bb8\u201d\u89c4\u5219\u4e4b\u524d\u4f1a\u88ab\u4e22\u5f03\u3002<\/p>\n<h2 id=\"finally-the-allow-all-rule\" style=\"text-align: justify;\">(\u4e94)\u3001\u201c\u5168\u90e8\u5141\u8bb8\u201d\u89c4\u5219<\/h2>\n<p style=\"text-align: justify;\">\u5bf9\u4e8e\u4e00\u822c\u7f51\u7edc\u7684\u4f7f\u7528\uff0c\u5728\u5185\u90e8\u63a5\u53e3\u7684\u89c4\u5219\u5217\u8868\u7684\u5e95\u90e8\u5b58\u5728\u201c\u5168\u90e8\u5141\u8bb8\u201d\u89c4\u5219\u662f\u5408\u7406\u7684\u3002\u539f\u56e0\u662f\u6b64\u89c4\u5219\u5c06\u5141\u8bb8\u6240\u6709\u672a\u88ab\u7279\u522b\u963b\u6b62\u7684\u6d41\u91cf\u901a\u8fc7\u9632\u706b\u5899\uff0c\u5305\u62ec\u672c\u5730\u7f51\u7edc\u6216Internet\u4e0a\u7684\u6d41\u91cf\uff0c\u8fd9\u6837\u7684\u89c4\u5219\u4ee3\u8868\u4e86\u5927\u591a\u6570\u7528\u6237\u7684\u6b63\u5e38\u4f7f\u7528\u9700\u6c42\u3002<\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u5e0c\u671b\u9632\u706b\u5899\u6267\u884c\u66f4\u4e25\u683c\u7684\u63a7\u5236\uff0c\u8bf7\u786e\u8ba4\u81ea\u5df1\u6240\u6709\u5e94\u7528\u6240\u9700\u8981\u4f7f\u7528\u7684\u51fa\u7ad9\u7aef\u53e3\uff0c\u4ee5\u6ee1\u8db3\u7279\u5b9a\u7684\u4f7f\u7528\u9700\u6c42\uff0c\u5e76\u7981\u6b62\u5176\u4ed6\u4e0d\u9700\u8981\u7684\u8bbf\u95ee\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u914d\u7f6e\u9632\u706b\u5899\u7684\u89c4\u5219\u4e4b\u524d\uff0c\u5e94\u8be5\u505a\u7684\u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u82b1\u4e00\u4e9b\u65f6\u95f4\u601d\u8003\u901a\u8fc7\u6784\u5efa\u81ea\u5df1\u7684\u9632\u706b\u5899\u8981 &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=3744\">\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":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[325],"class_list":["post-3744","post","type-post","status-publish","format-standard","hentry","category-opnsense","tag-325"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/3744","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=3744"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/3744\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}