{"id":14877,"date":"2025-05-08T15:08:01","date_gmt":"2025-05-08T07:08:01","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=14877"},"modified":"2025-05-08T15:18:54","modified_gmt":"2025-05-08T07:18:54","slug":"opnsense-%e9%85%8d%e7%bd%ae%e9%80%8f%e6%98%8e%e7%bd%91%e6%a1%a5","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=14877","title":{"rendered":"OPNsense\u914d\u7f6e\u900f\u660e\u7f51\u6865"},"content":{"rendered":"<div class=\" mb-4\" style=\"text-align: justify;\">\u5f88\u591a\u7528\u6237\u62e5\u6709 ISP \u63d0\u4f9b\u7684\u8def\u7531\u5668\u6216\u4ed6\u4eec\u81ea\u5df1\u7684\u7f51\u5173\/\u8def\u7531\u5668\u8bbe\u5907\uff0c\u4ed6\u4eec\u66f4\u559c\u6b22\u4f7f\u7528\u8fd9\u4e9b\u8bbe\u5907\uff0c\u5e0c\u671b\u5728\u4e0d\u66f4\u6362\u7f51\u7edc\u8bbe\u5907\u7684\u60c5\u51b5\u4e0b\u4e3a\u4ed6\u4eec\u7684\u7f51\u7edc\u589e\u52a0\u66f4\u9ad8\u7684\u5b89\u5168\u6027\u3002\u900f\u660e\u7f51\u6865\u5141\u8bb8\u4fdd\u7559\u73b0\u6709\u7684\u7f51\u7edc\u57fa\u7840\u8bbe\u65bd\uff0c\u4f46\u5728\u7f51\u7edc\u4e2d\u63d2\u5165\u9632\u706b\u5899\u3002<\/div>\n<div class=\"\">\n<div class=\"content\">\n<h2 id=\"what-is-a-transparent-filtering-bridge\" style=\"text-align: justify;\">\u4ec0\u4e48\u662f\u900f\u660e\u7f51\u6865<\/h2>\n<p style=\"text-align: justify;\">\u900f\u660e\u7f51\u6865\u80fd\u591f\u68c0\u67e5\u904d\u5386\u4e00\u4e2a\u7269\u7406\u7f51\u7edc\u63a5\u53e3\u4e0a\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u5e76\u5c06\u6d41\u91cf\u8f6c\u53d1\u5230\u53e6\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3\uff08\u5982\u679c\u5141\u8bb8\u901a\u8fc7\uff09\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u9632\u706b\u5899\u89c4\u5219\u548c\u5176\u4ed6\u73b0\u6709\u7684\u5b89\u5168\u4fdd\u62a4\u63aa\u65bd\u3002<\/p>\n<p style=\"text-align: justify;\">\u900f\u660e\u7f51\u6865\u9700\u8981\u6700\u5c11\u4e24\u4e2a\u7269\u7406\u7f51\u7edc\u63a5\u53e3\uff1a\u4e00\u4e2a\u7528\u4e8e\u5165\u7ad9\u8fde\u63a5\uff0c\u4e00\u4e2a\u7528\u4e8e\u51fa\u7ad9\u8fde\u63a5\u3002<\/p>\n<h2 id=\"location-of-a-transparent-filtering-bridge\" style=\"text-align: justify;\">\u900f\u660e\u7f51\u6865\u7684\u4f4d\u7f6e<\/h2>\n<p style=\"text-align: justify;\">\u900f\u660e\u7f51\u6865\u4e00\u822c\u653e\u5728\u4ee5\u4e0b\u4f4d\u7f6e\uff1a<\/p>\n<p style=\"text-align: justify;\">1\u3001\u8c03\u5236\u89e3\u8c03\u5668\u548c\u8def\u7531\u5668\u4e4b\u95f4<\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u662f\u5355\u72ec\u7684\u8c03\u5236\u89e3\u8c03\u5668\u548c\u5355\u72ec\u7684\u8def\u7531\u5668\uff0c\u53ef\u4ee5\u5728\u8c03\u5236\u89e3\u8c03\u5668\u548c\u8def\u7531\u5668\u4e4b\u95f4\u653e\u7f6e\u900f\u660e\u8fc7\u6ee4\u6865\uff0c\u4ee5\u4fbf\u9632\u706b\u5899\u4f4d\u4e8e\u7f51\u7edc\u7684\u6700\u5916\u5c42\u3002<\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u53ea\u5bf9\u4fdd\u62a4\u7f51\u7edc\u7684\u8fb9\u754c\u611f\u5174\u8da3\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u8fd9\u79cd\u90e8\u7f72\u3002<\/p>\n<p style=\"text-align: justify;\">\u6ce8\u610f\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u6e90\u6216\u76ee\u6807 IP \u5730\u5740\u662f\u8def\u7531\u5668\u7684\u516c\u6709WAN \u5730\u5740\uff0c\u56e0\u6b64\u4e0d\u4f1a\u77e5\u9053\u6d41\u91cf\u6765\u81ea\u7f51\u7edc\u4e2d\u7684\u54ea\u4e2a\u8bbe\u5907\uff0c\u7f51\u7edc\u6d41\u91cf\u7f3a\u4e4f\u53ef\u89c1\u6027\u3002<\/li>\n<li>\u867d\u7136\u53ef\u4ee5\u963b\u6b62\u8fdb\u51fa\u7f51\u7edc\u7684\u6d41\u91cf\uff0c\u4f46\u65e0\u6cd5\u963b\u6b62\u7f51\u7edc\u5185\uff08\u5404\u79cd VLAN \u4e4b\u95f4\u7b49\uff09\u7684\u4efb\u4f55\u6d41\u91cf\uff0c\u56e0\u4e3a\u7f51\u6865\u4f4d\u4e8e\u8def\u7531\u5668\u7684 WAN \u63a5\u53e3\u4e4b\u524d\u3002<\/li>\n<\/ul>\n<p id=\"between-the-router-and-network-switch\" style=\"text-align: justify;\">2\u3001\u8def\u7531\u5668\u548c\u7f51\u7edc\u4ea4\u6362\u673a\u4e4b\u95f4<\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u662f\u591a\u5408\u4e00\u8c03\u5236\u89e3\u8c03\u5668\/\u8def\u7531\u5668\u6216\u5176\u4ed6\u8def\u7531\u5668\/\u7f51\u5173\u8bbe\u5907\uff0c\u5219\u53ef\u4ee5\u5728\u8def\u7531\u5668\u548c\u7f51\u7edc\u4ea4\u6362\u673a\u4e4b\u95f4\u653e\u7f6e\u900f\u660e\u7f51\u6865\u3002<\/p>\n<p style=\"text-align: justify;\">\u8be5\u90e8\u7f72\u7684\u6700\u5927\u4f18\u52bf\u662f\uff0c\u9664\u4e86\u901a\u8fc7 WAN \u63a5\u53e3\u8fdb\u51fa\u7f51\u7edc\u7684\u6d41\u91cf\u5916\uff0c\u8fd8\u53ef\u4ee5\u8fc7\u6ee4\u672c\u5730\u7f51\u7edc\u5185\u7684\u6d41\u91cf\u3002\u5bf9\u5185\u90e8\u7f51\u7edc\uff08\u5728\u5404\u79cd VLAN \u4e0a\uff09\u6709\u66f4\u5927\u7684\u53ef\u89c1\u6027\uff0c\u56e0\u4e3a\u6240\u6709\u672c\u5730\u8def\u7531\u7684\u7f51\u7edc\u6d41\u91cf\u90fd\u5fc5\u987b\u901a\u8fc7\u8def\u7531\u5668\uff0c\u56e0\u6b64\u5fc5\u987b\u901a\u8fc7\u900f\u660e\u7f51\u6865\u3002<\/p>\n<p id=\"on-a-single-vlan-such-as-the-dmz-network\" style=\"text-align: justify;\">3\u3001\u5728\u5355\u4e2aVLAN \u4e0a\uff0c\u5982 DMZ \u7f51\u7edc<\/p>\n<p style=\"text-align: justify;\">\u5373\u4f7f\u4e3b\u7f51\u7edc\u8def\u7531\u5668\u5177\u6709\u5f3a\u5927\u7684\u9632\u706b\u5899\u548c\u5176\u4ed6\u5b89\u5168\u529f\u80fd\uff0c\u4e5f\u53ef\u80fd\u5e0c\u671b\u90e8\u7f72\u7b2c\u4e8c\u4e2a\u9632\u706b\u5899\uff0c\u4ee5\u66f4\u597d\u5730\u4fdd\u62a4\u672c\u5730\u7f51\u7edc\u514d\u53d7\u9762\u5411\u516c\u4f17\u7684 DMZ \u7f51\u7edc\u7684\u5f71\u54cd\u3002<\/p>\n<p style=\"text-align: justify;\">\u4f01\u4e1a\u53ef\u80fd\u5e0c\u671b\u9009\u62e9\u4e3a\u8f85\u52a9\u9632\u706b\u5899\u4f7f\u7528\u4e0d\u540c\u7684\u4f9b\u5e94\u5546\uff0c\u4ee5\u6700\u5927\u9650\u5ea6\u5730\u964d\u4f4e\u4e00\u4e2a\u54c1\u724c\u9632\u706b\u5899\u7684\u6f0f\u6d1e\u88ab\u8f85\u52a9\u9632\u706b\u5899\u5229\u7528\u7684\u53ef\u80fd\u6027\uff08\u5982\u679c\u5b83\u662f\u540c\u4e00\u4f9b\u5e94\u5546\uff09\u3002<\/p>\n<p style=\"text-align: justify;\">\u4ece\u672c\u8d28\u4e0a\u8bb2\uff0c\u53ef\u4ee5\u5728\u7f51\u7edc\u4e0a\u7684\u4efb\u610f\u4e24\u53f0\u8bbe\u5907\u4e4b\u95f4\u653e\u7f6e\u4e00\u4e2a\u900f\u660e\u7f51\u6865\u3002\u6211\u751a\u81f3\u6d4b\u8bd5\u4e86\u4e24\u53f0 PC \u4e4b\u95f4\u7684\u900f\u660e\u8fc7\u6ee4\u7f51\u6865\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u6d4b\u8bd5\u6211\u7684\u793a\u4f8b\u7f51\u7edc\u4e2d\u4f7f\u7528\u7684 Gown R86S-P2 \u7684\u541e\u5410\u91cf\u3002\u5728\u542f\u7528 Intel N5105 CPU \u7684 Zenarmor \u7684\u60c5\u51b5\u4e0b\u83b7\u5f97 1.8-2 Gbps\uff0c\u5bf9\u4e8e\u8f83\u65e7\u3001\u8f83\u6162\u7684 CPU \u6765\u8bf4\u76f8\u5f53\u4e0d\u9519\u3002R86S-P2 \u51e0\u4e4e\u53ef\u4ee5\u5b8c\u5168\u9971\u548c 2.5 Gbps\u3002<\/p>\n<h2 id=\"example-network\" style=\"text-align: justify;\">\u793a\u4f8b\u7f51\u7edc<\/h2>\n<p style=\"text-align: justify;\">\u4e0b\u9762\u662f\u5728\u672c\u793a\u4f8b\u4e2d\u4f7f\u7528\u7684\u7f51\u7edc\u8bbe\u5907\u3002\u5305\u62ec\u73b0\u6709\u8def\u7531\u5668 \uff08Grandstream GCC6010\uff09\u3001\u7f51\u7edc\u4ea4\u6362\u673a \uff08Grandstream GWN7811P\uff09 \u548c\u65e0\u7ebf\u63a5\u5165\u70b9 \uff08Grandstream GWN7664E\uff09 \u7ec4\u6210\u3002\u7f51\u7edc\u4e0a\u8fd8\u6709\u4e00\u53f0 PC \uff08ZimaBoard 832\uff09\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img diagram \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/physical-network-photo_hu516a4c1b86ec1113e6e0a39a5ac8ca24_476615_1400x991_resize_q90_h2_lanczos.webp\" alt=\"\u7269\u7406\u7f51\u7edc\" width=\"1400\" height=\"991\" \/><\/p>\n<p style=\"text-align: justify;\">\u5728\u672c\u6307\u5357\u7684\u793a\u4f8b\u573a\u666f\u4e2d\uff0c\u5c06\u628a\u900f\u660e\u6865\u63a5\u8bbe\u5907 \uff08Gowin R86S-P2\uff09 \u653e\u7f6e\u5728\u8def\u7531\u5668\u548c\u7f51\u7edc\u4ea4\u6362\u673a\u4e4b\u95f4\uff0c\u8ba9\u8bbe\u5907\u7684\u53ef\u89c1\u6027\u66f4\u9ad8\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img diagram \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/physical-network-with-bridge-photo_hu4138a4f62887290e908a1039cecfc949_385805_1400x873_resize_q90_h2_lanczos.webp\" alt=\"\u5177\u6709\u900f\u660e\u7f51\u6865\u7684\u7269\u7406\u7f51\u7edc\" width=\"1400\" height=\"873\" \/><\/p>\n<p style=\"text-align: justify;\">\u5927\u591a\u6570\u900f\u660e\u8fc7\u6ee4\u6865\u6307\u5357\u5c06\u6f14\u793a\u5982\u4f55\u8bbe\u7f6e\u4ec5\u5305\u542b\u4e24\u4e2a\u7f51\u7edc\u63a5\u53e3\u7684\u8fc7\u6ee4\u6865\u3002\u4f46\u662f\uff0c\u6211\u5c06\u6f14\u793a\u5982\u4f55\u4f7f\u7528\u4e09\u4e2a\u7269\u7406\u63a5\u53e3\u3002\u6211\u975e\u5e38\u559c\u6b22\u4e3a\u6211\u7684\u6240\u6709\u7f51\u7edc\u57fa\u7840\u8bbe\u65bd\uff08\u5982\u8def\u7531\u5668\/\u9632\u706b\u5899\u3001\u670d\u52a1\u5668\u3001NAS \u548c\u5176\u4ed6\u8bbe\u5907\uff09\u8bbe\u7f6e\u4e13\u7528\u7ba1\u7406\u63a5\u53e3\u3002<\/p>\n<p style=\"text-align: justify;\">\u62e5\u6709\u4e13\u95e8\u7528\u4e8e\u7ba1\u7406\u7684\u7b2c\u4e09\u4e2a\u754c\u9762\u7684\u4e00\u4e2a\u4f18\u70b9\u662f\uff0c\u5728\u914d\u7f6e\u6865\u63a5\u63a5\u53e3\u65f6\uff0c\u60a8\u4e0d\u4f1a\u88ab OPNsense Web \u754c\u9762\u9501\u5b9a\u3002\u8fd9\u662f\u6211\u6ce8\u610f\u5230\u7ecf\u5e38\u53d1\u751f\u7684\u4e00\u4e2a\u95ee\u9898\u662f\uff0c\u7528\u6237\u65e0\u610f\u4e2d\u5c06\u81ea\u5df1\u9501\u5b9a\u5728 Web \u754c\u9762\u4e4b\u5916\u2014\u2014\u5373\u4f7f\u6865\u63a5\u5668\u672c\u8eab\u5de5\u4f5c\u6b63\u5e38\u3002<\/p>\n<h2 id=\"1-install-opnsense\" style=\"text-align: justify;\">\u5b89\u88c5OPNsense<\/h2>\n<p style=\"text-align: justify;\">\u5bf9\u4e8e\u672c\u6307\u5357\uff0c\u53ea\u9700\u8ba9\u5b89\u88c5\u7a0b\u5e8f\u5728\u4e0d\u6309\u4efb\u4f55\u952e\u7684\u60c5\u51b5\u4e0b\u542f\u52a8\uff0c\u4ee5\u4fbf\u5b83\u4f7f\u7528 WAN\/LAN \u63a5\u53e3\u5206\u914d\u7684\u9ed8\u8ba4\u8bbe\u7f6e\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0cOPNsense \u9ed8\u8ba4\u5c06\u7b2c\u4e00\u4e2a\u63a5\u53e3\u4f5c\u4e3aLAN\uff0c\u7b2c\u4e8c\u4e2a\u63a5\u53e3\u4f5c\u4e3aWAN \u3002\u5b89\u88c5\u7a0b\u5e8f\u8fd0\u884c\u5230\u63d0\u793a\u7b26\u540e\uff0c\u8f93\u5165installer\/opnsense\u7528\u6237\u540d\u548c\u5bc6\u7801\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u8bbf\u95ee https:\/\/192.168.1.1 \u767b\u5f55 OPNsense\u3002<\/p>\n<h2 id=\"2-optional-change-default-ip-addresses-of-lan-interface\" style=\"text-align: justify;\">\u66f4\u6539LAN\u63a5\u53e3IP<\/h2>\n<p style=\"text-align: justify;\">\u5efa\u8bae\u5728\u914d\u7f6e\u65b0\u7684 MGMT \u63a5\u53e3\u4e4b\u524d\uff0c\u5728 OPNsense \u4e2d\u66f4\u6539 LAN \u63a5\u53e3\u7684\u9ed8\u8ba4 IP \u5730\u5740\u8303\u56f4\uff0c\u56e0\u4e3a\u76ee\u6807\u662f\u5c06 MGMT \u63a5\u53e3\u653e\u5728\u73b0\u6709\u7f51\u7edc\u4e0a\u3002\u8f6c\u5230\u201cInterfaces &gt; [LAN]\u201d\u9875\u9762\uff0c\u5c06\u201cIPv4 \u5730\u5740\u201d\u66f4\u6539\u4e3a192.168.2.1\/24\u3002<\/p>\n<p style=\"text-align: justify;\">\u70b9\u51fb \u201cSave\u201d \u6309\u94ae\uff0c\u4f46\u4e0d\u8981\u70b9\u51fb \u201cApply changes\u201d\uff01\u5982\u679c\u5355\u51fb\u201c\u5e94\u7528\u66f4\u6539\u201d\uff0c\u5c06\u4f1a\u65ad\u5f00\u4e0e Web UI \u7684\u8fde\u63a5\uff0c\u7136\u540e\u624d\u80fd\u66f4\u6539 DHCP \u8303\u56f4\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/change-lan-interface-ip_hu23a233a0aeb6d398cbac16ed86696423_79033_1104x1540_resize_q90_h2_lanczos_3.webp\" alt=\"\u66f4\u6539 LAN \u63a5\u53e3 IP\" width=\"1104\" height=\"1540\" \/><\/p>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201cServices &gt; ISC DHCPv4 &gt; [LAN]\u201d\u9875\u9762\u3002\u5c06\u201cRange\u201d\u66f4\u6539\u4e3a192.168.2.100-192.168.2.199\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/change-lan-dhcp-range_hu38111f19e71988fc80dc7de3222774c8_48683_1104x948_resize_q90_h2_lanczos_3.webp\" alt=\"\u66f4\u6539 LAN DHCP \u8303\u56f4\" width=\"1104\" height=\"948\" \/><\/p>\n<p style=\"text-align: justify;\">\u8fd4\u56de\u201cInterfaces &gt; [LAN]\u201d\u9875\u9762\uff0c\u7136\u540e\u5355\u51fb\u201cApply changes\u201d\u3002\u4f1a\u6682\u65f6\u65e0\u6cd5\u8bbf\u95ee OPNsense Web UI\u3002\u6b64\u65f6\u65ad\u5f00\u5e76\u91cd\u65b0\u8fde\u63a5 PC\uff08\u6216\u542f\u52a8 DHCP \u7248\u672c\u5e76\u7eed\u8ba2\uff09\uff0c\u5e94\u8be5\u4f1a\u83b7\u5f97\u4e00\u4e2a\u65b0\u7684192.168.2.x\u5730\u5740\u3002\u8bbf\u95ee\u00a0https:\/\/192.168.2.1\uff0c\u00a0\u91cd\u65b0\u767b\u5f55 OPNsense\u3002<\/p>\n<h2 id=\"3-configure-a-new-management-interface\" style=\"text-align: justify;\">\u914d\u7f6e\u7ba1\u7406\u63a5\u53e3<\/h2>\n<p style=\"text-align: justify;\">\u662f\u5426\u53ef\u4ee5\u7b80\u5355\u5730\u4f7f\u7528\u9ed8\u8ba4\u7684 LAN \u63a5\u53e3\u4f5c\u4e3a\u7ba1\u7406\u63a5\u53e3\uff0c\u5728\u53e6\u5916\u4e24\u4e2a\u7269\u7406\u63a5\u53e3\u4e0a\u521b\u5efa\u7f51\u6865\uff1f\u53ef\u4ee5\u8fd9\u6837\u505a\uff0c\u4f46\u5982\u679c\u4e0d\u6b63\u786e\u66f4\u6539\u8bbe\u7f6e\uff0c\u53ef\u80fd\u4f1a\u5c06\u81ea\u5df1\u9501\u5b9a\u5728 OPNsense Web UI \u4e4b\u5916\u3002<\/p>\n<h3 id=\"31-assign-the-mgmt-interface\" style=\"text-align: justify;\">\u5206\u914dMGMT\u63a5\u53e3<\/h3>\n<p style=\"text-align: justify;\">\u8f6c\u5230 \u201cInterfaces &gt; Assignments\u201d \u9875\u9762\u3002\u201cDevice\uff08\u8bbe\u5907\uff09\u201d\u4e0b\u62c9\u5217\u8868\u4e2d\u5e94\u8be5\u5217\u51fa\u4e86\u672a\u4f7f\u7528\u7684\u7f51\u7edc\u63a5\u53e3\uff0c\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u9009\u62e9igc2\u4f5c\u4e3a MGMT \u63a5\u53e3\u3002\u8f93\u5165\u63a5\u53e3\u7684\u63cf\u8ff0\u4fe1\u606fMGMT\uff0c\u5355\u51fb \u201cAdd\u201d \u6309\u94ae\u5206\u914d\u63a5\u53e3\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/assign-mgmt-interface_hu8a69cb9b85a59a799f881ed2241c61ae_155368_1564x827_resize_q90_h2_lanczos_3.webp\" alt=\"\u5206\u914d MGMT \u63a5\u53e3\" width=\"1564\" height=\"827\" \/><\/p>\n<h3 id=\"32-enable-the-mgmt-interface\" style=\"text-align: justify;\">\u542f\u7528MGMT\u63a5\u53e3<\/h3>\n<p style=\"text-align: justify;\">\u5728\u63a5\u53e3\u83dc\u5355\uff0c\u5355\u51fb MGMT \u63a5\u53e3\uff0c\u5355\u51fb\u201cEnable Interface\uff08\u542f\u7528\u63a5\u53e3\uff09\u201d\u590d\u9009\u6846\uff0c\u9009\u4e2d\u201cPrevent interface removal\uff08\u963b\u6b62\u63a5\u53e3\u5220\u9664\uff09\u201d\u9009\u9879\uff0c\u4ee5\u51cf\u5c11\u5728\u4ee5\u540e\u9700\u8981\u8fdb\u884c\u66f4\u6539\u65f6\u610f\u5916\u5220\u9664\u63a5\u53e3\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<p style=\"text-align: justify;\">\u9009\u62e9\u7528\u4e8e\u4e3a\u7ba1\u7406\u63a5\u53e3\u8bbe\u7f6e\u9759\u6001 IP \u7684\u9009\u9879\uff0c\u5728\u5bf9\u4e8e \u201cIPv4 Configuration Type\uff08IPv4 \u914d\u7f6e\u7c7b\u578b\uff09\u201d\u90e8\u5206\uff0c\u9009\u4e2dStatic IPv4\u3002\u5728\u201c\u9759\u6001 IPv4 \u914d\u7f6e\u201d\u90e8\u5206\u4e2d\uff0c\u8f93\u5165\u201cIPv4 \u5730\u5740\u201d\uff0c\u9700\u8981\u786e\u4fdd\u9759\u6001 IP \u5730\u5740\u4e0d\u4f4d\u4e8e\u60a8\u5728\u4e3b\u8def\u7531\u5668\u4e0a\u8bbe\u7f6e\u7684 DHCP \u8303\u56f4\u5185\uff0c\u5e76\u4e14\u4e0d\u4f1a\u4e0e\u7ba1\u7406\u7f51\u7edc\u4e0a\u7684\u4efb\u4f55\u5176\u4ed6\u9759\u6001 IP \u5730\u5740\u51b2\u7a81\u3002\u70b9\u51fb\u9875\u9762\u5e95\u90e8\u7684 \u201cSave\u201d \u6309\u94ae\uff0c\u7136\u540e\u70b9\u51fb\u9875\u9762\u9876\u90e8\u7684 \u201cApply changes\u201d \u6309\u94ae\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/enable-mgmt-interface_huf673f44d0e3a1b0c091f4d04203373c7_98843_1186x1759_resize_q90_h2_lanczos_3.webp\" alt=\"\u542f\u7528 MGMT \u63a5\u53e3\" width=\"1186\" height=\"1759\" \/><\/p>\n<h3 id=\"33-create-the-appropriate-firewall-rules\" style=\"text-align: justify;\">\u521b\u5efa\u9632\u706b\u5899\u89c4\u5219<\/h3>\n<p style=\"text-align: justify;\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u65b0\u63a5\u53e3\u6ca1\u6709\u5206\u914d\u4efb\u4f55\u9632\u706b\u5899\u89c4\u5219\uff0c\u8fd9\u610f\u5473\u7740\u63a5\u53e3\u4e0a\u7684\u6240\u6709\u7f51\u7edc\u6d41\u91cf\u90fd\u88ab\u963b\u6b62\uff08\u7531\u4e8e\u9632\u706b\u5899\u7684 \u201c\u9ed8\u8ba4\u62d2\u7edd\u201d \u7b56\u7565\uff09\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728\u201cFirewall &gt; Rules &gt; MGMT\u201d\u9875\u9762\u4e0a\uff0c\u9700\u8981\u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n<table style=\"height: 69px;\" width=\"977\">\n<thead>\n<tr>\n<th>\u52a8\u4f5c<\/th>\n<th>TCP\/IP \u7248\u672c<\/th>\n<th>\u534f\u8bae<\/th>\n<th>\u6e90<\/th>\n<th>\u76ee\u6807<\/th>\n<th>\u76ee\u6807\u7aef\u53e3<\/th>\n<th>\u63cf\u8ff0<\/th>\n<th><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Pass<\/td>\n<td>IPv4 \u534f\u8bae<\/td>\n<td>TCP \u534f\u8bae<\/td>\n<td>MGMT net<\/td>\n<td>MGMT address<\/td>\n<td>443 \uff08HTTPS\uff09<\/td>\n<td>Allow access to OPNsense web UI<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"notice tip\" style=\"text-align: justify;\">\n<div class=\"notice-head\">\n<p>\u5982\u679c\u5e0c\u671b\u5141\u8bb8 SSH \u8bbf\u95ee OPNsense \u7cfb\u7edf\uff0c\u5219\u8fd8\u9700\u8981\u521b\u5efa\u4e0e\u4e0a\u8ff0\u89c4\u5219\u7c7b\u4f3c\u7684\u89c4\u5219\uff0c \u76ee\u6807\u7aef\u53e3\u66f4\u6539\u4e3a22\u5373\u53ef\u3002<\/p>\n<\/div>\n<\/div>\n<h2 id=\"4-test-the-mgmt-interface\" style=\"text-align: justify;\">\u6d4b\u8bd5MGMT\u63a5\u53e3<\/h2>\n<p style=\"text-align: justify;\">\u5728\u914d\u7f6e\u7f51\u6865\u5e76\u5220\u9664\u73b0\u6709 LAN \u63a5\u53e3\uff08\u56e0\u4e3a\u5b83\u5c06\u6210\u4e3a\u8fc7\u6ee4\u7f51\u6865\u7684\u4e00\u90e8\u5206\uff09\u4e4b\u524d\uff0c\u5148\u6d4b\u8bd5\u5bf9 MGMT \u63a5\u53e3\u7684\u8bbf\u95ee\u662f\u5426\u987a\u5229\u3002\u786e\u4fdd\u5728\u8bbe\u7f6e\u8fc7\u6ee4\u7f51\u6865\u65f6\u4e0d\u4f1a\u5931\u53bb\u5bf9 OPNsense \u7cfb\u7edf\u7684\u8bbf\u95ee\u6743\u9650\u3002\u6d4b\u8bd5\u6ca1\u6709\u95ee\u9898\u540e\uff0c\u8f93\u5165 https:\/\/192.168.1.99\uff0c \u767b\u5f55 OPNsense Web UI\u3002<\/p>\n<p style=\"text-align: justify;\">\u73b0\u5728\u53ef\u4ee5\u81ea\u7531\u4fee\u6539\u5176\u4ed6\u4e24\u4e2a\u63a5\u53e3\u7684\u914d\u7f6e\uff0c\u800c\u4e0d\u5fc5\u62c5\u5fc3\u5931\u53bb\u5bf9 OPNsense \u7684\u8bbf\u95ee\u6743\u9650\u3002\u5373\u4f7f\u6ca1\u6709\u6b63\u786e\u914d\u7f6e\u900f\u660e\u6865\uff0c\u53ea\u8981\u4e0d\u4fee\u6539 MGMT \u63a5\u53e3\u7684\u914d\u7f6e\uff0c\u4ecd\u7136\u53ef\u4ee5\u8bbf\u95ee\u6b63\u5e38OPNsense\u3002<\/p>\n<h2 id=\"5-configure-the-transparent-filtering-bridge\" style=\"text-align: justify;\">\u914d\u7f6e\u900f\u660e\u7f51\u6865<\/h2>\n<p style=\"text-align: justify;\">\u672c\u8282\u4e2d\u7684\u6b65\u9aa4\u4e0e OPNsense \u8bf4\u660e\u76f8\u5bf9\u63a5\u8fd1\uff0c\u4f46\u6709\u4e00\u4e9b\u7ec6\u5fae\u7684\u5dee\u5f02\u3002\u7531\u4e8e\u5df2\u7ecf\u914d\u7f6e\u4e86\u5355\u72ec\u7684\u7269\u7406 MGMT \u63a5\u53e3\uff0c\u56e0\u6b64\u53ef\u4ee5\u8df3\u8fc7\u6709\u5173\u5728\u7f51\u6865\u4e0a\u914d\u7f6e\u7ba1\u7406\u63a5\u53e3\u7684OPNsense\u6b65\u9aa4\u3002<\/p>\n<h3 id=\"51-disable-outbound-nat-generation\" style=\"text-align: justify;\">\u7981\u7528\u51faNAT\u89c4\u5219\u751f\u6210<\/h3>\n<p style=\"text-align: justify;\">\u7531\u4e8eOPNsense\u5c06\u4f5c\u4e3a\u8fc7\u6ee4\u7f51\u6865\u800c\u4e0d\u662f\u8def\u7531\u5668\u8fd0\u884c\uff0c\u56e0\u6b64\u53ef\u4ee5\u7981\u7528\u51fa\u7ad9 NAT\u3002\u5728\u201cFirewall &gt; NAT &gt; Outbound\u201d\u9875\u9762\u4e0a\uff0c\u5355\u51fb\u201cDisable outbound NAT rule generation\u201d\u7684\u5355\u9009\u6309\u94ae\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/disable-outbound-nat_hud24b7a29b2bc61e5e4829c97f9c39ee9_33759_1100x332_resize_q90_h2_lanczos_3.webp\" alt=\"\u7981\u7528\u51fa\u7ad9 NAT\" width=\"1100\" height=\"332\" \/><\/p>\n<p style=\"text-align: justify;\">\u70b9\u51fb \u201cSave\u201d \u548c \u201cApply changes\u201d\u3002<\/p>\n<h3 id=\"52-modify-the-system-tunable-options\" style=\"text-align: justify;\">\u4fee\u6539\u7cfb\u7edf\u53ef\u8c03\u9009\u9879<\/h3>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230\u201cSystem &gt; Settings &gt; Tunables\u201d\u9875\u9762\uff0c\u4fee\u6539\u51e0\u4e2a\u7cfb\u7edf\u53ef\u8c03\u53c2\u6570\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/system-tunables_huc6c2c6b247e7c5672dad91d52bb8837e_174188_1543x1239_resize_q90_h2_lanczos_3.webp\" alt=\"\u7cfb\u7edf\u53ef\u8c03\u53c2\u6570\" width=\"1543\" height=\"1239\" \/><\/p>\n<p style=\"text-align: justify;\">\u5728\u6d4f\u89c8\u5668\u4e2d\u6309\u201cCtrl F\u201d\u641c\u7d22\u6587\u672c\uff0c\u6216\u5411\u4e0b\u6eda\u52a8\u67e5\u627e\u53ef\u8c03\u9009\u9879\u3002\u5355\u51fb\u94c5\u7b14\u56fe\u6807\u6765\u7f16\u8f91\u6761\u76ee\u3002\u5c06net.link.bridge.pfil_bridger\u503c\u66f4\u6539\u4e3a1\u4ee5\u4fbf\u5728\u6865\u63a5\u63a5\u53e3\u4e0a\u542f\u7528\u8fc7\u6ee4\u3002\u5c06net.link.bridge.pfil_member\u503c\u66f4\u6539\u4e3a0\u7981\u7528\u5bf9\u5355\u4e2a\u7269\u7406\u63a5\u53e3\u7684\u8fc7\u6ee4\u3002\u70b9\u51fb \u201cApply changes\u201d\uff08\u5e94\u7528\u66f4\u6539\uff09\u3002<\/p>\n<h3 id=\"53-create-the-bridge-interface\" style=\"text-align: justify;\">\u521b\u5efaBridge\u63a5\u53e3<\/h3>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201cInterfaces &gt; Devices &gt; Bridge\u201d\uff0c\u5355\u51fb\u201c \u201d\u6309\u94ae\u6dfb\u52a0\u6865\u63a5\u63a5\u53e3\u3002\u201cMember interfaces\u201d\u9009\u9879\u9009\u4e2dLAN\u548cWAN\uff0c\u8f93\u5165\u6865\u7684\u63cf\u8ff0\u4fe1\u606fBRIDGE\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/create-bridge_hu9680e00ccb58e8c3e5bbed9c8d0c7702_25599_848x492_resize_q90_h2_lanczos_3.webp\" alt=\"\u521b\u5efa Bridge\" width=\"848\" height=\"492\" \/><\/p>\n<p style=\"text-align: justify;\">\u70b9\u51fb\u201cSave\u201d\u3002<\/p>\n<h3 id=\"54-assign-the-bridge-interface\" style=\"text-align: justify;\">\u5206\u914d\u7f51\u6865\u63a5\u53e3<\/h3>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201cInterfaces &gt; Assignments\u201d\u9875\u9762\uff0c\u201cDevice\u201d\u9009\u4e2dbridge0 (BRIDGE)\uff0c\u8f93\u5165\u63a5\u53e3\u7684\u201c\u63cf\u8ff0\u201d\u4fe1\u606f\uff0c\u5982BRIDGE\u3002\u70b9\u51fb \u201cAdd\u201d \u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/assign-bridge-interface_hudefe60ec73ed528b8920634a1f1a9a14_190459_1579x924_resize_q90_h2_lanczos_3.webp\" alt=\"\u5206\u914d BRIDGE \u63a5\u53e3\" width=\"1579\" height=\"924\" \/><\/p>\n<h3 id=\"55-enable-the-bridge-interface\" style=\"text-align: justify;\">\u542f\u7528\u6865\u63a5\u63a5\u53e3<\/h3>\n<p style=\"text-align: justify;\">\u8f6c\u5230 \u201cInterfaces &gt; [BRIDGE]\u201d \u542f\u7528\u6865\u63a5\u63a5\u53e3\u3002\u5355\u51fb \u201cEnable Interface\u201d \u548c \u201cPrevent interface removal\u201d \u590d\u9009\u6846\u3002\u5c06\u6240\u6709\u5185\u5bb9\u4fdd\u7559\u4e3a\u9ed8\u8ba4\u503c\u3002\u70b9\u51fb \u201cSave\u201d \u5e76 \u201cApply changes\u201d\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/enable-bridge-interface_hu3115fe07d89bdcf171c3cab5c3270162_70245_1190x1307_resize_q90_h2_lanczos_3.webp\" alt=\"\u542f\u7528 BRIDGE \u63a5\u53e3\" width=\"1190\" height=\"1307\" \/><\/p>\n<h3 id=\"56-disable-the-block-private-networks-and-bogons-on-wan-interface\" style=\"text-align: justify;\">\u7981\u7528Block Private Networks\u548cBogons<\/h3>\n<p style=\"text-align: justify;\">\u8f6c\u5230 WAN \u63a5\u53e3\u914d\u7f6e\u9875\u9762\uff08\u201c\u63a5\u53e3 &gt; [WAN]\uff09\u3002<\/p>\n<p style=\"text-align: justify;\">\u53d6\u6d88\u9009\u4e2d\u201c\u963b\u6b62\u79c1\u6709\u7f51\u7edc\u201d\u548c\u201c\u963b\u6b62\u50f5\u5c38\u7f51\u7edc\u201d\u9009\u9879\uff0c\u4ee5\u9632\u6b62\u963b\u6b62\u5185\u90e8\u79c1\u6709 IP \u5730\u5740\uff08\u56e0\u4e3a\u7f51\u6865\u5c06\u8fc7\u6ee4\u5185\u90e8\u7f51\u7edc\u4e0a\u7684\u6d41\u91cf\uff09\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/disable-private-net-bogons-wan-interface_hued261b537f1020eb8d231f2992e4266b_83020_1184x1538_resize_q90_h2_lanczos_3.webp\" alt=\"\u5728 WAN \u63a5\u53e3\u4e0a\u7981\u7528\u963b\u6b62\" width=\"1184\" height=\"1538\" \/><\/p>\n<h3 id=\"57-disable-ip-addresses-on-wan-interface\" style=\"text-align: justify;\">WAN\u63a5\u53e3\u4e0a\u7981\u7528IP\u5730\u5740<\/h3>\n<p style=\"text-align: justify;\">\u8fc7\u6ee4\u7f51\u6865\u7684\u7269\u7406\u63a5\u53e3\u4e0d\u9700\u8981\u4e3a\u5176\u5206\u914d\u4efb\u4f55 IP \u5730\u5740\uff0c\u56e0\u4e3a\u6d41\u91cf\u5c06\u4ec5\u901a\u8fc7\u8fc7\u6ee4\u7f51\u6865\u3002\u5728WAN \u63a5\u53e3\uff0c\u540c\u65f6\u5c06\u201cIPv4 \u914d\u7f6e\u7c7b\u578b\u201d\u548c\u201cIPv6 \u914d\u7f6e\u7c7b\u578b\u201d\u9009\u9879\u8bbe\u7f6e\u4e3a None\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/disable-ip-addresses-wan-interface_hu29b25751d5e410178206b3f2248b1065_83077_1184x1538_resize_q90_h2_lanczos_3.webp\" alt=\"\u5728 WAN \u63a5\u53e3\u4e0a\u7981\u7528 IP \u5730\u5740\" width=\"1184\" height=\"1538\" \/><\/p>\n<h3 id=\"58-disable-dhcp-server-on-the-lan-interface\" style=\"text-align: justify;\">LAN\u63a5\u53e3\u7981\u7528DHCP\u670d\u52a1\u5668<\/h3>\n<p style=\"text-align: justify;\">\u5728\u201cServices &gt; ISC DHCPv4 &gt; [LAN]\u201d\u9875\u9762\u4e0a\uff0c\u53d6\u6d88\u9009\u4e2d\u201c\u5728 LAN \u63a5\u53e3\u4e0a\u542f\u7528 DHCP \u670d\u52a1\u5668\u201d\u590d\u9009\u6846\u3002\u70b9\u51fb\u201cSave\u201d\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/disable-dhcp-lan-interface_hub2fcdc76fa663db5e2a3d9e2262b36a7_117258_1701x1821_resize_q90_h2_lanczos_3.webp\" alt=\"\u5728 LAN \u63a5\u53e3\u4e0a\u7981\u7528 DHCP\" width=\"1701\" height=\"1821\" \/><\/p>\n<h3 id=\"59-disable-ip-addresses-on-lan-interface\" style=\"text-align: justify;\">LAN\u63a5\u53e3\u7981\u7528IP\u5730\u5740<\/h3>\n<p style=\"text-align: justify;\">\u8f6c\u5230 \u201cInterfaces &gt; [LAN]\u201d \u9875\u9762\uff0c\u5c06\u201cIPv4 \u914d\u7f6e\u7c7b\u578b\u201d\u548c\u201cIPv6 \u914d\u7f6e\u7c7b\u578b\u201d\u9009\u9879\u8bbe\u7f6e\u4e3a None\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/disable-ip-addresses-lan-interface_hu70a0517701fdb4b0c42c72382456f5ed_82006_1175x1529_resize_q90_h2_lanczos_3.webp\" alt=\"\u5728 LAN \u63a5\u53e3\u4e0a\u7981\u7528 IP \u5730\u5740\" width=\"1175\" height=\"1529\" \/><\/p>\n<h3 id=\"510-create-a-firewall-rule-on-bridge-to-allow-all-traffic\" style=\"text-align: justify;\">\u5728Bridge\u4e0a\u521b\u5efa\u9632\u706b\u5899\u89c4\u5219<\/h3>\n<p style=\"text-align: justify;\">\u914d\u7f6e\u8fc7\u6ee4\u6865\u7684\u6700\u540e\u4e00\u6b65\u662f\u521b\u5efa\u9632\u706b\u5899\u89c4\u5219\u3002\u5efa\u8bae\u521b\u5efa\u4e00\u4e2a\u201c\u5141\u8bb8\u6240\u6709\u201d\u89c4\u5219\uff0c\u4ee5\u9a8c\u8bc1\u6d41\u91cf\u662f\u5426\u53ef\u4ee5\u987a\u5229\u901a\u8fc7\u900f\u660e\u6865\uff0c\u7136\u540e\u518d\u5b9e\u65bd\u66f4\u4e25\u683c\u7684\u9632\u706b\u5899\u89c4\u5219\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728\u201cFirewall &gt; Rules &gt; BRIDGE\u201d\u9875\u9762\u4e0a\uff0c\u5355\u51fb\u201c \u201d\u6309\u94ae\u6dfb\u52a0\u89c4\u5219\u3002<\/p>\n<p style=\"text-align: justify;\">\u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219\u4ee5\u5141\u8bb8\u6240\u6709\u6d41\u91cf\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u52a8\u4f5c<\/th>\n<th>TCP\/IP \u7248\u672c<\/th>\n<th>\u534f\u8bae<\/th>\n<th>\u6e90<\/th>\n<th>\u76ee\u6807<\/th>\n<th>\u76ee\u6807\u7aef\u53e3<\/th>\n<th>\u63cf\u8ff0<\/th>\n<th><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>pass<\/td>\n<td>IPv4 IPv6 \u534f\u8bae<\/td>\n<td>any<\/td>\n<td>any<\/td>\n<td>any<\/td>\n<td>any<\/td>\n<td>allow all<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">\u70b9\u51fb \u201cSave\u201d \u7136\u540e\u70b9\u51fb \u201cApply changes\u201d\u3002<\/p>\n<h2 id=\"6-test-the-transparent-bridge\" style=\"text-align: justify;\">\u6d4b\u8bd5\u900f\u660e\u7f51\u6865<\/h2>\n<p style=\"text-align: justify;\">\u5c06\u4ee5\u592a\u7f51\u7535\u7f06\u4ece\u8def\u7531\u5668\u7684 LAN \u63a5\u53e3\u63d2\u5165\u5176\u4e2d\u4e00\u4e2a\u900f\u660e\u8fc7\u6ee4\u6865\u63a5\u63a5\u53e3\uff0c\u5c06\u53e6\u4e00\u6839\u7535\u7f06\u4ece\u7f51\u7edc\u4ea4\u6362\u673a\u63d2\u5165\u53e6\u4e00\u4e2a\u900f\u660e\u8fc7\u6ee4\u6865\u63a5\u63a5\u53e3\u3002OPNsense \u76d2\u5b50\u5c06\u4f4d\u4e8e\u8def\u7531\u5668\u548c\u7f51\u7edc\u4ea4\u6362\u673a\u4e4b\u95f4\uff0c\u7f51\u7edc\u4e0a\u7684\u5176\u4f59\u8bbe\u5907\u90fd\u4f4d\u4e8e\u8be5\u4f4d\u7f6e\uff08\u5982\u679c\u6709\u5176\u4ed6\u8bbe\u5907\u8fde\u63a5\u5230\u8def\u7531\u5668\u7684 LAN \u7aef\u53e3\uff0c\u5219\u6765\u81ea\u8fd9\u4e9b\u8bbe\u5907\u7684\u6d41\u91cf\u5c06\u4e0d\u4f1a\u88ab\u900f\u660e\u8fc7\u6ee4\u6865\u8fc7\u6ee4\uff09\u3002<\/p>\n<h3 id=\"62-optional-create-block-rule-to-test-filtering-traffic\" style=\"text-align: justify;\">\u521b\u5efa\u963b\u6b62\u89c4\u5219\u6765\u6d4b\u8bd5\u8fc7\u6ee4\u6d41\u91cf<\/h3>\n<p style=\"text-align: justify;\">\u5982\u679c\u60f3\u6d4b\u8bd5\u4f7f\u7528\u900f\u660e\u6865\u963b\u6b62\u6d41\u91cf\uff0c\u53ef\u4ee5\u7b80\u5355\u5730\u963b\u6b62\u6240\u6709\u901a\u8fc7\u8be5\u6865\u7684 HTTPS \u6d41\u91cf\uff08\u4e0d\u7528\u62c5\u5fc3\uff0c\u4ecd\u7136\u53ef\u4ee5\u8bbf\u95ee OPNsense Web UI\uff09\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728BRIDGE\u63a5\u53e3\u7684 \u201callow all\u201d \u89c4\u5219\u4e0a\u65b9\u521b\u5efa\u4ee5\u4e0b\u963b\u6b62\u89c4\u5219\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u52a8\u4f5c<\/th>\n<th>TCP\/IP \u7248\u672c<\/th>\n<th>\u534f\u8bae<\/th>\n<th>\u6e90<\/th>\n<th>\u76ee\u6807<\/th>\n<th>\u76ee\u6807\u7aef\u53e3<\/th>\n<th>\u63cf\u8ff0<\/th>\n<th><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Block<\/td>\n<td>IPv4 IPv6 \u534f\u8bae<\/td>\n<td>TCP \u534f\u8bae<\/td>\n<td>any<\/td>\n<td>any<\/td>\n<td>443 \uff08HTTPS\uff09<\/td>\n<td>Block HTTPS<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">\u5c1d\u8bd5\u8bbf\u95ee\u4efb\u4f55\u7f51\u7ad9\uff0c\u5e94\u8be5\u4f1a\u53d1\u73b0\u5b83\u5df2\u88ab\u963b\u6b62\uff08\u9664\u975e\u6253\u5f00\u4e86\u73b0\u6709\u8fde\u63a5 &#8211; \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u9632\u706b\u5899\u72b6\u6001\u4e0d\u4f1a\u81ea\u52a8\u6e05\u9664\uff09\u3002\u5b8c\u6210\u8be5\u963b\u6b62\u89c4\u5219\u7684\u6d4b\u8bd5\u540e\uff0c\u53ef\u4ee5\u7981\u7528\u6216\u5220\u9664\u5b83\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u518d\u6b21\u8bbf\u95ee\u7f51\u7ad9\u3002<\/p>\n<h2 id=\"7-allow-opnsense-to-access-internet-for-updates-and-plugins\" style=\"text-align: justify;\">\u5141\u8bb8OPNsense\u8bbf\u95eeInternet<\/h2>\n<p style=\"text-align: justify;\">\u900f\u660e\u7f51\u6865\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f46\u5f53\u5c1d\u8bd5\u66f4\u65b0 OPNsense \u65f6\uff0c\u5b83\u4f1a\u5931\u8d25\u3002\u56e0\u4e3a\u6ca1\u6709\u4e3aOPNsense\u7cfb\u7edf\u672c\u8eab\u914d\u7f6e\u7f51\u5173\u6216 DNS\u3002<\/p>\n<p style=\"text-align: justify;\">\u867d\u7136\u5df2\u4e3aMGMT\u63a5\u53e3\u914d\u7f6e\u4e86\u9759\u6001IP\u5730\u5740\uff0c\u4f46\u4e0d\u5305\u62ec\u7f51\u5173\u6216 DNS \u914d\u7f6e\u3002\u8f6c\u5230\u201cSystem &gt; Gateways &gt; Configuration\u201d\u9875\u9762\u4e0a\uff0c\u5355\u51fb\u201c \u201d\u6309\u94ae\u3002\u8f93\u5165\u7f51\u5173\u7684 \u201cName\u201d \uff08\u540d\u79f0\uff09\uff0c\u5982 GatewayMGMTMGMT\uff0cInterface\u9009\u62e9MGMT\uff0cIP Address\u8f93\u5165\u4e3b\u7f51\u7edc\u8def\u7531\u5668\u7684LAN\u63a5\u53e3IP\u5730\u5740\uff0c\u5982 192.168.1.1\u3002\u70b9\u51fb \u201cSave\u201d \u6309\u94ae\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/create-gateway_hu4959c76b8f3c363aaf207c19ca2afac8_59324_1358x974_resize_q90_h2_lanczos_3.webp\" alt=\"\u521b\u5efa\u7f51\u5173\" width=\"1358\" height=\"974\" \/><\/p>\n<h3 id=\"72-add-dns-server-to-the-system-dns-settings\" style=\"text-align: justify;\">\u6dfb\u52a0\u7cfb\u7edfDNS\u8bbe\u7f6e<\/h3>\n<p style=\"text-align: justify;\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u201cSystem &gt; Settings &gt; General\u201d\u9875\u9762\u4e0a\u6ca1\u6709\u6307\u5b9a DNS \u670d\u52a1\u5668\uff0c\u9700\u8981\u5c06 DNS \u670d\u52a1\u5668\u6dfb\u52a0\u5230\u5217\u8868\u4e2d\u3002\u8be5\u9875\u9762\u4e0a\u5217\u51fa\u7684 DNS \u670d\u52a1\u5668\u662f OPNsense \u7cfb\u7edf\u672c\u8eab\u5c06\u7528\u4e8e\u5176 DNS \u670d\u52a1\u5668\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528\u4e3b\u8def\u7531\u5668\u7684 IP \u5730\u5740\u4f5c\u4e3a DNS \u670d\u52a1\u5668\u3002<\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"img \" title=\"\" src=\"https:\/\/homenetworkguy.com\/images\/how-to\/configure-opnsense-transparent-filtering-bridge\/add-dns-server_hu1b72262dea47ede71799c23aa3834565_81403_1209x1632_resize_q90_h2_lanczos_3.webp\" alt=\"\u6dfb\u52a0 DNS \u670d\u52a1\u5668\" width=\"1209\" height=\"1632\" \/><\/p>\n<h3 id=\"73-update-opnsense-andor-download-plugins\" style=\"text-align: justify;\">\u66f4\u65b0OPNsense<\/h3>\n<p style=\"text-align: justify;\">\u73b0\u5728\u8f6c\u5230\u201c\u7cfb\u7edf&gt;\u56fa\u4ef6&gt;\u72b6\u6001\u201d\u9875\u9762\uff0c\u7136\u540e\u5355\u51fb\u201c\u68c0\u67e5\u66f4\u65b0\u201d\u6309\u94ae\u6765\u9a8c\u8bc1\u662f\u5426\u80fd\u591f\u68c0\u67e5OPNsense\u66f4\u65b0\u3002<\/p>\n<h2 id=\"8-configure-additional-security-features\" style=\"text-align: justify;\">\u914d\u7f6e\u5176\u4ed6\u529f\u80fd<\/h2>\n<p style=\"text-align: justify;\">\u9664\u4e86\u5728\u900f\u660e\u6865\u4e0a\u4f7f\u7528\u6807\u51c6\u9632\u706b\u5899\u89c4\u5219\u6765\u4fdd\u62a4\u60a8\u7684\u7f51\u7edc\u5916\uff0c\u8fd8\u53ef\u4ee5\u5728OPNsense \u7cfb\u7edf\u4e0a\u914d\u7f6e\u5176\u4ed6\u5b89\u5168\u670d\u52a1\uff0c\u4ee5\u8fdb\u4e00\u6b65\u63d0\u9ad8\u7f51\u7edc\u7684\u5b89\u5168\u6027\u3002\u4e09\u4e2a\u6d41\u884c\u7684\u9009\u62e9\u662f Zenarmor\u3001Suricata \u548c CrowdSec\u3002\u6bcf\u9879\u670d\u52a1\u90fd\u63d0\u4f9b\u4e0d\u540c\u7c7b\u578b\u7684\u4fdd\u62a4\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.zenarmor.com\/\" target=\"_blank\" rel=\"noopener\">Zenarmor<\/a> \u63d0\u4f9b\u4e91\u5a01\u80c1\u60c5\u62a5\u6765\u963b\u6b62\u5e7f\u544a\u3001\u5e94\u7528\u7a0b\u5e8f\u548c\u6076\u610f\u6d3b\u52a8\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u8bb8\u591a\u62a5\u544a\u53ef\u7528\u4e8e\u5e2e\u52a9\u53ef\u89c6\u5316\u548c\u5206\u6790\u7f51\u7edc\u6d41\u91cf\u3002\u514d\u8d39\u7248\u63d0\u4f9b\u4e86\u4e00\u5957\u57fa\u672c\u7684\u4fdd\u62a4\uff0c\u4f46\u5982\u679c\u60a8\u5e0c\u671b\u62e5\u6709\u66f4\u591a\u7684\u5b89\u5168\u529f\u80fd\u548c\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u4eec\u63d0\u4f9b\u5bb6\u5ead\u7248\u8ba2\u9605\u3002<\/p>\n<div class=\"notice tip\" style=\"text-align: justify;\">\n<div class=\"notice-body\">\n<p>\u5c06 Zenarmor \u4e0e\u900f\u660e\u8fc7\u6ee4\u6865\u4e00\u8d77\u4f7f\u7528\u65f6\uff0c\u65e0\u9700\u4f7f\u7528\u201c\u6865\u63a5\u6a21\u5f0f\u201d\u8bbe\u7f6e Zenarmor\uff0c\u56e0\u4e3a\u7531\u4e8e Zenarmor \u521b\u5efa\u6865\u63a5\u7684\u65b9\u5f0f\uff0c\u8fd9\u5c06\u7ed5\u8fc7\u6807\u51c6 OPNsense \u9632\u706b\u5899\u89c4\u5219\u3002\u56e0\u6b64\uff0c\u60a8\u5e94\u8be5\u5728\u900f\u660e\u8fc7\u6ee4\u6865\u4e0a\u4f7f\u7528 Zenarmor \u7684\u201c\u8def\u7531\u6a21\u5f0f\u201d\uff0c\u8fd9\u6837\u4ecd\u7136\u53ef\u4ee5\u5728\u900f\u660e\u6865\u4e0a\u4f7f\u7528\u6807\u51c6\u9632\u706b\u5899\u89c4\u5219\u3002<\/p>\n<\/div>\n<\/div>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/suricata.io\/\" target=\"_blank\" rel=\"noopener\">Suricata<\/a> \u62e5\u6709\u975e\u5e38\u9002\u5408\u57fa\u4e8e Web \u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u9632\u706b\u5899\u7684\u89c4\u5219\u96c6\u3002\u514d\u8d39\u89c4\u5219\u96c6\u53ea\u80fd\u4f7f\u752830 \u5929\u524d\u7684\u5217\u8868\uff0c\u5982\u679c\u60f3\u963b\u6b62\u65b0\u51fa\u73b0\u7684\u5a01\u80c1\uff0c\u5219\u9700\u8981\u4e3a\u4e13\u4e1a\u89c4\u5219\u96c6\u4ed8\u8d39\u3002\u5982\u679c\u6258\u7ba1\u5404\u79cd\u516c\u5f00\u66b4\u9732\u7684\u5e94\u7528\u7a0b\u5e8f\u6216\u5904\u4e8e\u4e0d\u53d7\u4fe1\u4efb\u7684\u73af\u5883\u4e2d\uff0cSuricata \u975e\u5e38\u6709\u7528\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.crowdsec.net\/\" target=\"_blank\" rel=\"noopener\">CrowdSec<\/a>\u00a0\u5229\u7528\u4f17\u5305\u6076\u610f IP \u6570\u636e\u96c6\uff0c\u8fd9\u4e9b\u6570\u636e\u96c6\u53ef\u7528\u4e8e\u963b\u6b62\u4f20\u5165\/\u4f20\u51fa\u7684\u6076\u610f IP \u5730\u5740\uff08\u6bd4 Zenarmor \u548c Suricata \u66f4\u5e7f\u6cdb\u4e14\u8d44\u6e90\u6548\u7387\u66f4\u9ad8\uff09\u3002\u6b64\u5916\uff0c\u5b83\u8fd8\u4e3a OPNsense Web UI \u548c SSH \u670d\u52a1\u63d0\u4f9b\u66b4\u529b\u7834\u89e3\u548c\u5176\u4ed6\u4fdd\u62a4\u3002\u5b83\u8fd8\u53ef\u4ee5\u7528\u4f5c\u7f51\u7edc\u4e0a\u5176\u4ed6 CrowdSec \u5b89\u88c5\u7684 LAPI\uff08\u672c\u5730 API\uff09\u3002<\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/homenetworkguy.com\/how-to\/configure-opnsense-transparent-filtering-bridge\/\">\u539f\u6587\u5730\u5740<\/a><\/span><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5f88\u591a\u7528\u6237\u62e5\u6709 ISP \u63d0\u4f9b\u7684\u8def\u7531\u5668\u6216\u4ed6\u4eec\u81ea\u5df1\u7684\u7f51\u5173\/\u8def\u7531\u5668\u8bbe\u5907\uff0c\u4ed6\u4eec\u66f4\u559c\u6b22\u4f7f\u7528\u8fd9 &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=14877\">\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":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[436],"class_list":["post-14877","post","type-post","status-publish","format-standard","hentry","category-opnsense","tag-436"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/14877","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=14877"}],"version-history":[{"count":14,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/14877\/revisions"}],"predecessor-version":[{"id":14891,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/14877\/revisions\/14891"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}