Skip to content

Tailscale

Tailscale vpn client

Setup A Exit Node Docker instance

How it works: client node -> exit node -> internet

Generate auth key at https://login.tailscale.com/admin/settings/keys

Issue following commands on exit node

shell
echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf

docker pull tailscale/tailscale:latest

docker \
run -d \
--restart unless-stopped \
--name tail \
-e TS_AUTHKEY=tskey-auth-... \
-e TS_EXTRA_ARGS=--advertise-exit-node \
tailscale/tailscale:latest

ref: https://tailscale.com/kb/1282/docker

Sharing file

shell
tailscale file send path/to/file targetNode:

# ssh targetNode
# save path/to/file to save/to/here

tailscale file get . save/to/here

桌面客户端可通过鼠标拖放分享文件。

refs:

Login with passkey

通过邀请新用户加入已有网络,新用户可设置通过 passkey 登录 。

多个帐号之间子网隔离

场景: 支持工程师 foo 同时负责项目 A 和 B ,两个项目分别归属不同公司,foo 同时远程管理 A 和 B,并且 A 和 B 不能互相访问。

foo 分别注册两个 tailscale 账号,在 tailscale 桌面客户端 Settings - Accounts - Add Account 都登陆后,即可一键切换账号在连入 A 、B 网络之间切换。

Tailscale 和公司 Virtual Private Network 冲突

大部分企业建立了私有网络,在同一个虚拟私有网络里的机器可互访问。员工公司以外访问公司私有网络(内网)时可能会使用特定客户端, 它会和 tailscale 解释冲突,互相影响,其中一个无法使用。

可针对 tailscale 设置以下规则不走企业内网

txt
IP 段 100.64.0.0/10
域名前缀 ts.net
目标端口 41641

Released under the CC-BY-NC-4.0