tailscale / tailscale-qpkg

Package Tailscale client in QPKG
MIT License
459 stars 38 forks source link

路由器已经部署了tailscale并通告了路由,威联通NAS再启动tailscale导致NAS失联 #140

Closed Seeagood closed 1 month ago

Seeagood commented 3 months ago

路由器是小米AX9000,路由器安装docker版tailscale,连接了自建headscale服务并通告路由192.168.31.0/24,威联通NAS固定IP; 威联通安装1.58.2版本tailscale,通过命令行启动tailscale up --login-server=https://headscale.xxx.com --accept-routes --accept-dns,此时表现为局域网无法访问NAS,但NAS无法访问任何外网,表现为NAS提示DNS解析异常,NAS暂时可以通过100.64.0.x的IP访问,等待一会后NAS彻底失联,表现为ping不通NAS固定IP,也无法从局域网访问5000端口,也无法通过100.64.0.x的IP访问; 尝试从headscale端移除NAS设备后也未恢复,尝试停止路由器的tailscale也未恢复; 目前人不在NAS旁,暂无法重启NAS,待后续重启NAS后继续反馈

Wiederholung commented 1 month ago

情况类似,在 QNAP NAS 与路由器处于同一子网 且 路由器开启通告子网路由 advertise-routes=192.168.31.0/24 时,开启 NAS 端 accept-routes 会出现问题(具体原因未知,猜测是 Tailscale 远端路由和 NAS 本地路由重叠造成冲突),尝试禁用 NAS 端 accept-routes

export PATH=$PATH:$(getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info)/.qpkg/Tailscale/
tailscale set --accept-routes=false
tailscale up

然而与你不同的是,我关闭路由器端 Tailscale 一段时间后,可以通过 Tailscale 或者局域网IP连接NAS。


Similarly, if the QNAP NAS is on the same subnet as the router and the router has enabled advertise subnet routes advertise-routes=192.168.31.0/24, there will be a problem if you enable accept-routes on the NAS side (the exact reason is not known, but we guess it is the conflict caused by overlapping of the Tailscale remote routes and the NAS local route). Try disabling accept-routes on the NAS side:

export PATH=$PATH:$(getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info)/.qpkg/Tailscale/
tailscale set --accept-routes=false
tailscale up

However, unlike your case, I can connect to the NAS via Tailscale or LAN IP after turning off Tailscale on the router side for a while.

Seeagood commented 1 month ago

后续重启了NAS,我先关闭了路由器上的docker版本的tailscale,此时表现一切正常,可以从局域网访问5000端口,也可以通过100.64.0.x的IP访问,感觉像是一个局域网内只能启动一个tailscale,后续我将NAS内的tailscale卸载了,此时一切正常,后续我尝试用NAS内的docker容器再次部署了tailscale,注意此时NAS内的tailscale不需要再次通告路由192.168.31.0/24,一切正常了

Seeagood commented 1 month ago

情况类似,在 QNAP NAS 与路由器处于同一子网 且 路由器开启通告子网路由 advertise-routes=192.168.31.0/24 时,开启 NAS 端 accept-routes 会出现问题(具体原因未知,猜测是 Tailscale 远端路由和 NAS 本地路由重叠造成冲突),尝试禁用 NAS 端 accept-routes

export PATH=$PATH:$(getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info)/.qpkg/Tailscale/
tailscale set --accept-routes=false
tailscale up

然而与你不同的是,我关闭路由器端 Tailscale 一段时间后,可以通过 Tailscale 或者局域网IP连接NAS。

Similarly, if the QNAP NAS is on the same subnet as the router and the router has enabled advertise subnet routes advertise-routes=192.168.31.0/24, there will be a problem if you enable accept-routes on the NAS side (the exact reason is not known, but we guess it is the conflict caused by overlapping of the Tailscale remote routes and the NAS local route). Try disabling accept-routes on the NAS side:同样,如果 QNAP NAS 与路由器位于同一子网,并且路由器已启用通告子网路由 advertise-routes=192.168.31.0/24 ,如果在NAS端启用accept-routes就会出现问题(具体原因尚不清楚,但猜测是Tailscale远程路由与NAS本地路由重叠导致的冲突)。尝试在 NAS 端禁用accept-routes

export PATH=$PATH:$(getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info)/.qpkg/Tailscale/
tailscale set --accept-routes=false
tailscale up

However, unlike your case, I can connect to the NAS via Tailscale or LAN IP after turning off Tailscale on the router side for a while.不过,与您的情况不同的是,在路由器端关闭 Tailscale 一段时间后,我可以通过 Tailscale 或 LAN IP 连接到 NAS。

你的猜测可能是对的,我目前的方法是NAS内不使用安装版本的tailscale而是通过NAS内的docker容器部署,这样相当于隔离了网络环境;我只是想要解决以前没有在NAS内部署tailscale会导致通过其他设备ping NAS的ip延迟较高(超过200ms),目前ping 100.64.0.x的延迟仅为30ms,对于下载上传的速度影响并不大

Seeagood commented 1 month ago

你可以仅在局域网内保留NAS内安装的tailscale并且停用路由器上的tailscale,可以确保一切正常^_^