记一次群晖drive穿透故障
简要记录一下,避免遗忘
群晖网盘synology drive在windows上的客户端不能通过http(s)协议直接连接,必须通过tcp://xxxx:6690连接。
为了能从内外网都访问synology drive,通过cloudflare的tunnel(zero trust)进行穿透,共几步
在cf上打开ZeroTrust
-
在zerotrust的
网络>Tunnels
中创建隧道,并在服务端(openwrt)上安装连接器image -
继续切换到
公共主机名
tab,添加公共主机名,这里注意:每添加一个,就会自动生成一个dns的记录,本次突然隧道连接不上了,就是因为把自动生成的dns给删了,客户端连接的时候报:"error":"websocket: bad handshake"
image如果真的删了,就把公共主机的条目删掉重建一下,应该也是可以再生成Dns记录的
image -
客户端下载cloudflared并运行,我是安装成了windows service:
sc create CloudflaredProxy binPath= \""D:\app\cloudflared\cloudflared.exe\" access tcp --hostname pan.xxx.site --url tcp://localhost:6690 --log-directory D:\app\cloudflared --logfile cloudflared.log" start= auto displayname= "Cloudflared TCP tunnel" sc description CloudflaredProxy "此服务用于通过 Cloudflare 用于群晖Drive(6690)和ssh(2200)"