{"id":665,"date":"2026-08-05T19:59:43","date_gmt":"2026-08-05T11:59:43","guid":{"rendered":"http:\/\/www.tantan.ink\/index.php\/2026\/08\/05\/%e6%94%b9-iptables-%e6%8a%8a%e8%87%aa%e5%b7%b1%e9%94%81%e5%a4%96%e9%9d%a2%e9%82%a3%e4%bb%b6%e4%ba%8b%ef%bc%8c%e6%88%91%e7%a0%94%e7%a9%b6%e4%ba%86%e4%b8%8b%e8%a7%a3%e6%b3%95\/"},"modified":"2026-08-05T20:00:08","modified_gmt":"2026-08-05T12:00:08","slug":"%e6%94%b9-iptables-%e6%8a%8a%e8%87%aa%e5%b7%b1%e9%94%81%e5%a4%96%e9%9d%a2%e9%82%a3%e4%bb%b6%e4%ba%8b%ef%bc%8c%e6%88%91%e7%a0%94%e7%a9%b6%e4%ba%86%e4%b8%8b%e8%a7%a3%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.tantan.ink\/index.php\/2026\/08\/05\/%e6%94%b9-iptables-%e6%8a%8a%e8%87%aa%e5%b7%b1%e9%94%81%e5%a4%96%e9%9d%a2%e9%82%a3%e4%bb%b6%e4%ba%8b%ef%bc%8c%e6%88%91%e7%a0%94%e7%a9%b6%e4%ba%86%e4%b8%8b%e8%a7%a3%e6%b3%95\/","title":{"rendered":"\u6539 iptables \u628a\u81ea\u5df1\u9501\u5916\u9762\u90a3\u4ef6\u4e8b\uff0c\u6211\u7814\u7a76\u4e86\u4e0b\u89e3\u6cd5"},"content":{"rendered":"<p>\u4e0a\u5468\u4e94\u4e0b\u73ed\u524d\u6211\u505a\u4e86\u4ef6\u8822\u4e8b\uff1a\u5728\u8fdc\u7aef\u7684 Linux \u670d\u52a1\u5668\u4e0a\u6539 iptables \u89c4\u5219\u60f3\u52a0\u4e00\u6761\u653e\u884c\uff0c\u7ed3\u679c NAT \u94fe\u987a\u5e8f\u5199\u53cd\u4e86\uff0cflush \u4e4b\u540e\u89c4\u5219\u6ca1\u8865\u56de\u53bb\u3002\u5f53\u65f6\u4eba\u5df2\u7ecf\u5728\u5730\u94c1\u4e0a\uff0c\u53d1\u73b0\u8fde\u4e0d\u4e0a\u7684\u65f6\u5019\u4e00\u8eab\u51b7\u6c57\u3002SSH \u8fdb\u53bb\u8865\u89c4\u5219\u4e5f\u6ca1\u7528\u2014\u2014\u6211\u81ea\u5df1\u628a\u5165\u53e3\u7ed9\u5173\u6b7b\u4e86\uff0c\u6700\u540e\u53ea\u80fd\u7b49\u7b2c\u4e8c\u5929\u7269\u7406\u63a5\u89e6\u673a\u5668\u624d\u6062\u590d\u3002<\/p>\n<p>\u8fd9\u79cd\u4e8b\u5e72\u4e00\u6b21\u5c31\u591f\u4e86\u3002\u6211\u5f00\u59cb\u8ba4\u771f\u627e\u6709\u6ca1\u6709&#8221;\u6539\u5b8c\u89c4\u5219\u5148\u8bd5\u518d\u786e\u8ba4&#8221;\u7684\u5de5\u5177\uff0c\u800c\u4e0d\u662f\u4e00\u4e0a\u6765\u5c31\u751f\u6548\u3002\u7ed3\u679c\u7ffb\u5230\u4e00\u4e2a\u53eb easywall \u7684\u9879\u76ee\uff0c<strong>\u4eca\u5929\uff088 \u6708 5 \u65e5\uff09\u521a\u53d1\u4e86 v2.4.1<\/strong>\uff0c\u534a\u5e74\u591a\u4ece v2.0.0 \u4e00\u8def\u63a8\u5230 v2.4.1\uff0c\u8fed\u4ee3\u8282\u594f\u6bd4\u5f88\u591a\u9632\u706b\u5899\u5de5\u5177\u90fd\u52e4\u5feb\u3002\u5b83\u7684\u8bbe\u8ba1\u521a\u597d\u8e29\u5728\u6211\u8fd9\u4e2a\u75db\u70b9\u4e0a\uff1a\u6bcf\u6761\u89c4\u5219\u70b9 Apply \u4e4b\u540e\uff0c<strong>\u53ea\u4f1a\u751f\u6548 120 \u79d2<\/strong>\uff0c\u4f60\u8981\u5728\u7a97\u53e3\u671f\u5185\u624b\u52a8\u70b9 Confirm \u624d\u7b97\u6b63\u5f0f\u843d\u5b9a\uff1b\u5982\u679c\u4f60\u88ab\u81ea\u5df1\u7684\u89c4\u5219\u8e22\u51fa\u95e8\u4e86\u2014\u2014\u5565\u4e5f\u4e0d\u7528\u505a\uff0c\u7b49 120 \u79d2\u5b83\u81ea\u5df1\u56de\u6eda\u56de\u53bb\u3002<\/p>\n<h2>\u5b83\u4e0d\u662f\u65b0\u9879\u76ee\uff0c\u4f46 2022 \u5e74\u90a3\u6b21\u65ad\u6863\u503c\u5f97\u8bb2\u4e00\u4e0b<\/h2>\n<p>easywall \u8fd9\u4e2a\u540d\u5b57\u7b2c\u4e00\u6b21\u51fa\u73b0\u662f 2017 \u5e74\u3002\u6700\u65e9\u662f Python \u5199\u7684\uff0cFlask \u505a Web\uff0ciptables \u901a\u8fc7 subprocess \u8c03\u7528\u3002\u8fd9\u5957\u67b6\u6784\u5728 2022 \u5e74\u56e0\u4e3a\u4e00\u4e2a CVE \u76f4\u63a5\u5f52\u6863\u4e86\u2014\u2014\u4e24\u4e2a\u6839\u56e0\uff1a\u4e00\u4e2a\u662f Web \u8fdb\u7a0b\u672c\u8eab\u6709 root \u6743\u9650\uff08\u653b\u51fb\u9762\u5927\uff09\uff0c\u53e6\u4e00\u4e2a\u662f subprocess \u62fc\u547d\u4ee4\u6267\u884c\uff08\u6ce8\u5165\u98ce\u9669\uff09\u3002<\/p>\n<p>2026 \u5e74 4 \u6708 26 \u65e5\uff0c\u4f5c\u8005\u628a\u6574\u4e2a\u9879\u76ee\u7528 Go \u91cd\u5199\uff0c\u51fa\u4e86 v2.0.0\uff0c\u5e95\u5c42\u4ece iptables \u5207\u5230 nftables\u3002\u8fd9\u4e24\u4e2a\u6839\u56e0\u90fd\u6ca1\u4e86\uff1a<\/p>\n<ul>\n<li><strong>Web \u8fdb\u7a0b\u4e0d\u518d\u6709 root<\/strong>\u2014\u2014\u62c6\u6210\u4e24\u4e2a\u8fdb\u7a0b\uff1aeasywall-core \u8dd1 root \u76f4\u63a5\u901a\u8fc7 netlink \u64cd\u4f5c nftables \u5185\u6838\u8868\uff0ceasywall-web \u7528 chi \u8def\u7531 + html\/template + HTMX \u8dd1\u666e\u901a\u7528\u6237\uff1b\u4e24\u8005\u901a\u8fc7 Unix socket\uff080660 \u6743\u9650\uff09\u8d70\u7c7b\u578b\u5316 JSON \u534f\u8bae\u901a\u4fe1\u3002Web \u8fdb\u7a0b\u88ab\u653b\u7834\u4e5f\u62ff\u4e0d\u5230\u9632\u706b\u5899\u6743\u9650\u3002<\/li>\n<li><strong>\u4e0d\u518d\u8d70 subprocess<\/strong>\u2014\u2014\u901a\u8fc7 <code>google\/nftables<\/code> \u8fd9\u4e2a\u5e93\u76f4\u63a5\u6784\u9020 Go struct \u8c03 netlink\uff0c\u6ca1\u6709 shell \u62fc\u63a5\u3002<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2160\" height=\"1350\" src=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light.png\" alt=\"easywall \u4e24\u6b65\u6fc0\u6d3b\u6d41\u7a0b\uff0c120 \u79d2\u56de\u6eda\u7a97\u53e3\" class=\"wp-image-662\" srcset=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light.png 2160w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light-300x188.png 300w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light-1024x640.png 1024w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light-768x480.png 768w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light-1536x960.png 1536w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/apply-light-2048x1280.png 2048w\" sizes=\"auto, (max-width: 2160px) 100vw, 2160px\" \/><\/p>\n<p>\u4ece v2.0.0 \u5230\u4eca\u5929\u7684 v2.4.1\uff0c\u5dee\u4e0d\u591a 3 \u4e2a\u534a\u6708\u53d1\u4e86 14 \u4e2a\u7248\u672c\uff0c\u5e73\u5747\u4e00\u5468\u591a\u4e00\u4e2a\u3002\u8fd9\u79cd\u8282\u594f\u5728\u9632\u706b\u5899\u5de5\u5177\u91cc\u76f8\u5f53\u5c11\u89c1\u2014\u2014\u5927\u591a\u6570\u540c\u7c7b\u9879\u76ee\u90fd\u662f\u534a\u5e74\u618b\u4e00\u4e2a\u5927\u7248\u672c\u3002\u8bf4\u660e\u4f5c\u8005\u628a\u8fd9\u4ef6\u4e8b\u5f53\u6b63\u4e8b\u5728\u505a\u3002<\/p>\n<h2>120 \u79d2\u56de\u6eda\u5230\u5e95\u600e\u4e48\u5b9e\u73b0\u7684<\/h2>\n<p>\u8fd9\u4e2a\u673a\u5236\u662f\u6574\u4e2a\u9879\u76ee\u6700\u806a\u660e\u7684\u5730\u65b9\u3002\u89c4\u5219\u6709\u4e09\u4e2a\u72b6\u6001\uff1a<strong>current\uff08\u5f53\u524d\u751f\u6548\uff09<\/strong>\u3001<strong>staged\uff08\u7f16\u8f91\u4e2d\u4f46\u672a\u5e94\u7528\uff09<\/strong>\u3001<strong>backup\uff08\u56de\u6eda\u7528\u7684\u5feb\u7167\uff09<\/strong>\u3002\u6240\u6709\u6539\u52a8\u5148\u8fdb staged\uff0c\u4e0d\u52a8 current\u3002<\/p>\n<p>\u70b9 Apply \u4e4b\u540e\u53d1\u751f\u7684\u4e8b\uff1a<\/p>\n<ol>\n<li>\u628a\u5f53\u524d\u89c4\u5219\u5feb\u7167\u5b58\u5230 backup<\/li>\n<li>\u628a staged \u89c4\u5219\u63a8\u7ed9 nftables \u5185\u6838\uff08\u8fd9\u662f\u65b0\u89c4\u5219\u5f00\u59cb\u751f\u6548\u7684\u7a97\u53e3\uff09<\/li>\n<li>\u542f\u52a8\u4e00\u4e2a 120 \u79d2\u7684\u5b9a\u65f6\u5668<\/li>\n<li>\u5982\u679c 120 \u79d2\u5185 Web \u7aef\u70b9 Confirm \u2192 \u628a backup \u6254\u6389\uff0c\u65b0\u89c4\u5219\u53d8\u6210 current<\/li>\n<li>\u5982\u679c 120 \u79d2\u5185 Web \u7aef\u70b9\u6ca1\u6536\u5230 Confirm\uff08\u6700\u5e38\u89c1\u7684\u60c5\u51b5\uff1a\u4f60\u5df2\u7ecf\u88ab\u65b0\u89c4\u5219\u8e22\u51fa\u53bb\u4e86\uff09\u2192 \u81ea\u52a8\u628a backup \u6062\u590d\u56de current<\/li>\n<\/ol>\n<p>\u5173\u952e\u662f\u8fd9\u4e2a\u7a97\u53e3\u671f\u5185\u65b0\u89c4\u5219\u5df2\u7ecf\u751f\u6548\u4e86\uff0c\u4f60\u80fd\u7acb\u523b\u611f\u53d7\u5230\u53d8\u5316\u3002\u5982\u679c\u5b83\u628a\u4f60\u5173\u5728\u95e8\u5916\uff0c\u6070\u597d\u4f60\u8fde\u4e0d\u4e0a Web\u2014\u2014\u8fd9\u6b63\u662f\u5b83\u7684\u8bbe\u8ba1\u610f\u56fe\uff1a<strong>\u4ec0\u4e48\u90fd\u4e0d\u505a\u5c31\u662f\u6700\u5bf9\u7684\u53cd\u5e94<\/strong>\uff0c\u7b49\u65f6\u95f4\u5230\u4e86\u5b83\u81ea\u5df1\u6551\u4f60\u3002<\/p>\n<p>\u56de\u6eda\u65f6\u95f4\u957f\u5ea6\u5728 v2.2.0 \u4e4b\u540e\u53ef\u4ee5\u4ece\u524d\u7aef\u914d\u7f6e\u6539\uff0c\u4e0d\u7528\u6539\u914d\u7f6e\u6587\u4ef6\u3002\u7a97\u53e3\u671f\u77ed\u7684\u597d\u5904\u662f\u8bef\u64cd\u4f5c\u540e\u6062\u590d\u5feb\uff1b\u957f\u4e00\u4e9b\u7684\u597d\u5904\u662f\u8fdc\u7a0b\u64cd\u4f5c\u65f6\u80fd\u4ece\u5bb9\u786e\u8ba4\u2014\u2014\u8fd9\u4e2a\u770b\u4f60\u600e\u4e48\u7528\u4e86\u3002<\/p>\n<h2>9 \u4e2a\u4fdd\u62a4\u6a21\u5757\uff0c4 \u4e2a\u9ed8\u8ba4\u5f00<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2160\" height=\"1350\" src=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light.png\" alt=\"easywall \u7cfb\u7edf\u9009\u9879\/\u4fdd\u62a4\u6a21\u5757\" class=\"wp-image-664\" srcset=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light.png 2160w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light-300x188.png 300w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light-1024x640.png 1024w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light-768x480.png 768w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light-1536x960.png 1536w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/options-light-2048x1280.png 2048w\" sizes=\"auto, (max-width: 2160px) 100vw, 2160px\" \/><\/p>\n<p>easywall \u5185\u7f6e 9 \u4e2a\u4fdd\u62a4\u6a21\u5757\uff1a<\/p>\n<ul>\n<li><strong>SSH \u66b4\u529b\u7834\u89e3\u9632\u62a4<\/strong>\u2014\u2014\u6bcf\u6e90 IP \u8fde\u63a5\u6570\u9650\u5236<\/li>\n<li><strong>ICMP flood<\/strong>\u2014\u2014ping \u6d2a\u6c34\u9650\u901f<\/li>\n<li><strong>SYN flood<\/strong>\u2014\u2014\u65b0 TCP \u8fde\u63a5\u9650\u901f<\/li>\n<li><strong>\u7aef\u53e3\u626b\u63cf<\/strong>\u2014\u2014NULL\/FIN\/XMAS\/SYN+FIN \u63a2\u9488\u76f4\u63a5 DROP<\/li>\n<li><strong>\u975e\u6cd5\u5305\u4e22\u5f03<\/strong>\u2014\u2014ct state invalid \u2192 DROP<\/li>\n<li><strong>IP \u5206\u7247\u4e22\u5f03<\/strong><\/li>\n<li><strong>Bogon \u8fc7\u6ee4<\/strong>\u2014\u2014RFC-1918 \u79c1\u7f51\u5730\u5740\u4ece\u516c\u7f51\u63a5\u53e3\u6765\u7684\u76f4\u63a5 DROP\uff08\u9632\u4f2a\u9020\uff09<\/li>\n<li><strong>\u8fde\u63a5\u6570\u9650\u5236<\/strong>\u2014\u2014\u6bcf\u6e90 IP \u540c\u65f6\u8fde\u63a5\u6570\u4e0a\u9650<\/li>\n<li><strong>\u5e7f\u64ad\/\u7ec4\u64ad\/TCP RST \u9650\u901f<\/strong><\/li>\n<\/ul>\n<p>\u524d 4 \u4e2a\u9ed8\u8ba4\u5f00\u542f\uff0c\u5269\u4e0b 5 \u4e2a\u6309\u9700\u6253\u5f00\u3002SSH \u90a3\u4e2a alpha \u72b6\u6001\u6211\u8fd8\u6ca1\u5728\u751f\u4ea7\u5f00\u8fc7\uff0c\u7406\u8bba\u4e0a\u6709\u4e2a\u95ee\u9898\uff1a\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668\u5728 NAT \u540e\u9762\uff0c\u6e90 IP \u5168\u662f\u540c\u4e00\u4e2a\u7f51\u5173\uff0c\u53cd\u800c\u628a\u81ea\u5df1\u9650\u4e86\u3002\u8fd9\u4e2a\u5f97\u770b\u573a\u666f\u3002<\/p>\n<p>\u6574\u4f53\u4e0a\u8fd9\u4e00\u5957\u5bf9\u5bb6\u7528 Linux \u670d\u52a1\u5668\u3001\u66b4\u9732\u5728\u516c\u7f51\u7684 VPS \u6765\u8bf4\u591f\u7528\u2014\u2014Bogon \u8fc7\u6ee4\u548c\u7aef\u53e3\u626b\u63cf\u9632\u62a4\u662f\u5927\u591a\u6570\u88f8\u5954\u670d\u52a1\u5668\u7f3a\u7684\u4e1c\u897f\u3002<\/p>\n<h2>Docker \u517c\u5bb9\u6027\u662f\u8ba4\u771f\u505a\u8fc7\u7684<\/h2>\n<p>\u8fd9\u662f\u6211\u6bd4\u8f83\u5728\u610f\u7684\u70b9\u3002\u6211\u670d\u52a1\u5668\u4e0a\u8dd1\u4e86\u4e00\u5806 Docker \u5bb9\u5668\uff0c\u6700\u6015\u9632\u706b\u5899\u9762\u677f\u4e00\u5200\u5207\u628a\u5bb9\u5668\u7f51\u7edc\u4e5f ban \u4e86\u3002easywall \u5904\u7406\u8fd9\u4e2a\u7684\u601d\u8def\u662f\uff1a<\/p>\n<p>\u5b83<strong>\u81ea\u5df1\u62e5\u6709 <code>inet easywall<\/code> \u8fd9\u5f20 nftables \u8868<\/strong>\uff0c\u8ddf Docker \u7684 chain \u5b8c\u5168\u4e0d\u4ea4\u53c9\u3002Docker \u7528\u7684\u662f <code>bridge\/filter\/forward<\/code> \u548c\u5b83\u81ea\u5df1\u7684\u4e00\u5957 nat\uff0ceasywall \u4e0d\u4f1a\u53bb\u78b0\u3002\u5982\u679c\u6709\u9700\u8981\u8ddf\u5bb9\u5668\u7f51\u7edc\u4ea4\u4e92\uff0cv2.1.0 \u52a0\u4e86 <code>GET\/POST \/settings<\/code> \u4e13\u95e8\u914d\u7f6e IPv6 \u548c Docker \u7f51\u7edc\u7684 CIDR\u3002<\/p>\n<p>\u6211\u8bfb v2.0.0 \u7684 commit \u5217\u8868\u8fd8\u770b\u5230\u8fc7\u4e13\u95e8\u4fee Docker CIDR \u63a9\u7801\u5904\u7406\u7684 PR\u2014\u2014\u4e4b\u524d\u67d0\u4e2a\u7248\u672c\u4f1a panic\uff0c\u8fd9\u79cd corner case \u90fd\u8865\u4e0a\u4e86\u3002<\/p>\n<h2>\u90e8\u7f72\u65b9\u5f0f\u6709\u4e09\u79cd\uff0c\u6309\u4f60\u7684\u73af\u5883\u9009<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"2160\" height=\"1350\" src=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light.png\" alt=\"easywall \u7aef\u53e3\u7ba1\u7406\u754c\u9762\" class=\"wp-image-663\" srcset=\"https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light.png 2160w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light-300x188.png 300w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light-1024x640.png 1024w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light-768x480.png 768w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light-1536x960.png 1536w, https:\/\/www.tantan.ink\/wp-content\/uploads\/2026\/08\/ports-light-2048x1280.png 2048w\" sizes=\"auto, (max-width: 2160px) 100vw, 2160px\" \/><\/p>\n<p>\u7b2c\u4e00\u79cd\u662f Debian\/Ubuntu \u7684 deb \u5305\uff0c\u6700\u7b80\u5355\uff1a<\/p>\n<pre><code>wget https:\/\/github.com\/jp1337\/easywall\/releases\/latest\/download\/easywall_amd64.deb\nsudo dpkg -i easywall_amd64.deb &amp;&amp; sudo apt-get install -f\n<\/code><\/pre>\n<p>\u88c5\u5b8c\u76f4\u63a5 <code>systemctl enable --now easywall-core easywall-web<\/code>\uff0c\u6d4f\u89c8\u5668\u5f00 <code>https:\/\/localhost:12227<\/code>\uff0c\u7b2c\u4e00\u6b21\u8fdb\u6709\u521d\u59cb\u5316\u5411\u5bfc\u3002<\/p>\n<p>\u7b2c\u4e8c\u79cd\u662f Docker Compose\uff0c\u9002\u5408\u60f3\u8dd1\u5728\u5bb9\u5668\u91cc\u6d4b\u8bd5\u7684\u4eba\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/jp1337\/easywall.git &amp;&amp; cd easywall\ndocker compose up -d\n<\/code><\/pre>\n<p>\u4f46\u8981\u6ce8\u610f\uff1a\u8dd1\u5728\u5bb9\u5668\u91cc\u610f\u5473\u7740 easywall-core \u4e5f\u5f97\u80fd\u7ba1\u5bbf\u4e3b\u673a\u7684 nftables\uff0c\u9700\u8981 privileged \u6216\u8005\u628a netlink socket \u900f\u4f20\u8fc7\u53bb\u3002\u751f\u4ea7\u6211\u5efa\u8bae\u8fd8\u662f deb \u88c5\u5230\u5bbf\u4e3b\u673a\u3002<\/p>\n<p>\u7b2c\u4e09\u79cd\u662f\u6e90\u7801\u7f16\u8bd1\uff0cGo 1.25+\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/jp1337\/easywall.git &amp;&amp; cd easywall\nmake build\nsudo make install\n<\/code><\/pre>\n<p>\u4e09\u4e2a\u4ea7\u7269\uff1a<code>easywall-core<\/code>\uff08root \u8dd1\u7684\u5b88\u62a4\u8fdb\u7a0b\uff09\u3001<code>easywall-web<\/code>\uff08\u666e\u901a\u7528\u6237\u8dd1\u7684 Web\uff09\u3001systemd unit \u6587\u4ef6\u3002<\/p>\n<h2>\u6743\u9650\u6a21\u578b\u8fd9\u5757\u662f\u5b83\u6700\u5927\u7684\u5356\u70b9<\/h2>\n<p>\u6700\u540e\u5355\u72ec\u8bb2\u4e00\u4e0b\uff0c\u56e0\u4e3a\u5b83\u8ddf\u5927\u591a\u6570\u540c\u7c7b\u5de5\u5177\u7684\u601d\u8def\u5b8c\u5168\u4e0d\u540c\u3002\u5e38\u89c1\u7684 Web \u9762\u677f\u7c7b\u9632\u706b\u5899\uff08nft-ui\u3001go-port-forward\u3001nftables-nat-rust \u8fd9\u4e9b\uff09\u90fd\u662f\u5355\u4e00\u8fdb\u7a0b\uff0c<strong>\u6574\u8fdb\u7a0b\u8dd1 root \u6216\u8005 sudo<\/strong>\u3002Web \u7aef\u4e00\u65e6\u88ab\u653b\u7834\uff0c\u653b\u51fb\u8005\u76f4\u63a5\u62ff\u5230\u9632\u706b\u5899\u63a7\u5236\u6743\u3002<\/p>\n<p>easywall \u7684\u505a\u6cd5\u662f\u628a root \u6743\u9650\u538b\u5230\u6700\u5c0f\u96c6\u5408\u2014\u2014\u53ea\u6709 easywall-core \u4e00\u4e2a\u8fdb\u7a0b\u62ff root\uff0c\u4e14\u5b83\u53ea\u901a\u8fc7 netlink \u8ddf nftables \u5185\u6838\u8868\u901a\u4fe1\uff0c<strong>\u4e0d\u76d1\u542c\u4efb\u4f55 TCP \u7aef\u53e3<\/strong>\u3002Web \u7aef easywall-web \u5b8c\u5168\u8dd1\u666e\u901a\u7528\u6237\uff0c\u76d1\u542c HTTPS\uff08\u9ed8\u8ba4 12227\uff09\u3002\u4e24\u8005\u4e4b\u95f4\u53ea\u8d70 Unix socket\uff080660 \u6743\u9650\uff0c\u53ea\u6709 easywall \u7ec4\u80fd\u8bfb\uff09\u3002<\/p>\n<p>Web \u8fdb\u7a0b\u88ab XSS\/CSRF \u653b\u7834 \u2192 \u653b\u51fb\u8005\u80fd\u6539\u914d\u7f6e\u8349\u7a3f\uff0c\u4f46\u6539\u4e0d\u4e86\u751f\u6548\u89c4\u5219\u3002Web \u8fdb\u7a0b\u88ab RCE \u2192 \u653b\u51fb\u8005\u4e5f\u53ea\u80fd\u901a\u8fc7 socket \u63d0\u6743\u5230 easywall-core\uff0c\u89e6\u53d1 daemon \u5f39\u51fa\u4e00\u4e2a&#8221;\u975e\u9884\u671f\u914d\u7f6e\u53d8\u66f4&#8221;\uff0c\u4f60\u770b\u4e00\u773c\u65e5\u5fd7\u80fd\u53d1\u73b0\u3002\u8fd9\u79cd&#8221;\u53cc\u8fdb\u7a0b\u9694\u79bb + \u7c7b\u578b\u5316 IPC&#8221;\u5728\u7f51\u5173\u7c7b\u5de5\u5177\u91cc\u5f88\u5c11\u89c1\u2014\u2014\u5927\u591a\u6570\u540c\u7c7b\u9879\u76ee\u90fd\u61d2\u5f97\u505a\u8fd9\u4e00\u6b65\u3002<\/p>\n<h2>Roadmap \u8fd8\u6ca1\u505a\u4f46\u5df2\u7ecf\u5217\u51fa\u6765\u4e86<\/h2>\n<p>\u9879\u76ee\u4e3b\u9875\u4e0a\u7684 Roadmap \u5199\u4e86\u56db\u4ef6\u4e8b\uff1a<\/p>\n<ul>\n<li>2FA \/ TOTP\u2014\u2014Web \u7aef\u7b2c\u4e8c\u56e0\u5b50\u8ba4\u8bc1<\/li>\n<li>Let&#8217;s Encrypt ACME\u2014\u2014\u4e0d\u4f9d\u8d56\u53cd\u5411\u4ee3\u7406\u5c31\u80fd\u7b7e\u8bc1\u4e66<\/li>\n<li>\u767b\u5f55\u5ba1\u8ba1\u65e5\u5fd7\u2014\u2014\u76ee\u524d\u5ba1\u8ba1\u65e5\u5fd7\u53ea\u8bb0\u89c4\u5219\u53d8\u66f4\uff0c\u4e0d\u8bb0\u8ba4\u8bc1\u4e8b\u4ef6<\/li>\n<li>REST API\u2014\u2014\u7ed9 Ansible \u548c\u81ea\u52a8\u5316\u7528<\/li>\n<\/ul>\n<p>\u6211\u4e2a\u4eba\u6700\u671f\u5f85 REST API\u3002\u5982\u679c\u6709\u4e86\uff0c<strong>\u7406\u8bba\u4e0a<\/strong>\u53ef\u4ee5\u5199 Ansible playbook \u6279\u91cf\u7ba1\u7406\u591a\u53f0\u673a\u5668\u7684\u9632\u706b\u5899\u89c4\u5219\uff0c\u914d\u4e0a Git \u505a\u7248\u672c\u63a7\u5236\uff0cCI \u91cc\u8dd1\u4e00\u6b21 diff \u770b\u770b\u6539\u52a8\u5408\u4e0d\u5408\u7406\u518d apply\u2014\u2014\u8fd9\u624d\u662f\u73b0\u4ee3\u57fa\u7840\u8bbe\u65bd\u8be5\u6709\u7684\u6837\u5b50\u3002<\/p>\n<p>2FA \u90a3\u4e2a\u5176\u5b9e\u5e94\u8be5\u6392\u5728\u66f4\u524d\u9762\uff0c\u6bd5\u7adf\u5b83\u73b0\u5728\u6240\u6709\u8ba4\u8bc1\u90fd\u9760\u5355\u4e00\u5bc6\u7801\u3002<\/p>\n<h2>\u9002\u914d\u573a\u666f\u548c\u5c40\u9650<\/h2>\n<p>\u9002\u5408\u7528 easywall \u7684\u60c5\u51b5\uff1a<\/p>\n<ul>\n<li>\u6709 1-2 \u53f0 Linux \u670d\u52a1\u5668\u8dd1\u5728\u516c\u7f51\u6216\u8005 DMZ\uff0c\u81ea\u5df1\u7ba1\u9632\u706b\u5899\u89c4\u5219<\/li>\n<li>\u613f\u610f\u82b1 10 \u5206\u949f\u88c5\u4e00\u4e0b\u3001\u7528 Web \u800c\u4e0d\u662f\u76f4\u63a5 ssh \u4e0a\u53bb\u6539\u811a\u672c\u7684\u4eba<\/li>\n<li>\u51fa\u8fc7&#8221;\u88ab\u81ea\u5df1\u9501\u5916\u9762&#8221;\u4e8b\u6545\u3001\u4e0d\u60f3\u518d\u51fa\u7684\u4eba<\/li>\n<\/ul>\n<p>\u4e0d\u592a\u9002\u5408\uff1a<\/p>\n<ul>\n<li>\u8f6f\u8def\u7531\u4e3b\u63a7\u2014\u2014\u5b83\u4e0d\u50cf OpenWrt firewall \u6216\u8005 iptables \u811a\u672c\u90a3\u6837\u662f&#8221;\u65e0\u72b6\u6001\u3001\u53ef\u7eb3\u7ba1\u8fdb\u914d\u7f6e\u7ba1\u7406&#8221;\u7684\u5f62\u6001\uff0c\u66f4\u50cf\u662f\u4e00\u4e2a\u4ea4\u4e92\u5de5\u5177\uff1b\u5982\u679c\u4f60\u7684\u8f6f\u8def\u7531\u662f OpenWrt\uff0cLuci \u5df2\u7ecf\u591f\u7528<\/li>\n<li>\u96c6\u7fa4\u89c4\u6a21\u2014\u2014\u5355\u673a\u5de5\u5177\uff0c\u6ca1\u6709\u539f\u751f\u7684\u591a\u673a\u534f\u540c\uff1b\u867d\u7136 Roadmap \u6709 REST API\uff0c\u4f46\u8fd8\u6ca1\u5f71<\/li>\n<li>\u6781\u7aef\u6027\u80fd\u573a\u666f\u2014\u2014\u5b83\u6bcf\u6b21 Apply \u90fd\u8fc7\u5b8c\u6574 IPC \u534f\u8bae + \u91cd\u65b0\u751f\u6210 nftables \u89c4\u5219\u96c6\uff0c\u89c4\u5219\u4e0a\u4e07\u6761\u91cf\u7ea7\u4f1a\u6162<\/li>\n<\/ul>\n<p>\u8fd8\u6709\u4e2a\u503c\u5f97\u63d0\u7684\uff1a<strong>\u9879\u76ee star \u6570\u8fd8\u5f88\u5c11\uff0c\u91cd\u5199\u540e\u521a\u5f00\u59cb\u91cd\u65b0\u79ef\u7d2f\u5173\u6ce8\u5ea6<\/strong>\u3002GPL-3.0 \u534f\u8bae\uff0c\u957f\u671f\u770b\u4e0d\u592a\u62c5\u5fc3\u4f5c\u8005\u8dd1\u8def\uff0c\u4f46\u5355\u70b9\u6545\u969c\uff08\u4e00\u4e2a\u4eba\u7ef4\u62a4\uff09\u8981\u5fc3\u91cc\u6709\u6570\u3002\u5982\u679c\u4f60\u8981\u5728\u751f\u4ea7\u4e0a\u7528\uff0c\u5efa\u8bae fork \u4e00\u4efd\u5230\u81ea\u5df1\u7684 namespace\uff0c\u7559\u4e2a\u540e\u624b\u3002<\/p>\n<p>v2.4.1 \u8fd9\u6b21\u7684\u66f4\u65b0\u4e3b\u8981\u662f CodeQL redirect guard \u52a0\u56fa + \u6697\u8272\u6a21\u5f0f\u6587\u6863\u7ad9\u4fee\u590d + \u51e0\u5904\u6587\u6863\u9519\u8bef\u66f4\u6b63\uff0c\u6ca1\u6709\u5f15\u5165\u7834\u574f\u6027\u53d8\u66f4\u3002\u6211\u81ea\u5df1\u7684\u7b56\u7565\u662f\u5148\u5728\u6d4b\u8bd5\u73af\u5883\u8dd1\u4e00\u4e24\u5468\uff0c\u770b 9 \u4e2a\u4fdd\u62a4\u6a21\u5757\u7684\u9ed8\u8ba4\u914d\u7f6e\u6709\u6ca1\u6709\u628a\u65e5\u5e38 SSH \u6d41\u91cf\u8bef\u6740\u2014\u2014\u518d\u51b3\u5b9a\u8981\u4e0d\u8981\u4e0a\u751f\u4ea7\u3002<\/p>\n<p>\u5982\u679c\u4e00\u5207\u987a\u5229\uff0c<strong>\u7406\u8bba\u4e0a<\/strong>\u4ee5\u540e\u6539\u9632\u706b\u5899\u89c4\u5219\u8fd9\u4ef6\u4e8b\u53ef\u4ee5\u544a\u522b&#8221;\u6df1\u547c\u5438-\u56de\u8f66-\u7948\u7977\u4e09\u8fde&#8221;\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>easywall v2.0.0 \u662f Go+nftables \u5b8c\u5168\u91cd\u5199\uff0c120 \u79d2\u81ea\u52a8\u56de\u6eda\u673a\u5236 + \u53cc\u8fdb\u7a0b\u9694\u79bb\uff0c9 \u4e2a\u4fdd\u62a4\u6a21\u5757\u30014 \u4e2a\u9ed8\u8ba4\u5f00\u3002<\/p>\n","protected":false},"author":2,"featured_media":661,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[176,163],"tags":[240,243,162,241,242],"class_list":["post-665","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hands-on","category-network","tag-easywall","tag-iptables","tag-linux","tag-nftables","tag-242"],"_links":{"self":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=665"}],"version-history":[{"count":1,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/665\/revisions"}],"predecessor-version":[{"id":666,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/posts\/665\/revisions\/666"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media\/661"}],"wp:attachment":[{"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tantan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}