tailscale 回家速度不理想,求教

2023-05-25 10:53:44 +08:00
 gearfox
电信 300M 宽带有公网 ip ,千兆光猫设置了桥接,主路由硬件 RouterOS 设备负责拨号,副路由 Openwrt 上安装有 tailscale
拓扑为 华为光猫---RB760---Openwrt
最早在 RouterOS 配置了 NAT1 给 openwrt ,tailscale 的速度还凑活吧,现在关闭了 NAT1 ,tailscale 的速度就很慢了,但是凑活将就能用,网上说可通过自建 derper 的方式提速,但是我在阿里轻量云上安装并配置了 derper ,测试无法使用,下面我发出来步骤,请大家排查一下问题,谢谢了。

[安装 derper ]
wget --no-check-certificate https://go.dev/dl/go1.20.4.linux-amd64.tar.gz
tar -xzf go1.20.4.linux-amd64.tar.gz -C /usr/local
echo 'export GOROOT=/usr/local/go' | tee -a /etc/profile
echo 'export GOPATH=/usr/local/gopath' | tee -a /etc/profile
echo 'export GOBIN=$GOPATH/bin' | tee -a /etc/profile
echo 'export PATH=$PATH:$GOROOT/bin' | tee -a /etc/profile
echo 'export PATH=$PATH:$GOPATH/bin' | tee -a /etc/profile
source /etc/profile
go version
go env -w GOPROXY=https://goproxy.cn,direct
go install tailscale.com/cmd/derper@main

[阿里云申请 1 年免费证书并上传到 /home/admin/certs ]
浏览器 https 方式打开 deeper 页面也正常

[ aliyun 上关闭了防火墙和系统内置的 firewalld ]

[启动服务如下]
tee /etc/systemd/system/derper.service <<'EOF'
[Unit]
Description=Tailscale DERP Server
Requires=tailscaled.service
After=tailscaled.service

[Service]
Type=simple
User=root
Restart=always
RestartSec=5
ExecStart=/usr/local/gopath/bin/derper -c=/root/derper.conf --hostname=aliyun.111.com --verify-clients -a=:7777 -stun-port=8888 -http-port=-1 -certdir=/home/admin/certs/ -certmode=manual

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload && systemctl enable --now derper && systemctl status derper

[官方页面里配置 ACL 规则]
"derpMap": {
"OmitDefaultRegions": false,
"Regions": {
"900": {
"RegionID": 900,
"RegionCode": "aliyunderp",
"Nodes": [
{
"Name": "1",
"RegionID": 900,
"HostName": "aliyun.111.com",
"STUNPort": 7777,
"DERPPort": 8888,
},
],
},
},
},

[安装验证服务]
dnf config-manager --add-repo https://pkgs.tailscale.com/stable/centos/9/tailscale.repo
dnf install tailscale -y
systemctl enable --now tailscaled
tailscale up

测试时就有问题了,tailscale status 也显示无法连接到自建 derper 上
提示# Health check:
# - not connected to home DERP region 900

