tailscale derp中继搭建

22

1.安装golang

https://go.dev/dl/下载机器对应版本最新的goalng(如果无法下载多试几次,会解析到速度快的ip)

wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz

rm -rf /usr/local/go && tar -C /usr/local -xzf go*.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >>  ~/.profile
#检查
go version

#设置proxy
go env -w GOPROXY=https://goproxy.cn

2.安装DERP

go install tailscale.com/cmd/derper@main

安装supervisord并且编写配置 /etc/supervisord/supervisor.d/derp.ini

[program:derp]
command                 = /root/go/bin/derper --a :10008 -stun -stun-port 34780
directory               = /root
autorestart             = true
startsecs               = 3
stdout_logfile          = /var/log/derp.out.log
stderr_logfile          = /var/log/derp.err.log
stdout_logfile_maxbytes = 2MB
stderr_logfile_maxbytes = 2MB
user                    = root
priority                = 999
numprocs                = 1
process_name            = %(program_name)s_%(process_num)02d

配置反向代理、绑定域名且开放防火墙后,修改tailscale的ACL即可使用