{"id":25124,"date":"2025-04-19T11:42:34","date_gmt":"2025-04-19T03:42:34","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/25124.html"},"modified":"2025-04-19T11:42:34","modified_gmt":"2025-04-19T03:42:34","slug":"%e8%87%aa%e5%ae%9a%e4%b9%89%e6%9c%8d%e5%8a%a1%e5%99%a8-headscale-headscale-ui-%e9%83%a8%e7%bd%b2-docker","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/25124.html","title":{"rendered":"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker"},"content":{"rendered":"<p>1\u3001\u65b0\u5efa\u6302\u8f7d\u76ee\u5f55&#xff0c;\u521b\u5efa\u6570\u636e\u5e93\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/xxx\/headscale\/config<\/p>\n<p><span class=\"token function\">touch<\/span> \/xxx\/headscale\/config\/db.sqlite<\/p>\n<p>2\u3001\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>\/xxx\/headscale\/config\/config.yaml \u7aef\u53e3\u6211\u6539\u4e86&#xff0c;\u6839\u636e\u81ea\u5df1\u60c5\u51b5\u6765<\/p>\n<p>&#8212;<br \/>\n<span class=\"token comment\"># headscale will look for a configuration file named &#096;config.yaml&#096; (or &#096;config.json&#096;) in the following order:<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># &#8211; &#096;\/etc\/headscale&#096;<\/span><br \/>\n<span class=\"token comment\"># &#8211; &#096;~\/.headscale&#096;<\/span><br \/>\n<span class=\"token comment\"># &#8211; current working directory<\/span><\/p>\n<p><span class=\"token comment\"># The url clients will connect to.<\/span><br \/>\n<span class=\"token comment\"># Typically this will be a domain like:<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># https:\/\/myheadscale.example.com:443<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\nserver_url: http:\/\/<span class=\"token operator\">&lt;<\/span>public_ip<span class=\"token operator\">&gt;<\/span>:8081<\/p>\n<p><span class=\"token comment\"># Address to listen to \/ bind to on the server<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># For production:<\/span><br \/>\n<span class=\"token comment\"># listen_addr: 0.0.0.0:8080<\/span><br \/>\nlisten_addr: <span class=\"token number\">0.0<\/span>.0.0:8081<\/p>\n<p><span class=\"token comment\"># Address to listen to \/metrics, you may want<\/span><br \/>\n<span class=\"token comment\"># to keep this endpoint private to your internal<\/span><br \/>\n<span class=\"token comment\"># network<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\nmetrics_listen_addr: <span class=\"token number\">0.0<\/span>.0.0:6030<\/p>\n<p><span class=\"token comment\"># Address to listen for gRPC.<\/span><br \/>\n<span class=\"token comment\"># gRPC is used for controlling a headscale server<\/span><br \/>\n<span class=\"token comment\"># remotely with the CLI<\/span><br \/>\n<span class=\"token comment\"># Note: Remote access _only_ works if you have<\/span><br \/>\n<span class=\"token comment\"># valid certificates.<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># For production:<\/span><br \/>\n<span class=\"token comment\"># grpc_listen_addr: 0.0.0.0:50443<\/span><br \/>\ngrpc_listen_addr: <span class=\"token number\">127.0<\/span>.0.1:50443<\/p>\n<p><span class=\"token comment\"># Allow the gRPC admin interface to run in INSECURE<\/span><br \/>\n<span class=\"token comment\"># mode. This is not recommended as the traffic will<\/span><br \/>\n<span class=\"token comment\"># be unencrypted. Only enable if you know what you<\/span><br \/>\n<span class=\"token comment\"># are doing.<\/span><br \/>\ngrpc_allow_insecure: <span class=\"token boolean\">false<\/span><\/p>\n<p><span class=\"token comment\"># Private key used to encrypt the traffic between headscale<\/span><br \/>\n<span class=\"token comment\"># and Tailscale clients.<\/span><br \/>\n<span class=\"token comment\"># The private key file will be autogenerated if it&#039;s missing.<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\nprivate_key_path: \/etc\/headscale\/private.key<\/p>\n<p><span class=\"token comment\"># The Noise section includes specific configuration for the<\/span><br \/>\n<span class=\"token comment\"># TS2021 Noise protocol<\/span><br \/>\nnoise:<br \/>\n  <span class=\"token comment\"># The Noise private key is used to encrypt the<\/span><br \/>\n  <span class=\"token comment\"># traffic between headscale and Tailscale clients when<\/span><br \/>\n  <span class=\"token comment\"># using the new Noise-based protocol. It must be different<\/span><br \/>\n  <span class=\"token comment\"># from the legacy private key.<\/span><br \/>\n  private_key_path: \/etc\/headscale\/noise_private.key<\/p>\n<p><span class=\"token comment\"># List of IP prefixes to allocate tailaddresses from.<\/span><br \/>\n<span class=\"token comment\"># Each prefix consists of either an IPv4 or IPv6 address,<\/span><br \/>\n<span class=\"token comment\"># and the associated prefix length, delimited by a slash.<\/span><br \/>\n<span class=\"token comment\"># While this looks like it can take arbitrary values, it<\/span><br \/>\n<span class=\"token comment\"># needs to be within IP ranges supported by the Tailscale<\/span><br \/>\n<span class=\"token comment\"># client.<\/span><br \/>\n<span class=\"token comment\"># IPv6: https:\/\/github.com\/tailscale\/tailscale\/blob\/22ebb25e833264f58d7c3f534a8b166894a89536\/net\/tsaddr\/tsaddr.go#LL81C52-L81C71<\/span><br \/>\n<span class=\"token comment\"># IPv4: https:\/\/github.com\/tailscale\/tailscale\/blob\/22ebb25e833264f58d7c3f534a8b166894a89536\/net\/tsaddr\/tsaddr.go#L33<\/span><br \/>\nip_prefixes:<br \/>\n  &#8211; fd7a:115c:a1e0::\/48<br \/>\n  &#8211; <span class=\"token number\">100.64<\/span>.0.0\/10<\/p>\n<p><span class=\"token comment\"># DERP is a relay system that Tailscale uses when a direct<\/span><br \/>\n<span class=\"token comment\"># connection cannot be established.<\/span><br \/>\n<span class=\"token comment\"># https:\/\/tailscale.com\/blog\/how-tailscale-works\/#encrypted-tcp-relays-derp<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># headscale needs a list of DERP servers that can be presented<\/span><br \/>\n<span class=\"token comment\"># to the clients.<\/span><br \/>\nderp:<br \/>\n  server:<br \/>\n    <span class=\"token comment\"># If enabled, runs the embedded DERP server and merges it into the rest of the DERP config<\/span><br \/>\n    <span class=\"token comment\"># The Headscale server_url defined above MUST be using https, DERP requires TLS to be in place<\/span><br \/>\n    enabled: <span class=\"token boolean\">false<\/span><\/p>\n<p>    <span class=\"token comment\"># Region ID to use for the embedded DERP server.<\/span><br \/>\n    <span class=\"token comment\"># The local DERP prevails if the region ID collides with other region ID coming from<\/span><br \/>\n    <span class=\"token comment\"># the regular DERP config.<\/span><br \/>\n    region_id: <span class=\"token number\">999<\/span><\/p>\n<p>    <span class=\"token comment\"># Region code and name are displayed in the Tailscale UI to identify a DERP region<\/span><br \/>\n    region_code: <span class=\"token string\">&#034;headscale&#034;<\/span><br \/>\n    region_name: <span class=\"token string\">&#034;Headscale Embedded DERP&#034;<\/span><\/p>\n<p>    <span class=\"token comment\"># Listens over UDP at the configured address for STUN connections &#8211; to help with NAT traversal.<\/span><br \/>\n    <span class=\"token comment\"># When the embedded DERP server is enabled stun_listen_addr MUST be defined.<\/span><br \/>\n    <span class=\"token comment\">#<\/span><br \/>\n    <span class=\"token comment\"># For more details on how this works, check this great article: https:\/\/tailscale.com\/blog\/how-tailscale-works\/<\/span><br \/>\n    stun_listen_addr: <span class=\"token string\">&#034;0.0.0.0:3478&#034;<\/span><\/p>\n<p>  <span class=\"token comment\"># List of externally available DERP maps encoded in JSON<\/span><br \/>\n  urls:<br \/>\n    &#8211; https:\/\/controlplane.tailscale.com\/derpmap\/default<\/p>\n<p>  <span class=\"token comment\"># Locally available DERP map files encoded in YAML<\/span><br \/>\n  <span class=\"token comment\">#<\/span><br \/>\n  <span class=\"token comment\"># This option is mostly interesting for people hosting<\/span><br \/>\n  <span class=\"token comment\"># their own DERP servers:<\/span><br \/>\n  <span class=\"token comment\"># https:\/\/tailscale.com\/kb\/1118\/custom-derp-servers\/<\/span><br \/>\n  <span class=\"token comment\">#<\/span><br \/>\n  <span class=\"token comment\"># paths:<\/span><br \/>\n  <span class=\"token comment\">#   &#8211; \/etc\/headscale\/derp-example.yaml<\/span><br \/>\n  paths: <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>  <span class=\"token comment\"># If enabled, a worker will be set up to periodically<\/span><br \/>\n  <span class=\"token comment\"># refresh the given sources and update the derpmap<\/span><br \/>\n  <span class=\"token comment\"># will be set up.<\/span><br \/>\n  auto_update_enabled: <span class=\"token boolean\">true<\/span><\/p>\n<p>  <span class=\"token comment\"># How often should we check for DERP updates?<\/span><br \/>\n  update_frequency: 24h<\/p>\n<p><span class=\"token comment\"># Disables the automatic check for headscale updates on startup<\/span><br \/>\ndisable_check_updates: <span class=\"token boolean\">true<\/span><\/p>\n<p><span class=\"token comment\"># Time before an inactive ephemeral node is deleted?<\/span><br \/>\nephemeral_node_inactivity_timeout: 30m<\/p>\n<p><span class=\"token comment\"># Period to check for node updates within the tailnet. A value too low will severely affect<\/span><br \/>\n<span class=\"token comment\"># CPU consumption of Headscale. A value too high (over 60s) will cause problems<\/span><br \/>\n<span class=\"token comment\"># for the nodes, as they won&#039;t get updates or keep alive messages frequently enough.<\/span><br \/>\n<span class=\"token comment\"># In case of doubts, do not touch the default 10s.<\/span><br \/>\nnode_update_check_interval: 10s<\/p>\n<p><span class=\"token comment\"># SQLite config<\/span><br \/>\ndb_type: sqlite3<\/p>\n<p><span class=\"token comment\"># For production:<\/span><br \/>\ndb_path: \/etc\/headscale\/db.sqlite<\/p>\n<p><span class=\"token comment\"># # Postgres config<\/span><br \/>\n<span class=\"token comment\"># If using a Unix socket to connect to Postgres, set the socket path in the &#039;host&#039; field and leave &#039;port&#039; blank.<\/span><br \/>\n<span class=\"token comment\"># db_type: postgres<\/span><br \/>\n<span class=\"token comment\"># db_host: localhost<\/span><br \/>\n<span class=\"token comment\"># db_port: 5432<\/span><br \/>\n<span class=\"token comment\"># db_name: headscale<\/span><br \/>\n<span class=\"token comment\"># db_user: foo<\/span><br \/>\n<span class=\"token comment\"># db_pass: bar<\/span><\/p>\n<p><span class=\"token comment\"># If other &#039;sslmode&#039; is required instead of &#039;require(true)&#039; and &#039;disabled(false)&#039;, set the &#039;sslmode&#039; you need<\/span><br \/>\n<span class=\"token comment\"># in the &#039;db_ssl&#039; field. Refers to https:\/\/www.postgresql.org\/docs\/current\/libpq-ssl.html Table 34.1.<\/span><br \/>\n<span class=\"token comment\"># db_ssl: false<\/span><\/p>\n<p><span class=\"token comment\">### TLS configuration<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">## Let&#039;s encrypt \/ ACME<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># headscale supports automatically requesting and setting up<\/span><br \/>\n<span class=\"token comment\"># TLS for a domain with Let&#039;s Encrypt.<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># URL to ACME directory<\/span><br \/>\nacme_url: https:\/\/acme-v02.api.letsencrypt.org\/directory<\/p>\n<p><span class=\"token comment\"># Email to register with ACME provider<\/span><br \/>\nacme_email: <span class=\"token string\">&#034;&#034;<\/span><\/p>\n<p><span class=\"token comment\"># Domain name to request a TLS certificate for:<\/span><br \/>\ntls_letsencrypt_hostname: <span class=\"token string\">&#034;&#034;<\/span><\/p>\n<p><span class=\"token comment\"># Path to store certificates and metadata needed by<\/span><br \/>\n<span class=\"token comment\"># letsencrypt<\/span><br \/>\n<span class=\"token comment\"># For production:<\/span><br \/>\ntls_letsencrypt_cache_dir: \/var\/lib\/headscale\/cache<\/p>\n<p><span class=\"token comment\"># Type of ACME challenge to use, currently supported types:<\/span><br \/>\n<span class=\"token comment\"># HTTP-01 or TLS-ALPN-01<\/span><br \/>\n<span class=\"token comment\"># See [docs\/tls.md](docs\/tls.md) for more information<\/span><br \/>\ntls_letsencrypt_challenge_type: HTTP-01<br \/>\n<span class=\"token comment\"># When HTTP-01 challenge is chosen, letsencrypt must set up a<\/span><br \/>\n<span class=\"token comment\"># verification endpoint, and it will be listening on:<\/span><br \/>\n<span class=\"token comment\"># :http &#061; port 80<\/span><br \/>\ntls_letsencrypt_listen: <span class=\"token string\">&#034;:http&#034;<\/span><\/p>\n<p><span class=\"token comment\">## Use already defined certificates:<\/span><br \/>\ntls_cert_path: <span class=\"token string\">&#034;&#034;<\/span><br \/>\ntls_key_path: <span class=\"token string\">&#034;&#034;<\/span><\/p>\n<p>log:<br \/>\n  <span class=\"token comment\"># Output formatting for logs: text or json<\/span><br \/>\n  format: text<br \/>\n  level: info<\/p>\n<p><span class=\"token comment\"># Path to a file containg ACL policies.<\/span><br \/>\n<span class=\"token comment\"># ACLs can be defined as YAML or HUJSON.<\/span><br \/>\n<span class=\"token comment\"># https:\/\/tailscale.com\/kb\/1018\/acls\/<\/span><br \/>\nacl_policy_path: <span class=\"token string\">&#034;&#034;<\/span><\/p>\n<p><span class=\"token comment\">## DNS<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># headscale supports Tailscale&#039;s DNS configuration and MagicDNS.<\/span><br \/>\n<span class=\"token comment\"># Please have a look to their KB to better understand the concepts:<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># &#8211; https:\/\/tailscale.com\/kb\/1054\/dns\/<\/span><br \/>\n<span class=\"token comment\"># &#8211; https:\/\/tailscale.com\/kb\/1081\/magicdns\/<\/span><br \/>\n<span class=\"token comment\"># &#8211; https:\/\/tailscale.com\/blog\/2021-09-private-dns-with-magicdns\/<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\ndns_config:<br \/>\n  <span class=\"token comment\"># Whether to prefer using Headscale provided DNS or use local.<\/span><br \/>\n  override_local_dns: <span class=\"token boolean\">false<\/span><\/p>\n<p>  <span class=\"token comment\"># List of DNS servers to expose to clients.<\/span><br \/>\n  nameservers:<br \/>\n    &#8211; <span class=\"token number\">1.1<\/span>.1.1<\/p>\n<p>  <span class=\"token comment\"># NextDNS (see https:\/\/tailscale.com\/kb\/1218\/nextdns\/).<\/span><br \/>\n  <span class=\"token comment\"># &#034;abc123&#034; is example NextDNS ID, replace with yours.<\/span><br \/>\n  <span class=\"token comment\">#<\/span><br \/>\n  <span class=\"token comment\"># With metadata sharing:<\/span><br \/>\n  <span class=\"token comment\"># nameservers:<\/span><br \/>\n  <span class=\"token comment\">#   &#8211; https:\/\/dns.nextdns.io\/abc123<\/span><br \/>\n  <span class=\"token comment\">#<\/span><br \/>\n  <span class=\"token comment\"># Without metadata sharing:<\/span><br \/>\n  <span class=\"token comment\"># nameservers:<\/span><br \/>\n  <span class=\"token comment\">#   &#8211; 2a07:a8c0::ab:c123<\/span><br \/>\n  <span class=\"token comment\">#   &#8211; 2a07:a8c1::ab:c123<\/span><\/p>\n<p>  <span class=\"token comment\"># Split DNS (see https:\/\/tailscale.com\/kb\/1054\/dns\/),<\/span><br \/>\n  <span class=\"token comment\"># list of search domains and the DNS to query for each one.<\/span><br \/>\n  <span class=\"token comment\">#<\/span><br \/>\n  <span class=\"token comment\"># restricted_nameservers:<\/span><br \/>\n  <span class=\"token comment\">#   foo.bar.com:<\/span><br \/>\n  <span class=\"token comment\">#     &#8211; 1.1.1.1<\/span><br \/>\n  <span class=\"token comment\">#   darp.headscale.net:<\/span><br \/>\n  <span class=\"token comment\">#     &#8211; 1.1.1.1<\/span><br \/>\n  <span class=\"token comment\">#     &#8211; 8.8.8.8<\/span><\/p>\n<p>  <span class=\"token comment\"># Search domains to inject.<\/span><br \/>\n  domains: <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>  <span class=\"token comment\"># Extra DNS records<\/span><br \/>\n  <span class=\"token comment\"># so far only A-records are supported (on the tailscale side)<\/span><br \/>\n  <span class=\"token comment\"># See https:\/\/github.com\/juanfont\/headscale\/blob\/main\/docs\/dns-records.md#Limitations<\/span><br \/>\n  <span class=\"token comment\"># extra_records:<\/span><br \/>\n  <span class=\"token comment\">#   &#8211; name: &#034;grafana.myvpn.example.com&#034;<\/span><br \/>\n  <span class=\"token comment\">#     type: &#034;A&#034;<\/span><br \/>\n  <span class=\"token comment\">#     value: &#034;100.64.0.3&#034;<\/span><br \/>\n  <span class=\"token comment\">#<\/span><br \/>\n  <span class=\"token comment\">#   # you can also put it in one line<\/span><br \/>\n  <span class=\"token comment\">#   &#8211; { name: &#034;prometheus.myvpn.example.com&#034;, type: &#034;A&#034;, value: &#034;100.64.0.3&#034; }<\/span><\/p>\n<p>  <span class=\"token comment\"># Whether to use [MagicDNS](https:\/\/tailscale.com\/kb\/1081\/magicdns\/).<\/span><br \/>\n  <span class=\"token comment\"># Only works if there is at least a nameserver defined.<\/span><br \/>\n  magic_dns: <span class=\"token boolean\">true<\/span><\/p>\n<p>  <span class=\"token comment\"># Defines the base domain to create the hostnames for MagicDNS.<\/span><br \/>\n  <span class=\"token comment\"># &#096;base_domain&#096; must be a FQDNs, without the trailing dot.<\/span><br \/>\n  <span class=\"token comment\"># The FQDN of the hosts will be<\/span><br \/>\n  <span class=\"token comment\"># &#096;hostname.user.base_domain&#096; (e.g., _myhost.myuser.example.com_).<\/span><br \/>\n  base_domain: example.com<\/p>\n<p><span class=\"token comment\"># Unix socket used for the CLI to connect without authentication<\/span><br \/>\n<span class=\"token comment\"># Note: for production you will want to set this to something like:<\/span><br \/>\nunix_socket: \/etc\/headscale\/headscale.sock<br \/>\nunix_socket_permission: <span class=\"token string\">&#034;0770&#034;<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\"># headscale supports experimental OpenID connect support,<\/span><br \/>\n<span class=\"token comment\"># it is still being tested and might have some bugs, please<\/span><br \/>\n<span class=\"token comment\"># help us test it.<\/span><br \/>\n<span class=\"token comment\"># OpenID Connect<\/span><br \/>\n<span class=\"token comment\"># oidc:<\/span><br \/>\n<span class=\"token comment\">#   only_start_if_oidc_is_available: true<\/span><br \/>\n<span class=\"token comment\">#   issuer: &#034;https:\/\/your-oidc.issuer.com\/path&#034;<\/span><br \/>\n<span class=\"token comment\">#   client_id: &#034;your-oidc-client-id&#034;<\/span><br \/>\n<span class=\"token comment\">#   client_secret: &#034;your-oidc-client-secret&#034;<\/span><br \/>\n<span class=\"token comment\">#   # Alternatively, set &#096;client_secret_path&#096; to read the secret from the file.<\/span><br \/>\n<span class=\"token comment\">#   # It resolves environment variables, making integration to systemd&#039;s<\/span><br \/>\n<span class=\"token comment\">#   # &#096;LoadCredential&#096; straightforward:<\/span><br \/>\n<span class=\"token comment\">#   client_secret_path: &#034;${CREDENTIALS_DIRECTORY}\/oidc_client_secret&#034;<\/span><br \/>\n<span class=\"token comment\">#   # client_secret and client_secret_path are mutually exclusive.<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   # The amount of time from a node is authenticated with OpenID until it<\/span><br \/>\n<span class=\"token comment\">#   # expires and needs to reauthenticate.<\/span><br \/>\n<span class=\"token comment\">#   # Setting the value to &#034;0&#034; will mean no expiry.<\/span><br \/>\n<span class=\"token comment\">#   expiry: 180d<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   # Use the expiry from the token received from OpenID when the user logged<\/span><br \/>\n<span class=\"token comment\">#   # in, this will typically lead to frequent need to reauthenticate and should<\/span><br \/>\n<span class=\"token comment\">#   # only been enabled if you know what you are doing.<\/span><br \/>\n<span class=\"token comment\">#   # Note: enabling this will cause &#096;oidc.expiry&#096; to be ignored.<\/span><br \/>\n<span class=\"token comment\">#   use_expiry_from_token: false<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   # Customize the scopes used in the OIDC flow, defaults to &#034;openid&#034;, &#034;profile&#034; and &#034;email&#034; and add custom query<\/span><br \/>\n<span class=\"token comment\">#   # parameters to the Authorize Endpoint request. Scopes default to &#034;openid&#034;, &#034;profile&#034; and &#034;email&#034;.<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   scope: [&#034;openid&#034;, &#034;profile&#034;, &#034;email&#034;, &#034;custom&#034;]<\/span><br \/>\n<span class=\"token comment\">#   extra_params:<\/span><br \/>\n<span class=\"token comment\">#     domain_hint: example.com<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   # List allowed principal domains and\/or users. If an authenticated user&#039;s domain is not in this list, the<\/span><br \/>\n<span class=\"token comment\">#   # authentication request will be rejected.<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   allowed_domains:<\/span><br \/>\n<span class=\"token comment\">#     &#8211; example.com<\/span><br \/>\n<span class=\"token comment\">#   # Note: Groups from keycloak have a leading &#039;\/&#039;<\/span><br \/>\n<span class=\"token comment\">#   allowed_groups:<\/span><br \/>\n<span class=\"token comment\">#     &#8211; \/headscale<\/span><br \/>\n<span class=\"token comment\">#   allowed_users:<\/span><br \/>\n<span class=\"token comment\">#     &#8211; alice&#064;example.com<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   # If &#096;strip_email_domain&#096; is set to &#096;true&#096;, the domain part of the username email address will be removed.<\/span><br \/>\n<span class=\"token comment\">#   # This will transform &#096;first-name.last-name&#064;example.com&#096; to the user &#096;first-name.last-name&#096;<\/span><br \/>\n<span class=\"token comment\">#   # If &#096;strip_email_domain&#096; is set to &#096;false&#096; the domain part will NOT be removed resulting to the following<\/span><br \/>\n<span class=\"token comment\">#   user: &#096;first-name.last-name.example.com&#096;<\/span><br \/>\n<span class=\"token comment\">#<\/span><br \/>\n<span class=\"token comment\">#   strip_email_domain: true<\/span><\/p>\n<p><span class=\"token comment\"># Logtail configuration<\/span><br \/>\n<span class=\"token comment\"># Logtail is Tailscales logging and auditing infrastructure, it allows the control panel<\/span><br \/>\n<span class=\"token comment\"># to instruct tailscale nodes to log their activity to a remote server.<\/span><br \/>\nlogtail:<br \/>\n  <span class=\"token comment\"># Enable logtail for this headscales clients.<\/span><br \/>\n  <span class=\"token comment\"># As there is currently no support for overriding the log server in headscale, this is<\/span><br \/>\n  <span class=\"token comment\"># disabled by default. Enabling this will make your clients send logs to Tailscale Inc.<\/span><br \/>\n  enabled: <span class=\"token boolean\">false<\/span><\/p>\n<p><span class=\"token comment\"># Enabling this option makes devices prefer a random port for WireGuard traffic over the<\/span><br \/>\n<span class=\"token comment\"># default static port 41641. This option is intended as a workaround for some buggy<\/span><br \/>\n<span class=\"token comment\"># firewall devices. See https:\/\/tailscale.com\/kb\/1181\/firewalls\/ for more information.<\/span><br \/>\nrandomize_client_port: <span class=\"token boolean\">true<\/span><\/p>\n<p>3\u3001docker-compose \u6587\u4ef6 docker\u8fd9\u4e9b\u5b89\u88c5\u81ea\u884c\u641c\u7d22 \/xxx\/headscale\/docker-compose.yml<\/p>\n<p>version: <span class=\"token string\">&#039;3&#039;<\/span><\/p>\n<p>services:<br \/>\n  headscale:<br \/>\n    image: headscale\/headscale:0.22.0<br \/>\n    container_name: headscale<br \/>\n    command: headscale serve<br \/>\n    sysctls:<br \/>\n      &#8211; <span class=\"token assign-left variable\">net.ipv4.ip_forward<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><br \/>\n      &#8211; <span class=\"token assign-left variable\">net.ipv6.conf.all.forwarding<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><br \/>\n    restart: always<br \/>\n    volumes:<br \/>\n      &#8211; <span class=\"token environment constant\">$PWD<\/span>\/config:\/etc\/headscale<br \/>\n    ports:<br \/>\n      &#8211; <span class=\"token string\">&#034;21830:8081&#034;<\/span><br \/>\n      &#8211; <span class=\"token string\">&#034;21831:6030&#034;<\/span><\/p>\n<p>  headscale-ui:<br \/>\n    image: ghcr.io\/gurucomputing\/headscale-ui:2023.01.30-beta-1<br \/>\n    restart: always<br \/>\n    container_name: headscale-ui<br \/>\n    ports:<br \/>\n      &#8211; <span class=\"token string\">&#034;21832:80&#034;<\/span><\/p>\n<p>4\u3001\u90e8\u7f72 docker-compose up -d 5\u3001\u521b\u5efa apikey<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> headscale headscale api create<\/p>\n<p>6\u3001\u521b\u5efa\u79df\u6237 \u8fd9\u4e2a\u81ea\u5df1\u5b9a\u4e49 \u4f8b\u5982 defname \u5219\u4e0b\u9762\u6240\u6709\u7684\u90fd\u66ff\u6362\u6210defname<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> headscale headscale user create <span class=\"token operator\">&lt;<\/span>USERNAME<span class=\"token operator\">&gt;<\/span><\/p>\n<p>7\u3001nginx \u914d\u7f6e \u53ef\u540c\u57df\u540d&#xff0c;\u4e5f\u53ef\u4e0d\u540c\u57df\u540d&#xff0c;\u4f46\u662f\u4e0d\u80fd\u9ed8\u8ba4\u540cip\u4e0d\u540c\u7aef\u53e3&#xff0c;\u4f1a\u6709\u8de8\u57df\u95ee\u9898\u3002 \u5982\u679c\u662fhttps \u4f7f\u7528\u5ba2\u6237\u7aef\u8fde\u63a5\u7684\u65f6\u5019\u4e0d\u4f1a\u81ea\u52a8\u6253\u5f00\u6d4f\u89c8\u5668\u7684&#xff0c;\u4eb2\u6d4bhttp\u4f1a\u81ea\u52a8\u6253\u5f00\u6d4f\u89c8\u5668\u770b\u5230nodekey<\/p>\n<p>server <span class=\"token punctuation\">{<\/span><br \/>\n        listen       <span class=\"token number\">21833<\/span> ssl<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\"># Security \/ XSS Mitigation Headers<\/span><br \/>\n        server_name  localhost<span class=\"token punctuation\">;<\/span><br \/>\n        ssl_certificate      \/usr\/share\/nginx\/8668953_xxxx.xxx.top.pem<span class=\"token punctuation\">;<\/span><br \/>\n        ssl_certificate_key  \/usr\/share\/nginx\/8668953_xxx.xxx-show.top.key<span class=\"token punctuation\">;<\/span><br \/>\n        ssl_session_cache    shared:SSL:1m<span class=\"token punctuation\">;<\/span><br \/>\n        ssl_session_timeout  5m<span class=\"token punctuation\">;<\/span><br \/>\n        ssl_ciphers  HIGH:<span class=\"token operator\">!<\/span>aNULL:<span class=\"token operator\">!<\/span>MD5<span class=\"token punctuation\">;<\/span><br \/>\n        ssl_prefer_server_ciphers  on<span class=\"token punctuation\">;<\/span><\/p>\n<p>        add_header X-Frame-Options <span class=\"token string\">&#034;SAMEORIGIN&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header X-XSS-Protection <span class=\"token string\">&#034;1; mode&#061;block&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        add_header X-Content-Type-Options <span class=\"token string\">&#034;nosniff&#034;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        location \/web <span class=\"token punctuation\">{<\/span><br \/>\n            proxy_redirect off<span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_pass http:\/\/192.168.123.118:21832<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        location \/ <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token comment\">#proxy_pass http:\/\/127.0.0.1:8081;<\/span><br \/>\n            proxy_pass http:\/\/192.168.123.118:21830<span class=\"token punctuation\">;<\/span><br \/>\n            proxy_http_version <span class=\"token number\">1.1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header Upgrade <span class=\"token variable\">$http_upgrade<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header Connection <span class=\"token string\">&#034;upgrade&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header Host <span class=\"token variable\">$host<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_redirect http:\/\/ https:\/\/<span class=\"token punctuation\">;<\/span><br \/>\n            proxy_buffering off<span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header X-Real-IP <span class=\"token variable\">$remote_addr<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header X-Forwarded-For <span class=\"token variable\">$proxy_add_x_forwarded_for<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            proxy_set_header X-Forwarded-Proto <span class=\"token variable\">$http_x_forwarded_proto<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            add_header Strict-Transport-Security <span class=\"token string\">&#034;max-age&#061;15552000; includeSubDomains&#034;<\/span> always<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>8\u3001\u6309\u63d0\u793a\u5728\u7f51\u9875\u914d\u7f6e\u57df\u540d\u548capikey <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034227-68031ba3c1bc6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>9\u3001\u5ba2\u6237\u7aef\u5b89\u88c5 9.1\u3001windows&#xff1a;tailscaled \u5b98\u65b9\u4e0b\u8f7d<\/p>\n<p>                    \u5b89\u88c5\u540e\u6267\u884c\u547d\u4ee4&#xff1a;      <\/p>\n<p><span class=\"token comment\">#\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u767b\u5f55&#xff0c;\u6ce8\u518c,192.168.0.0\/24\u6539\u4e3a\u4f60\u5c40\u57df\u7f51ip\u6bb5<\/span><br \/>\ntailscale login &#8211;login-server http:\/\/\u670d\u52a1\u5668ip:21833<\/p>\n<p><span class=\"token comment\">#\u91cd\u65b0\u767b\u5f55&#xff0c;ailscale \u5ba2\u6237\u7aef\u8282\u70b9\u505a\u7f51\u5173\u5ba2\u6237\u7aef\u591a\u4e2a\u5b50\u7f51\u8fdb\u884c\u66b4\u9732  \u4fee\u6539\u5b50\u7f51\u8def\u7531 \u591a\u4e2a\u5b50\u7f51\u4f7f\u7528\u9017\u53f7\u5206\u9694 \u4f8b\u5982<\/span><br \/>\ntailscale up &#8211;login-server http:\/\/ip\u6216\u8005\u57df\u540d:21833 &#8211;advertise-exit-node &#8211;accept-dns<span class=\"token operator\">&#061;<\/span>false &#8211;advertise-routes<span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.0.0\/24,192.168.123.0\/24 <span class=\"token parameter variable\">&#8211;reset<\/span><\/p>\n<p>9.2\u3001linux&#xff1a; docker \u5b89\u88c5&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;name<\/span> tailscaled <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;restart<\/span> always <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-v<\/span> \/var\/lib:\/var\/lib <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-v<\/span> \/dev\/net\/tun:\/dev\/net\/tun <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">-v<\/span> \/lib\/modules:\/lib\/modules <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token parameter variable\">&#8211;network<\/span><span class=\"token operator\">&#061;<\/span>host <span class=\"token parameter variable\">&#8211;privileged<\/span><span class=\"token operator\">&#061;<\/span>true <span class=\"token punctuation\">\\\\<\/span><br \/>\n  tailscale\/tailscale tailscaled<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> tailscaled tailscale login &#8211;login-server http:\/\/<span class=\"token operator\">&lt;<\/span>public_ip<span class=\"token operator\">&gt;<\/span>:8081<\/p>\n<p>\u8f6c\u53d1\u914d\u7f6e&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;net.ipv4.ip_forward &#061; 1&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">tee<\/span> \/etc\/sysctl.d\/ipforwarding.conf<br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;net.ipv6.conf.all.forwarding &#061; 1&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">tee<\/span> <span class=\"token parameter variable\">-a<\/span> \/etc\/sysctl.d\/ipforwarding.conf<br \/>\n<span class=\"token function\">sysctl<\/span> <span class=\"token parameter variable\">-p<\/span><\/p>\n<p>9.3 linux \u672c\u5730\u5b89\u88c5 \u5b98\u7f51&#xff1a;https:\/\/tailscale.com\/download\/linux\/static <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034228-68031ba4be785.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-fsSL<\/span> https:\/\/tailscale.com\/install.sh <span class=\"token operator\">|<\/span> <span class=\"token function\">sh<\/span><\/p>\n<p><span class=\"token comment\">#\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u767b\u5f55&#xff0c;\u6ce8\u518c,192.168.0.0\/24\u6539\u4e3a\u4f60\u5c40\u57df\u7f51ip\u6bb5<\/span><br \/>\ntailscale login &#8211;login-server http:\/\/\u670d\u52a1\u5668ip:21833<\/p>\n<p><span class=\"token comment\">#\u91cd\u65b0\u767b\u5f55&#xff0c;ailscale \u5ba2\u6237\u7aef\u8282\u70b9\u505a\u7f51\u5173\u5ba2\u6237\u7aef\u591a\u4e2a\u5b50\u7f51\u8fdb\u884c\u66b4\u9732  \u4fee\u6539\u5b50\u7f51\u8def\u7531 \u591a\u4e2a\u5b50\u7f51\u4f7f\u7528\u9017\u53f7\u5206\u9694 \u4f8b\u5982<\/span><br \/>\ntailscale up &#8211;login-server http:\/\/ip\u6216\u8005\u57df\u540d:21833 &#8211;advertise-exit-node &#8211;accept-dns<span class=\"token operator\">&#061;<\/span>false &#8211;advertise-routes<span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.0.0\/24,192.168.123.0\/24 <span class=\"token parameter variable\">&#8211;reset<\/span><\/p>\n<p>\u6267\u884c\u5b8c\u6210\u540e\u53bb\u770bheadscale\u5bb9\u5668\u65e5\u5fd7\u6216\u8005\u5f53\u524d\u7a97\u53e3\u65e5\u5fd7<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034229-68031ba5aea3f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034230-68031ba62689a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u590d\u5236\u51fa nodekey&#xff1a;8edc7b8a44b42e70cf52101772ad86d7479f487043b52d8df5f8db04c45bfb37 \u7136\u540e\u5728headscale\u5bb9\u5668\u91cc\u9762\u6267\u884c \u4e0b\u9762\u7684\u547d\u4ee4\u628alinux\u5ba2\u6237\u7aef\u6dfb\u52a0\u5230headscale &#xff0c;\u9700\u8981\u4fee\u6539\u6210\u81ea\u5df1\u7684\u7528\u6237\u4f8b\u5982\u4e0a\u9762\u7684defname<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> headscale headscale nodes register <span class=\"token parameter variable\">&#8211;user<\/span> <span class=\"token operator\">&lt;<\/span>USERNAME<span class=\"token operator\">&gt;<\/span> <span class=\"token parameter variable\">&#8211;key<\/span> nodekey:a54fcc7eaf88db89d20de099a31e7bcdefeb31e04855fcb75d62d582fd917804<\/p>\n<p>10.\u5b89\u5353app tailscale.apk <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034230-68031ba6e2354.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u7136\u540e\u586b\u5165headscale\u670d\u52a1\u5668\u5730\u5740 &#xff1a;\u548c\u7b2c8\u6b65\u4e00\u6837&#xff0c;\u8f93\u5165https:\/\/ip\u6216\u8005\u57df\u540d:21833 \u8f93\u5165\u5b8c\u6210\u540e\u53bb \u6267\u884c\u5b8c\u6210\u540e\u53bb\u770bheadscale\u5bb9\u5668\u65e5\u5fd7 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034231-68031ba70f77c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u590d\u5236\u51fa nodekey&#xff1a;8edc7b8a44b42e70cf52101772ad86d7479f487043b52d8df5f8db04c45bfb37 \u7136\u540e\u5728headscale\u5bb9\u5668\u91cc\u9762\u6267\u884c \u4e0b\u9762\u7684\u547d\u4ee4\u628alinux\u5ba2\u6237\u7aef\u6dfb\u52a0\u5230headscale &#xff0c;\u9700\u8981\u4fee\u6539\u6210\u81ea\u5df1\u7684\u7528\u6237\u4f8b\u5982\u4e0a\u9762\u7684defname<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> headscale headscale nodes register <span class=\"token parameter variable\">&#8211;user<\/span> <span class=\"token operator\">&lt;<\/span>USERNAME<span class=\"token operator\">&gt;<\/span> <span class=\"token parameter variable\">&#8211;key<\/span> nodekey:a54fcc7eaf88db89d20de099a31e7bcdefeb31e04855fcb75d62d582fd917804<\/p>\n<p>\u603b\u7ed3&#xff0c; \u4e0d\u7ba1\u4ec0\u4e48\u5ba2\u6237\u7aef\u8fde\u63a5&#xff0c;\u90fd\u9700\u8981\u53bbheadscale\u5bb9\u5668\u770b\u4e00\u4e0b\u8fde\u63a5\u751f\u6210\u7684nodekey&#xff0c;\u7136\u540e\u6267\u884c\u547d\u4ee4\u6dfb\u52a0\u5ba2\u6237\u7aef<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> headscale headscale nodes register <span class=\"token parameter variable\">&#8211;user<\/span> <span class=\"token operator\">&lt;<\/span>USERNAME<span class=\"token operator\">&gt;<\/span> <span class=\"token parameter variable\">&#8211;key<\/span> nodekey:a54fcc7eaf88db89d20de099a31e7bcdefeb31e04855fcb75d62d582fd917804<\/p>\n<p>11.macOS macOS \u6709 3 \u79cd\u5b89\u88c5\u65b9\u6cd5&#xff1a;<\/p>\n<p>\u76f4\u63a5\u901a\u8fc7\u5e94\u7528\u5546\u5e97\u5b89\u88c5&#xff0c;\u5730\u5740&#xff1a;https:\/\/apps.apple.com\/ca\/app\/tailscale\/id1475387142\u3002\u524d\u63d0\u662f\u4f60\u9700\u8981\u4e00\u4e2a\u7f8e\u533a ID\u3002\u3002\u3002 \u4e0b\u8f7d\u5b89\u88c5\u5305\u76f4\u63a5\u5b89\u88c5&#xff0c;\u7ed5\u8fc7\u5e94\u7528\u5546\u5e97\u3002 \u5b89\u88c5\u5f00\u6e90\u7684\u547d\u4ee4\u884c\u5de5\u5177 tailscale \u548c tailscaled\u3002\u76f8\u5173\u94fe\u63a5&#xff1a;https:\/\/github.com\/tailscale\/tailscale\/wiki\/Tailscaled-on-macOS\u3002 \u8fd9\u4e09\u79cd\u5b89\u88c5\u5305\u7684\u6838\u5fc3\u6570\u636e\u5305\u5904\u7406\u4ee3\u7801\u662f\u76f8\u540c\u7684&#xff0c;\u552f\u4e00\u7684\u533a\u522b\u5728\u4e8e\u5728\u4e8e\u6253\u5305\u65b9\u5f0f\u4ee5\u53ca\u4e0e\u7cfb\u7edf\u7684\u4ea4\u4e92\u65b9\u5f0f\u3002<\/p>\n<p>\u5e94\u7528\u5546\u5e97\u91cc\u7684\u5e94\u7528\u8fd0\u884c\u5728\u4e00\u4e2a\u5e94\u7528\u6c99\u7bb1\u4e2d&#xff0c;\u4e0e\u7cfb\u7edf\u7684\u5176\u4ed6\u90e8\u5206\u9694\u79bb\u3002\u5728\u6c99\u7bb1\u5185&#xff0c;\u5e94\u7528\u53ef\u4ee5\u662f\u4e00\u4e2a\u7f51\u7edc\u6269\u5c55&#xff0c;\u4ee5\u5b9e\u73b0 VPN \u6216\u8005\u7c7b VPN \u7684\u529f\u80fd\u3002\u7f51\u7edc\u6269\u5c55\u5b9e\u73b0\u7684\u529f\u80fd\u5bf9\u5e94\u7528\u5546\u5e97\u4e4b\u5916\u7684\u5e94\u7528\u662f\u65e0\u6cd5\u751f\u6548\u7684\u3002<\/p>\n<p>\u4ece macOS \u4ece 10.15 \u5f00\u59cb\u65b0\u589e\u4e86\u7cfb\u7edf\u6269\u5c55&#xff0c;\u8bf4\u767d\u4e86\u5c31\u662f\u8fd0\u884c\u5728\u7528\u6237\u6001\u7684\u5185\u6838\u6269\u5c55&#xff0c;\u5b83\u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684\u7f51\u7edc\u6269\u5c55\u589e\u5f3a\u4e86\u5f88\u591a\u529f\u80fd&#xff0c;\u6bd4\u5982\u5185\u5bb9\u8fc7\u6ee4\u3001\u900f\u660e\u4ee3\u7406\u3001DNS \u4ee3\u7406\u7b49\u3002Tailscale \u72ec\u7acb\u4e8e\u5e94\u7528\u5546\u5e97\u7684\u5b89\u88c5\u5305\u4f7f\u7528\u7684\u5c31\u662f\u7cfb\u7edf\u6269\u5c55&#xff0c;\u901a\u8fc7 DMG \u6216\u8005 zip \u538b\u7f29\u5305\u8fdb\u884c\u5206\u53d1\u3002<\/p>\n<p>{{&lt; alert &gt;}} \u4e0d\u8981\u540c\u65f6\u5b89\u88c5\u5e94\u7528\u5546\u5e97\u7248\u672c\u548c\u72ec\u7acb\u5206\u53d1\u7248\u672c&#xff0c;\u540c\u65f6\u53ea\u80fd\u88c5\u4e00\u4e2a\u3002 {{&lt; \/alert &gt;}}<\/p>\n<p>\u800c\u547d\u4ee4\u884c\u5de5\u5177\u65e2\u6ca1\u6709\u4f7f\u7528\u7f51\u7edc\u6269\u5c55\u4e5f\u6ca1\u6709\u4f7f\u7528\u7cfb\u7edf\u6269\u5c55&#xff0c;\u800c\u662f\u4f7f\u7528\u7684 utun \u63a5\u53e3&#xff0c;\u76f8\u6bd4\u4e8e GUI \u7248\u672c\u7f3a\u5c11\u4e86\u90e8\u5206\u529f\u80fd&#xff0c;\u6bd4\u5982 MagicDNS \u548c Taildrop\u3002<\/p>\n<p>\u76f4\u63a5\u4e0b\u8f7d\u5b89\u88c5\u5305<\/p>\n<p>https:\/\/pkgs.tailscale.com\/stable\/<\/p>\n<p>\u53ef\u4ee5\u4e0b\u6765\u9009\u62e9\u5b89\u88c5\u7684\u7248\u672c <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034231-68031ba755a60.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6700\u65b0\u7248\u7684\u8fde\u63a5\u4e0d\u4e0a\u81ea\u5b9a\u4e49headscale\u670d\u52a1\u5668 \u6211\u5c31\u4f7f\u7528\u4e861.46.0\u7248\u672c <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034232-68031ba84c33b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034232-68031ba8701a8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> \u8f93\u5165headscale\u670d\u52a1\u5668\u540e&#xff0c;\u53bbheadscale\u5bb9\u5668\u770bnodekey \u590d\u5236\u51fa nodekey&#xff1a;8edc7b8a44b42e70cf52101772ad86d7479f487043b52d8df5f8db04c45bfb37 \u7136\u540e\u5728headscale\u5bb9\u5668\u91cc\u9762\u6267\u884c \u4e0b\u9762\u7684\u547d\u4ee4\u628alinux\u5ba2\u6237\u7aef\u6dfb\u52a0\u5230headscale &#xff0c;\u9700\u8981\u4fee\u6539\u6210\u81ea\u5df1\u7684\u7528\u6237\u4f8b\u5982\u4e0a\u9762\u7684defname<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> headscale headscale nodes register <span class=\"token parameter variable\">&#8211;user<\/span> <span class=\"token operator\">&lt;<\/span>USERNAME<span class=\"token operator\">&gt;<\/span> <span class=\"token parameter variable\">&#8211;key<\/span> nodekey:a54fcc7eaf88db89d20de099a31e7bcdefeb31e04855fcb75d62d582fd917804<\/p>\n<p>12 \u901a\u7528 \u6700\u540e\u4e00\u4e2a\u6dfb\u52a0\u5ba2\u6237\u7aef\u5230\u670d\u52a1\u5668\u7684 \u9875\u9762\u7b80\u5355\u64cd\u4f5c\u65b9\u6cd5 \u76f4\u63a5\u590d\u5236 nodekey:a54fcc7eaf88db89d20de099a31e7bcdefeb31e04855fcb75d62d582fd917804<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034232-68031ba8f39d9.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>https:\/\/www.bilibili.com\/video\/BV1Wh411A73b\/?spm_id_from&#061;333.337.search-card.all.click&#038;vd_source&#061;76e331425fd26d8f803c4e03a88ddc41<\/p>\n<p>13\u3001\u6253\u901a\u5c40\u57df\u7f51&#xff0c;\u6bd4\u5982\u5bb6\u91ccWindows\u7535\u8111A&#xff0c;\u5b89\u88c5\u4e86tailscale\u5ba2\u6237\u7aef&#xff0c;\u5916\u5730\u7535\u8111B&#xff0c;\u4e5f\u5b89\u88c5\u4e86tailscale\u5ba2\u6237\u7aef&#xff0c;\u4f46\u662f\u5bb6\u91cc\u5176\u4ed6\u8bbe\u5907\u6bd4\u5982nas&#xff0c;\u624b\u673a\u90fd\u6ca1\u6709\u5b89\u88c5tailscale\u5ba2\u6237\u7aef\u3002\u5916\u5730\u7535\u8111B\u4e5f\u53ef\u4ee5\u50cf\u5bb6\u91cc\u7535\u8111A\u4e00\u6837\u8bbf\u95ee\u5bb6\u91cc\u5c40\u57df\u7f51\u5185\u7684\u624b\u673a&#xff0c;nas\u7b49\u7b49\u8bbe\u5907&#xff0c;\u5c31\u53ef\u4ee5\u7528Windows\u7535\u8111A\u505a\u8def\u7531\u7f51\u5173\u3002<\/p>\n<p>\u5c31\u662f\u5728\u5916\u4f7f\u7528\u4efb\u4f55\u7f51\u7edc&#xff0c;\u4e5f\u53ef\u4ee5\u50cf\u5728\u5bb6\u91cc\u4e00\u6837\u8bbf\u95ee\u5bb6\u91cc\u5c40\u57df\u7f51\u5185\u7684\u624b\u673a&#xff0c;\u7535\u8111&#xff0c;nas&#xff0c;\u8def\u7531\u7b49\u7b49\u3002<\/p>\n<p>\u53ea\u9700\u8981\u4fee\u6539\u4e00\u4e0b\u6ce8\u518c\u767b\u5f55\u547d\u4ee4\u5373\u53ef&#xff0c;\u540e\u9762\u670d\u52a1\u5668\u9a8c\u8bc1\u90fd\u662f\u4e00\u6837\u7684\u3002<\/p>\n<p>\u5bb6\u91ccWindows\u7535\u8111A&#xff1a;<\/p>\n<p><span class=\"token comment\">#\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u767b\u5f55&#xff0c;\u6ce8\u518c,192.168.0.0\/24\u6539\u4e3a\u4f60\u5c40\u57df\u7f51ip\u6bb5<\/span><br \/>\ntailscale login &#8211;login-server http:\/\/\u670d\u52a1\u5668ip:21833<\/p>\n<p><span class=\"token comment\">#\u91cd\u65b0\u767b\u5f55&#xff0c;ailscale \u5ba2\u6237\u7aef\u8282\u70b9\u505a\u7f51\u5173\u5ba2\u6237\u7aef\u591a\u4e2a\u5b50\u7f51\u8fdb\u884c\u66b4\u9732  \u4fee\u6539\u5b50\u7f51\u8def\u7531 \u591a\u4e2a\u5b50\u7f51\u4f7f\u7528\u9017\u53f7\u5206\u9694 \u4f8b\u5982<\/span><br \/>\ntailscale up &#8211;login-server http:\/\/ip\u6216\u8005\u57df\u540d:21833 &#8211;advertise-exit-node &#8211;accept-dns<span class=\"token operator\">&#061;<\/span>false &#8211;advertise-routes<span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.0.0\/24,192.168.123.0\/24 <span class=\"token parameter variable\">&#8211;reset<\/span><\/p>\n<p>\u5982\u679c\u5bb6\u91cc\u662flinux\u7535\u8111&#xff0c;\u6216\u8005openwrt\u7b49\u8f6f\u8def\u7531&#xff1a;<\/p>\n<p>\u4e0a\u9762\u4e5f\u662f\u4e00\u6837\u7684&#xff0c;\u53ea\u662f\u591a\u4e00\u4e2a\u7aef\u53e3\u8f6c\u53d1&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;net.ipv4.ip_forward &#061; 1&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">tee<\/span> \/etc\/sysctl.d\/ipforwarding.conf<br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;net.ipv6.conf.all.forwarding &#061; 1&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">tee<\/span> <span class=\"token parameter variable\">-a<\/span> \/etc\/sysctl.d\/ipforwarding.conf<br \/>\n<span class=\"token function\">sysctl<\/span> <span class=\"token parameter variable\">-p<\/span> \/etc\/sysctl.d\/ipforwarding.conf<\/p>\n<p>headtail\u670d\u52a1\u7aef\u6dfb\u52a0\u4e00\u4e0b\u8def\u7531\u5373\u53ef&#xff1a;<\/p>\n<p>#\u67e5\u770b\u8def\u7531\u5217\u8868&#xff0c;\u83b7\u53d6\u9700\u8981\u6253\u901a\u7684\u5c40\u57df\u7f51\u5e8f\u53f7<\/p>\n<p>headscale routes list<\/p>\n<p>#\u6bd4\u5982\u6253\u901a\u5e8f\u53f71\u7684\u8def\u7531<\/p>\n<p>headscale routes <span class=\"token builtin class-name\">enable<\/span> <span class=\"token parameter variable\">-r<\/span> <span class=\"token number\">1<\/span><\/p>\n<li>tailscale \u5ba2\u6237\u7aef\u8282\u70b9\u505a\u7f51\u5173\u5ba2\u6237\u7aef\u591a\u4e2a\u5b50\u7f51\u8fdb\u884c\u66b4\u9732 \u4fee\u6539\u5b50\u7f51\u8def\u7531 \u591a\u4e2a\u5b50\u7f51\u4f7f\u7528\u9017\u53f7\u5206\u9694 \u4f8b\u598210.100.70.0\/24,10.100.71.0\/24<\/li>\n<p>tailscale up &#8211;login-server http:\/\/ip\u6216\u8005\u57df\u540d:21833 &#8211;advertise-exit-node &#8211;accept-dns<span class=\"token operator\">&#061;<\/span>false &#8211;advertise-routes<span class=\"token operator\">&#061;<\/span><span class=\"token number\">192.168<\/span>.0.0\/24,192.168.123.0\/24 <span class=\"token parameter variable\">&#8211;reset<\/span><\/p>\n<p>14,\u4e00\u4e9b\u8865\u5145\u529f\u80fd<\/p>\n<p>14.1 \u5220\u9664\u8282\u70b9\u6216\u5b50\u7f51\u5173<\/p>\n<p>headscale routes list<br \/>\nheadscale routes <span class=\"token builtin class-name\">enable<\/span> <span class=\"token parameter variable\">-r<\/span> <span class=\"token number\">1<\/span> \/\/1\u4e3a routes list \u7684id<br \/>\nheadscale routes disable <span class=\"token parameter variable\">-r<\/span> <span class=\"token number\">1<\/span> \/\/\u7981\u7528\u8def\u7531<br \/>\nheadscale routes delete <span class=\"token parameter variable\">-r<\/span> <span class=\"token number\">1<\/span> \/\/\u5220\u9664\u8def\u7531<\/p>\n<p>namespace<\/p>\n<p>headscale namespace list <span class=\"token comment\"># \u67e5\u770b\u6240\u6709\u7684namespace<\/span><br \/>\nheadscale namespace create default <span class=\"token comment\"># \u521b\u5efanamespace<\/span><br \/>\nheadscale namespace destroy default <span class=\"token comment\"># \u5220\u9664namespace<\/span><br \/>\nheadscale namespace <span class=\"token function\">rename<\/span> default  myspace <span class=\"token comment\"># \u91cd\u547d\u540dnamespace<\/span><\/p>\n<p>node<\/p>\n<p>headscale <span class=\"token function\">node<\/span> list <span class=\"token comment\"># \u5217\u51fa\u6240\u6709\u7684\u8282\u70b9<\/span><br \/>\nheadscale <span class=\"token function\">node<\/span> <span class=\"token function\">ls<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token comment\"># \u5217\u51fa\u6240\u6709\u7684\u8282\u70b9,\u540c\u65f6\u663e\u793a\u51fatag\u4fe1\u606f<\/span><br \/>\nheadscale <span class=\"token parameter variable\">-n<\/span> default <span class=\"token function\">node<\/span> <span class=\"token function\">ls<\/span> <span class=\"token comment\"># \u53ea\u67e5\u770bnamespace\u4e3adefault\u4e0b\u7684\u8282\u70b9<\/span><br \/>\nheadscale <span class=\"token function\">node<\/span> delete -i<span class=\"token operator\">&lt;<\/span>ID<span class=\"token operator\">&gt;<\/span> <span class=\"token comment\"># \u6839\u636eid\u5220\u9664\u6307\u5b9a\u7684\u8282\u70b9&#xff0c;\u8fd9\u91cc\u9762\u7684id\u662fnode list\u67e5\u8be2\u51fa\u6765\u7684id<\/span><br \/>\n                             <span class=\"token comment\"># \u53c2\u8003headscale nodes delete -i&#061;6<\/span><br \/>\nheadscale <span class=\"token function\">node<\/span> tag <span class=\"token parameter variable\">-i<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">2<\/span> <span class=\"token parameter variable\">-t<\/span><span class=\"token operator\">&#061;<\/span>tag:test <span class=\"token comment\"># \u7ed9id\u4e3a2\u7684node\u8bbe\u7f6etag\u4e3atag:test<\/span><\/p>\n<p>route<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.4k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u7136\u540e\u5728headscale\u5bb9\u5668\u91cc\u9762\u6267\u884c \u4e0b\u9762\u7684\u547d\u4ee4\u628alinux\u5ba2\u6237\u7aef\u6dfb\u52a0\u5230headscale \uff0c\u9700\u8981\u4fee\u6539\u6210\u81ea\u5df1\u7684\u7528\u6237\u4f8b\u5982\u4e0a\u9762\u7684defname\u3002\/xxx\/headscale\/config\/config.yaml     \u7aef\u53e3\u6211\u6539\u4e86\uff0c\u6839\u636e\u81ea\u5df1\u60c5\u51b5\u6765\u3002\u5b98\u7f51\uff1ahttps:\/\/tailscale.com\/download\/linux\/static\u30027\u3001nginx \u914d\u7f6e  \u53ef\u540c\u57df\u540d\uff0c\u4e5f\u53ef\u4e0d\u540c\u57df\u540d\uff0c\u4f46\u662f\u4e0d\u80fd\u9ed8\u8ba4\u540cip\u4e0d\u540c\u7aef\u53e3\uff0c\u4f1a\u6709\u8de8\u57df\u95ee\u9898\u30023\u3001docker-compose \u6587\u4ef6  docker\u8fd9\u4e9b\u5b89\u88c5\u81ea\u884c\u641c\u7d22\u3002_headscale<\/p>\n","protected":false},"author":2,"featured_media":25114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,780,43],"topic":[],"class_list":["post-25124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-docker","tag-ui","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/25124.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.4k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u7136\u540e\u5728headscale\u5bb9\u5668\u91cc\u9762\u6267\u884c \u4e0b\u9762\u7684\u547d\u4ee4\u628alinux\u5ba2\u6237\u7aef\u6dfb\u52a0\u5230headscale \uff0c\u9700\u8981\u4fee\u6539\u6210\u81ea\u5df1\u7684\u7528\u6237\u4f8b\u5982\u4e0a\u9762\u7684defname\u3002\/xxx\/headscale\/config\/config.yaml   \u7aef\u53e3\u6211\u6539\u4e86\uff0c\u6839\u636e\u81ea\u5df1\u60c5\u51b5\u6765\u3002\u5b98\u7f51\uff1ahttps:\/\/tailscale.com\/download\/linux\/static\u30027\u3001nginx \u914d\u7f6e \u53ef\u540c\u57df\u540d\uff0c\u4e5f\u53ef\u4e0d\u540c\u57df\u540d\uff0c\u4f46\u662f\u4e0d\u80fd\u9ed8\u8ba4\u540cip\u4e0d\u540c\u7aef\u53e3\uff0c\u4f1a\u6709\u8de8\u57df\u95ee\u9898\u30023\u3001docker-compose \u6587\u4ef6 docker\u8fd9\u4e9b\u5b89\u88c5\u81ea\u884c\u641c\u7d22\u3002_headscale\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/25124.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T03:42:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034227-68031ba3c1bc6.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/25124.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/25124.html\",\"name\":\"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T03:42:34+00:00\",\"dateModified\":\"2025-04-19T03:42:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/25124.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/25124.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/25124.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/25124.html","og_locale":"zh_CN","og_type":"article","og_title":"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.4k\u6b21\uff0c\u70b9\u8d5e9\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u7136\u540e\u5728headscale\u5bb9\u5668\u91cc\u9762\u6267\u884c \u4e0b\u9762\u7684\u547d\u4ee4\u628alinux\u5ba2\u6237\u7aef\u6dfb\u52a0\u5230headscale \uff0c\u9700\u8981\u4fee\u6539\u6210\u81ea\u5df1\u7684\u7528\u6237\u4f8b\u5982\u4e0a\u9762\u7684defname\u3002\/xxx\/headscale\/config\/config.yaml   \u7aef\u53e3\u6211\u6539\u4e86\uff0c\u6839\u636e\u81ea\u5df1\u60c5\u51b5\u6765\u3002\u5b98\u7f51\uff1ahttps:\/\/tailscale.com\/download\/linux\/static\u30027\u3001nginx \u914d\u7f6e \u53ef\u540c\u57df\u540d\uff0c\u4e5f\u53ef\u4e0d\u540c\u57df\u540d\uff0c\u4f46\u662f\u4e0d\u80fd\u9ed8\u8ba4\u540cip\u4e0d\u540c\u7aef\u53e3\uff0c\u4f1a\u6709\u8de8\u57df\u95ee\u9898\u30023\u3001docker-compose \u6587\u4ef6 docker\u8fd9\u4e9b\u5b89\u88c5\u81ea\u884c\u641c\u7d22\u3002_headscale","og_url":"https:\/\/www.wsisp.com\/helps\/25124.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T03:42:34+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250419034227-68031ba3c1bc6.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"13 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/25124.html","url":"https:\/\/www.wsisp.com\/helps\/25124.html","name":"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T03:42:34+00:00","dateModified":"2025-04-19T03:42:34+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/25124.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/25124.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/25124.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u81ea\u5b9a\u4e49\u670d\u52a1\u5668 headscale headscale-ui \u90e8\u7f72 docker"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/25124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=25124"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/25124\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/25114"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=25124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=25124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=25124"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=25124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}