{"id":201,"date":"2025-02-06T20:38:18","date_gmt":"2025-02-06T12:38:18","guid":{"rendered":"https:\/\/0x0.pub\/?p=201"},"modified":"2025-08-05T19:45:25","modified_gmt":"2025-08-05T11:45:25","slug":"headscale-%e9%85%8d%e7%bd%ae%e5%87%ba%e5%8f%a3%e8%8a%82%e7%82%b9%e5%92%8cacl%e8%a7%84%e5%88%99","status":"publish","type":"post","link":"https:\/\/0x0.pub\/?p=201","title":{"rendered":"Headscale \u914d\u7f6e\u51fa\u53e3\u8def\u7531\u548cACL\u89c4\u5219"},"content":{"rendered":"\n<p class=\"has-small-font-size\"><\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">\u52a0\u5165\u8282\u70b9\u7684\u8bbe\u5907\u901a\u544a\u81ea\u5df1\u4e3a\u51fa\u53e3\u8def\u7531\u547d\u4ee4<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>tailscale set --advertise-exit-node<\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\"><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\" style=\"font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.294), 1rem);\">\u534f\u8c03\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6b64\u51fa\u53e3\u8def\u7531\u547d\u4ee4<\/pre>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>headscale routes list  #\u5217\u51fa\u8def\u7531\nheadscale routes enable \\-r 1  #\u542f\u7528\u5217\u8868ID 1\u7684\u8def\u7531<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">ACL \u9ed8\u8ba4\u662f\u62d2\u7edd\u7684\u3001\u5b9a\u5411\u7684\u3001\u672c\u5730\u5f3a\u5236\u7684\uff0c\u4e0d\u5f71\u54cd\u672c\u5730\u7f51\u7edc\u6d41\u91cf\uff0c\u63a7\u5236\u5668\u4e0b\u53d1ACL\u89c4\u5219\u7ed9\u6240\u6709\u8282\u70b9\u8bbe\u5907\u3002<br>\u4fee\u6539config.yaml\u6307\u5b9aACL Policy\u6587\u4ef6\uff0c\u653e\u5728config.yaml\u540c\u76ee\u5f55\u4e0b\u7684acl.sqlite<\/pre>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>policy:\n  mode: database\n  path: \".\/acl.sqlite\"<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">\u4ee5\u4e0bACL\u89c4\u5219\u662f\u5168\u90e8\u5141\u8bb8\uff0c\u6839\u636eACL\u89c4\u5219\u793a\u4f8b\u4fee\u6539\u5b9e\u9645\u914d\u7f6e\u3002<\/pre>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>{\n  \"acls\": &#091;\n    {\n      \"action\": \"accept\",\n      \"src\": &#091;\n        \"*\"\n      ],\n      \"dst\": &#091;\n        \"*:*\"\n      ]\n    }\n  ],\n}<\/code><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u53c2\u8003\u94fe\u63a5\uff1a<a href=\"https:\/\/headscale.net\/0.23.0\/ref\/acls\/#acl-setup\"> ACL\u89c4\u5219\u793a\u4f8b<\/a> <a href=\"https:\/\/rplib.cn\/VPS\/pei-zhi-headscalede-chu-kou-jie-dian-1.html\">\u914d\u7f6eHeadscale\u51fa\u53e3\u8282\u70b9<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u52a0\u5165\u8282\u70b9\u7684\u8bbe\u5907\u901a\u544a\u81ea\u5df1\u4e3a\u51fa\u53e3\u8def\u7531\u547d\u4ee4 \u534f\u8c03\u670d\u52a1\u5668\u4e0a\u542f\u7528\u6b64\u51fa\u53e3\u8def\u7531\u547d\u4ee4 ACL \u9ed8\u8ba4\u662f\u62d2\u7edd\u7684\u3001\u5b9a\u5411\u7684\u3001\u672c\u5730\u5f3a\u5236\u7684 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[41,45],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-note","tag-headscale-acl","tag-headscale"],"_links":{"self":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=201"}],"version-history":[{"count":9,"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":324,"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts\/201\/revisions\/324"}],"wp:attachment":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}