最近在尝试使用 Tailscale ,使用体验非常美好,但我在墙内又养成了一直挂着 clash 的习惯,所以就出现了一个很痛苦的问题:Tailscale 和 clash 冲突了。
网上(包括 v2 )看了很多,大多都是说用 tailscale 的 exit node 模式,但我的设备(家里)只有一台 root 的安卓、一台 Ubuntu Server 配 clash-docker ,一台 windows ,我尝试去设置 Ubuntu 为 exit-node ,但照样不能如愿,不知道具体怎么设置。( Ubuntu 是 ping 不通 google 的)
于是我就想能不能从问题源头安卓手机这下手,还真给我搜到了个 Magisk-Tailscaled,用 KernelSU 安装模块之后,按照步骤,在 Tailscale 管理界面确实能看见设备连接上了,但没办法直接通过类似 http://100.x.y.z:8080
访问其他设备的服务。翻遍项目的 issues ,得知如果要用的话得配置 sock5 代理,然后通过 clash 这种代理软件进行分流。
问题就出在这了,我配置了之后甚至成功过一次,但重启后就失效了……
以下是我在手机终端的操作:
tailscaled -tun=userspace-networking -statedir=/data/adb/tailscale/tmp/ -state=/data/adb/tailscale/tmp/tailscaled.state -socket=/data/adb/tailscale/tmp/tailscaled.sock -port=41641 -socks5-server=localhost:41099
后面这段 -socks5-server=localhost:41099
是我从一篇博客得知的,也即我的 socks5 端口设为 41099 。
tailscaled.service start
tailscale login
以下是 clash 配置文件:
dns:
...
nameserver-policy:
"*.tailscale.io": 8.8.8.8
proxies:
- { name: tailscale, type: socks5, server: 127.0.0.1, port: 41099}
...
rules:
...
- 'IP-CIDR,100.64.0.0/10,tailscale,no-resolve'
- 'DOMAIN-SUFFIX,tailscale.com,DIRECT'
- 'DOMAIN-SUFFIX,tailscale.io,DIRECT'
按照上面流程下来是成功过一次,但重启之后怎么都成功不了。
按照上面的步骤又来了一遍,发现运行是正常的,只不过每次重启手机之后就得从头打一遍命令,应该是可以写个 shell 脚本简化操作的。 但体验下来,感觉用户层的 tailscale 不太行,原本用官方 APP 能 IPv6 直连的,而用 magisk-tailscaled 只能走中转。 遂放弃使用 magisk-tailscaled,打算尝试常用的 exit-node 模式。
1
shoper 41 天前 1
没太明白,OP 都 tailscale 回家了,为啥手机上还要开 clash ?
|
3
standin000 41 天前
ubuntu 不是更强大,做个代理很方便
|
4
Ploter OP @standin000 能给点关键词我搜搜吗
我在 .bashrc 设置 http_proxy 没用 |
5
Ploter OP @standin000 你的意思难道是做个 SS 服务器,然后直接通过 clash 回家吗
|
6
ovoo 41 天前 via Android 1
如果自建梯子:
在梯子上安装 tailscale , clash 配置 100.64.0.0/10 走这个梯子就行了 |
7
ovoo 41 天前 via Android
或者反过来,
Ubuntu 上安装运行 clash ,以及 tailscale 设置为 exit node 安卓端 use exit node 指定为 ubuntu |
8
Ploter OP @ovoo 刚参照这篇[博客]( https://zhichao.org/posts/c4fc1f)在 ubuntu 上安装 clash 并设置为 tun 透明代理,但 `ping google.com` 时显示如下:
``` krdw@thinkpad:~$ ping google.com PING google.com (198.18.0.6) 56(84) bytes of data. ^C ``` |
9
Puteulanus 40 天前
Ubuntu Server 或者 Windows 上能跑虚拟机吗,给个 512M 内存跑个 openwrt ,把 openclash 和 tailscale 都挂上,设成 exit node ,还能给家里的设备当旁路由
|
11
ovoo 40 天前
@Ploter 如果 clash 里要使用 MagicDNS :
配置文件添加: search-domains: [local, 此处添加你的 Tailnet name: xxxx.ts.net ] # A/AAAA 记录的搜索域 nameserver-policy: "+.ts.net": "100.100.100.100" 可以实现浏览器里通过主机名访问服务 |