最后更新时间:2025年6月11日,Headscae版本:0.26.1
故障现象
客户端通告了192.168.124.0,设置了路由转发,其他设备也访问不了
拓扑图
客户端A通告路由,启动命令为:tailscale up --login-server=https://hs.bokro.cn --accept-routes=true --advertise-routes=192.168.124.0/24 --netfilter-mode=off
客户端B接收路由,启动命令为:tailscale up --login-server=https://hs.bokro.cn --accept-routes=true
检查服务端的节点及路由情况
2.1、使用命令headscale nodes list
查看节点情况,检查节点是否在线
2.2、如果在线,使用命令headscale nodes list-routes
查看路由情况,如下图可以看到我有3个设备通告了相同的路由(192.168.124.0/24)且无任何一条被启用
2.3、使用命令headscale nodes approve-routes --identifier <YOUR ROUTE ID> --routes <YOUR CIDR>
允许第几条路由通告
这里以ID 16
为例headscale nodes approve-routes --identifier 16 --routes 192.168.124.0/24
2.4、再次查看路由,可以看到已经上线
2.5、测试是否能够访问
结论
笔者在更新后headscale莫名其妙的这一组路由掉了,在排查完了derp状态、客户端网络情况后,在查看headscale路由的时候发现路由未通告...至此,启用后问题得以解决...........
相关链接
headscale搭建:https://bokro.cn/archives/docker-headscale
headscale magic dns配置:https://bokro.cn/archives/headscale-magic-dns-setting