{"id":1356,"date":"2025-08-10T14:31:07","date_gmt":"2025-08-10T06:31:07","guid":{"rendered":"https:\/\/hali.life\/?p=1356"},"modified":"2025-12-28T03:49:35","modified_gmt":"2025-12-27T19:49:35","slug":"%e8%bd%af%e8%b7%af%e7%94%b1%e4%b8%ad%e8%87%aa%e5%bb%ba%e9%98%b2%e7%81%ab%e5%a2%99%ef%bc%88%e9%98%b2%e6%ad%a2%e5%91%98%e5%b7%a5%e5%81%b7%e7%9c%8b%e5%b0%8f%e7%94%b5%e5%bd%b1%e7%ad%89%e8%bf%9d%e8%a7%84","status":"publish","type":"post","link":"https:\/\/hali.life\/?p=1356","title":{"rendered":"\u8f6f\u8def\u7531\u4e2d\u81ea\u5efa\u9632\u706b\u5899\uff08\u9632\u6b62\u5458\u5de5\u5077\u770b\u5c0f\u7535\u5f71\u7b49\u8fdd\u89c4\u884c\u4e3a\uff09"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u7b80\u4ecb<\/h1>\n\n\n\n<p>\u6bcf\u4e00\u4e2a\u8de8\u5883\u7535\u5546\u8001\u677f\uff0c\u90fd\u4f1a\u9762\u4e34\u4e00\u4e2a\u95ee\u9898\u3002\u9996\u5148\u6211\u4eec\u80af\u5b9a\u662f\u8981\u5230\u5899\u5916\u548c\u8001\u5916\u505a\u751f\u610f\uff0c\u5176\u6b21\u6211\u4eec\u5982\u4f55\u4fdd\u8bc1\u81ea\u5df1\u7684\u5458\u5de5\u6765\u5230\u6d77\u5916\u73af\u5883\u540e\uff0c<strong>\u53ea\u548c\u8001\u5916\u505a\u751f\u610f\uff0c\u800c\u4e0d\u53bb\u89e6\u78b0\u8fdd\u6cd5\u7ea2\u7ebf\u5462<\/strong>\uff1f\uff08\u5982\u53d1\u8868\u4e0d\u5f53\u8a00\u8bba\uff0c\u6216\u770bP\u7ad9\uff09<\/p>\n\n\n\n<p>\u4eca\u5929\u6211\u4eec\u5c31\u4f7f\u7528\u4e00\u6b3e\u5de5\u5177\uff1aOpenGFW \u3002\u6765\u5728\u8f6f\u8def\u7531\u4e2d\u81ea\u5df1\u5efa\u8bbe\u4e00\u9053\u5ba1\u67e5\u5899\uff0c\u6211\u4eec\u81ea\u5df1\u6765\u63a7\u5236\uff0c\u54ea\u4e9b\u7f51\u7ad9\u4e0d\u80fd\u770b\uff0c\u54ea\u4e9b\u7f51\u7ad9\u53ef\u4ee5\u770b\u3002\u54ea\u4e9b\u8bbe\u5907\u4e0d\u80fd\u8bbf\u95ee\uff0c\u54ea\u4e9b\u8bbe\u5907\u53ef\u4ee5\u8bbf\u95ee\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u672c\u6587\u6240\u9700\u5de5\u5177\u4e0b\u8f7d<\/h1>\n\n\n\n<p>\u4e0b\u8f7d\u94fe\u63a5\uff1a<a href=\"https:\/\/pan.quark.cn\/s\/18ee63ea02b1\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">https:\/\/pan.quark.cn\/s\/18ee63ea02b1<\/mark><\/strong><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>rules.yaml\uff1a<\/strong>\u89c4\u5219\u6587\u4ef6<\/li>\n\n\n\n<li><strong>config.yaml<\/strong>\uff1a\u914d\u7f6e\u6587\u4ef6<\/li>\n\n\n\n<li><strong>OpenGFW-linux-arm64\uff1a<\/strong>arm64\u7248  <\/li>\n\n\n\n<li><strong>OpenGFW-linux-386\uff1a<\/strong>x86\u7248<\/li>\n\n\n\n<li><strong>OpenGFW-linux-amd64\uff1a<\/strong>amd64\u7248<\/li>\n\n\n\n<li>finalshell_install.exe\uff1a\u8fde\u63a5\u5de5\u5177<\/li>\n<\/ul>\n\n\n\n<p>\u4f7f\u7528\u547d\u4ee4\u67e5\u770b\u81ea\u5df1\u7684\u8def\u7531\u5668\u7cfb\u7edf\u9002\u7528\u4e8e\u54ea\u4e2aOpenGFW\u7248\u672c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u770b\u7cfb\u7edf\u5904\u7406\u5668\u67b6\u6784\nuname -m<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u89c6\u9891\u6559\u7a0b<\/h1>\n\n\n\n<iframe src=\"\/\/player.bilibili.com\/player.html?bvid=BV1NPbMz9Efi&#038;page=1\" scrolling=\"no\" border=\"0\" frameborder=\"no\" framespacing=\"0\" allowfullscreen=\"true\" style=\"width:100%; height:500px; max-width: 100%\uff1balign:center; margin-left: 60px; \"> <\/iframe>\n\n\n\n<h1 class=\"wp-block-heading\">\u6559\u7a0b<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">1\u3001\u5c06OpenGFW\u8fd0\u884c\u6587\u4ef6\u4e0a\u4f20\u81f3\u8f6f\u8def\u7531<\/h3>\n\n\n\n<p>\u6211\u4f7f\u7528\u7684\u662fIIS Web \u670d\u52a1\u5668\u65b9\u6cd5\uff08\u8be6\u7ec6\u64cd\u4f5c\u89c1\u89c6\u9891\uff09\uff0c\u5c06 OpenGFW \u548c config.yaml rules.yaml \u4e0a\u4f20\u81f3\u8def\u7531\u5668<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5728IIS Web\u670d\u52a1\u5668\u7684MIME\u7c7b\u578b\u4e2d\u6dfb\u52a0\n\u6587\u4ef6\u6269\u5c55\u540d\uff1a.\nMIME\u7c7b\u578b\uff1aapplication\/octet-stream\n\n\u6587\u4ef6\u6269\u5c55\u540d\uff1a.yaml\nMIME\u7c7b\u578b\uff1aapplication\/x-yaml\n\n# \u4e0b\u8f7d\u5230\u8def\u7531\u5668\nwget http:\/\/192.168.2.247\/OpenGFW-linux-arm64\nwget http:\/\/192.168.2.247\/config.yaml\nwget http:\/\/192.168.2.247\/rules.yaml<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2\u3001\u8fd0\u884c<\/h3>\n\n\n\n<p>\u767b\u9646\u8def\u7531\u5668\u7684ssh\u7aef\u53e3\uff0c\u4f7f\u7528\u547d\u4ee4\u5c06\u8def\u7531\u5668\u7684opkg\u5305\u8fdb\u884c\u66f4\u65b0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5c06 opkg \u66f4\u65b0\u5230\u6700\u65b0\nopkg update\n\n# \u5b89\u88c5 OpenGFW \u6240\u9700\u4f9d\u8d56\nopkg install nftables kmod-nft-queue kmod-nf-conntrack-netlink\n\n# \u8fd0\u884c OpenGFW\nchmod +x OpenGFW-linux-arm64\n.\/OpenGFW-linux-arm64 -c config.yaml rules.yaml\n\n# \u540e\u53f0\u8fd0\u884c OpenGFW\n nohup .\/OpenGFW-linux-arm64 -c config.yaml rules.yaml &gt; \/tmp\/opengfw.log 2&gt;&amp;1 &amp;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3\u3001\u89c4\u5219\u914d\u7f6e<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u8bb0\u5f55 SNI \u4e2d\u5305\u542b\u7279\u5b9a\u5173\u952e\u5b57\u7684\u8fde\u63a5\n- name: log horny people\n  log: true\n  expr: let sni = string(tls?.req?.sni); sni contains \"porn\" || sni contains \"hentai\"\n\n#\u963b\u65ad\u8bbf\u95ee v2ex.com \u7684 HTTP\/HTTPS\/QUIC \u8fde\u63a5\n- name: block v2ex http\n  action: block\n  expr: string(http?.req?.headers?.host) endsWith \"v2ex.com\"\n\n- name: block v2ex https\n  action: block\n  expr: string(tls?.req?.sni) endsWith \"v2ex.com\"\n\n- name: block v2ex quic\n  action: block\n  expr: string(quic?.req?.sni) endsWith \"v2ex.com\"\n\n#\u963b\u65ad\u5e76\u8bb0\u5f55 Shadowsocks, VMess, Trojan \u8fde\u63a5\n- name: block shadowsocks and vmess\n  action: block\n  log: true\n  expr: fet != nil &amp;&amp; fet.yes\n\n- name: block trojan\n  action: block\n  log: true\n  expr: trojan != nil &amp;&amp; trojan.yes\n\n#\u5c06 v2ex.com \u57df\u540d DNS \u6c61\u67d3\u5230 0.0.0.0 \u548c ::\n- name: v2ex dns poisoning\n  action: modify\n  modifier:\n    name: dns\n    args:\n      a: \"0.0.0.0\"\n      aaaa: \"::\"\n  expr: dns != nil &amp;&amp; dns.qr &amp;&amp; any(dns.questions, {.name endsWith \"v2ex.com\"})\n\n#\u963b\u65ad SOCKS \u4ee3\u7406\u8bbf\u95ee google.com:80\n- name: block google socks\n  action: block\n  expr: string(socks?.req?.addr) endsWith \"google.com\" &amp;&amp; socks?.req?.port == 80\n\n#\u6839\u636e\u63e1\u624b\u54cd\u5e94\u963b\u65ad WireGuard\n- name: block wireguard by handshake response\n  action: drop\n  expr: wireguard?.handshake_response?.receiver_index_matched == true\n\n#\u6839\u636e GeoSite \u6570\u636e\u5e93\u963b\u65ad Bilibili \u7684\u6240\u6709\u57df\u540d\n- name: block bilibili geosite\n  action: block\n  expr: geosite(string(tls?.req?.sni), \"bilibili\")\n\n#\u6839\u636e GeoIP \u6570\u636e\u5e93\u963b\u65ad\u6240\u6709\u76ee\u6807 IP \u4e3a\u4e2d\u56fd\u7684\u8fde\u63a5\n- name: block CN geoip\n  action: block\n  expr: geoip(string(ip.dst), \"cn\")\n\n#\u6839\u636e CIDR \u963b\u65ad\u7279\u5b9a IP \u6bb5\u7684\u8fde\u63a5\n- name: block cidr\n  action: block\n  expr: cidr(string(ip.dst), \"192.168.0.0\/16\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb \u6bcf\u4e00\u4e2a\u8de8\u5883\u7535\u5546\u8001\u677f\uff0c\u90fd\u4f1a\u9762\u4e34\u4e00\u4e2a\u95ee\u9898\u3002\u9996\u5148\u6211\u4eec\u80af\u5b9a\u662f\u8981\u5230\u5899\u5916\u548c\u8001\u5916\u505a\u751f\u610f\uff0c\u5176\u6b21\u6211\u4eec\u5982\u4f55\u4fdd\u8bc1\u81ea\u5df1\u7684\u5458\u5de5\u6765\u5230&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1370,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"views":4032,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/posts\/1356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hali.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1356"}],"version-history":[{"count":11,"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/posts\/1356\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/posts\/1356\/revisions\/1469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hali.life\/index.php?rest_route=\/wp\/v2\/media\/1370"}],"wp:attachment":[{"href":"https:\/\/hali.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hali.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hali.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}