或者显示连接上了,使用命令 tailscale ping 不通 openwrt 和其他安装 tailscale 的设备,好奇怪,请有经验的各位大大指点指点,谢谢大家
6917 次点击
所在节点    宽带症候群
51 条回复
sansam
2023-05-25 15:02:01 +08:00
@bt7vip 上 headscale ,所有节点(网络) mesh 互联互通,非常好使。
neroxps
2023-05-25 15:13:24 +08:00
tailscale 太重了,单节点的话直接拉个 wg-easy 容器就完事。
neroxps
2023-05-25 15:14:00 +08:00
另 routeros 也有 wg 直接 wg 即可。
gearfox
2023-05-25 15:21:54 +08:00
@neroxps 好的
gearfox
2023-05-25 15:22:37 +08:00
@JayZXu 好的好的,自己一直不习惯用 docker ,就手工了
Sekai
2023-05-25 15:43:36 +08:00
好像你把 ACL 里的两个端口搞颠倒了?
xhcnb
2023-05-25 15:46:51 +08:00
都有公网地址了, 直接 ikev2/ipsec vpn 回去不香吗, 系统自带协议支持, 不用什么客户端
如果觉得 udp 被 qos, 就使用 tinc, 走 tcp 通道, 支持 ddns
gps949
2023-05-25 16:29:53 +08:00
端口写反了吧?
bt7vip
2023-05-25 17:02:58 +08:00
@sansam headscale 不是控制器吗,在 icloudnative.io 上看了教程,套来套去的,不敢上的主要原因是异地,挂了就要跑过去🌚🌚🌚
thereone
2023-05-25 17:41:49 +08:00
直接用 softether 就行,这个管理方便 v4 v6 都支持也随时都能切换成 tcp 或者 udp 。最主要的是全图形化界面配置非常方便
thereone
2023-05-25 17:44:42 +08:00
@bt7vip 用 softether 在每一个路由器上面新建一个桥接网卡,然后配置上 3 层地址写个静态路由。不要太简单
bt7vip
2023-05-25 18:15:30 +08:00
@thereone 好的,我试试
superchijinpeng
2023-05-25 18:37:41 +08:00
看了下延迟还是很低的

* MappingVariesByDestIP: false
* HairPinning: false
* PortMapping:
* CaptivePortal: false
* Nearest DERP: Shanghai
* DERP latency:
- sh: 20.5ms (Shanghai)
- tok: 76.6ms (Tokyo)
- hkg: 125.2ms (Hong Kong)
- sin: 140.5ms (Singapore)
- blr: 164.6ms (Bangalore)
- sfo: 169.3ms (San Francisco)
- sea: 193.8ms (Seattle)
- den: 213ms (Denver)
- dfw: 217.5ms (Dallas)
- hnl: 222.3ms (Honolulu)
- ord: 225.8ms (Chicago)
- lhr: 234.8ms (London)
- fra: 238.2ms (Frankfurt)
- lax: 238.4ms (Los Angeles)
- ams: 241.2ms (Amsterdam)
- nyc: 242.7ms (New York City)
- par: 242.8ms (Paris)
- waw: 245.2ms (Warsaw)
- mia: 248ms (Miami)
- tor: 252.2ms (Toronto)
- mad: 264.8ms (Madrid)
- dbi: 346.6ms (Dubai)
- jnb: 352.5ms (Johannesburg)
- sao: 391ms (São Paulo)
- syd: 490.1ms (Sydney)
Zerolouis
2023-05-26 02:17:51 +08:00
@bt7vip 多个局域网只要每个局域网的路由器加入 wireguard 的虚拟局域网,开启转发或者直接将 wireguard 的局域网划入 LAN 的防火墙规则就可以访问每个网段了
如果每个局域网都有公网可以配置全互连,没有的话就让有公网的节点做转发
我目前就是这么配置的,家和学校 OpenWrt ,配置一个虚拟局域网,三个网段所有设备可以互联
dangyuluo
2023-05-26 02:46:56 +08:00
tailscale 居然有国内的服务器?震惊
gearfox
2023-05-26 08:58:44 +08:00
@Sekai 是的是的,才发现写反了,大意了,改了后试了下。互相还是 ping 不通
gearfox
2023-05-26 08:59:49 +08:00
@xhcnb 家里有 l2tp 可以连,就是折腾了一下这个玩呢
gearfox
2023-05-26 09:00:20 +08:00
@gps949 是的是的。大意了
Sekai
2023-05-26 10:03:19 +08:00
@gearfox 那就比较诡异了,可能运行命令写的有点问题,实在想弄可以闲鱼搜 tailscale 找到我,位置 sh 头像是柊镜
aaronkk
2023-05-26 11:07:26 +08:00
在 derper 节点也安装 tailscale 客户端,注册进去就可以了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/942796

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX