有没有朋友在singbox1.12上,成功配置tailscale和tun翻墙代理的朋友,可以参考下配置文件吗?

因为想同时使用tailscale和翻墙代理,加上singbox刚刚从alpha迭代到了beta,所以升级到了1.12 beta试下(主要是linux server和android两个平台)。然后,加上tailscale endpoint也确实成功了,linux server上使用socket做本地代理还算正常,但是在Android上开启tun后翻墙的部分,dns总是失败(顺便一提,我在dns server里指定detour,总是会报panic错误,所以我把这部分删了,似乎8.8.8.8这些海外的dns都失效了,但是我又没在其他地方看到替代detour的字段设计,在rule里指定8.8.8.8走代理也没用)。有那位朋友成功过,可以参考下吗?如果没有的话,我就当作软件bug,等正式版出来再用了。

5 Likes

更新下自己的记录:

重新做了一些尝试发现:
对dns.servers,并非所有情况下指定"detour"都会出现panic错误,导致程序崩溃。而是仅对route.default_domain_resolver.server指定的dns server有这个问题,比如我指定default_domain_resolver为dns_proxy,则dns.servers里tag是dns_proxy的这个server,给了字段detour后会程序崩溃。

目前我将default_domain_resolver指定为local(意思是指定为本机dns,而我开启了dns-hijack,所以就是使用sing box作为解析。之前我错以为是使用本地resolv.conf里的地址,就没用)。然后在dns_proxy里指定了detour来代理8.8.8.8。目前,tailscale-endpoint和proxy都工作正常

1 Like

插眼蹲一下,虽然现在用不到这么新的版本

1 Like

主要是新版本加入了tailscale,我想用一下。不然我也是倾向于稳定的旧版本

1 Like

佬来个配置教程啊 ~

1 Like

新增的tailscale endpoint比较简单,默认配置就行,只是第一次用需要自己去log里找输出的login连接,在任意设备登录验证一下。

1 Like

收到,我去试试看,谢谢~

这有点难找啊 佬有啥技巧么?

我去,试了一天了,win和linux都成功了,就是android上不行,能连上tailscale.就是手机上连不上我的路由器,不知什么原因,能分享下config文件么?我用的是boxforroot.singbox是1.12beta3.

大佬佬使用android singbox的方式是什么?root了吗?

我这边的配置大体如下,tailscale主要作为Home selector里的一个出口,其他没有太多相关的。

{
  "outbounds": [
    {
      "tag": "Home",
      "type": "selector",
      "outbounds": [
        "direct_out",
        "wireguard-ep",
        "ts-ep"
      ]
    },
    {
      "tag": "Proxy",
      "type": "selector",
      "outbounds": [
        "FastNode",
        "direct_out"
      ]
    },
    {
      "tag": "Final",
      "type": "selector",
      "outbounds": [
        "direct_out",
        "FastNode"
      ]
    },
    {
      "tag": "FastNode",
      "type": "urltest",
      "url": "http://www.gstatic.com/generate_204",
      "interval": "3m",
      "outbounds": [
      ]
    }
  ],
  "endpoints": [
    {
      "type": "wireguard",
      "tag": "wireguard-ep"
    },
    {
      "type": "tailscale",
      "tag": "ts-ep",
      "auth_key": "",
      "hostname": "singbox-mobile",
      "udp_timeout": "5m"
    }
  ],
  "inbounds": [
    {
      "type": "mixed",
      "tag": "mixed-in",
      "listen": "0.0.0.0",
      "listen_port": 7890
    },
    {
      "type": "tun",
      "tag": "tun-in",
      "address": [
        "172.18.12.1/30"
      ],
      "auto_route": true,
      "strict_route": false,
      "stack": "mixed",
      "sniff": true,
      "route_exclude_address": [],
      "exclude_package": [
      ]
    }
  ],
  "log": {
    "level": "info",
    "timestamp": true
  },
  "route": {
    "default_domain_resolver": {
      "server": "local",
      "rewrite_ttl": 60
    },
    "auto_detect_interface": true,
    "rule_set": [
    ],
    "rules": [
      {
        "action": "sniff"
      },
      {
        "protocol": "dns",
        "action": "hijack-dns"
      },
      {
        "clash_mode": "direct",
        "outbound": "direct_out"
      },
      {
        "clash_mode": "global",
        "outbound": "Proxy"
      },
      {
        "domain_suffix": [
          "myhome.domain"
        ],
        "outbound": "Home"
      },
      {
        "protocol": "quic",
        "action": "reject"
      },
      {
        "inbound": "socks-in",
        "outbound": "Proxy"
      },
      {
        "ip_cidr": [
          "1.1.1.1",
          "8.8.8.8"
        ],
        "outbound": "Proxy"
      },
      {
        "ip_cidr": [
          "223.5.5.5",
          "223.6.6.6",
          "114.114.114.114",
          "119.29.29.29"
        ],
        "outbound": "direct_out"
      },
      {
        "ip_cidr": [
          "192.168.41.0/24"
        ],
        "outbound": "Home"
      },
      {
        "ip_is_private": true,
        "outbound": "direct_out"
      }
    ],
    "final": "Final",
    "find_process": true
  },
  "dns": {
    "independent_cache": true,
    "servers": [
      {
        "tag": "local",
        "type": "local"
      },
      {
        "type": "tailscale",
        "tag": "dns_ts",
        "endpoint": "ts-ep",
        "accept_default_resolvers": false
      },
      {
        "tag": "dns_proxy",
        "type": "udp",
        "server": "8.8.8.8",
        "detour": "Proxy"
      },
      {
        "tag": "dns_direct",
        "type": "udp",
        "server": "119.29.29.29"
      }
    ],
    "rules": [
      {
        "outbound": "any",
        "server": "dns_direct"
      },
      {
        "clash_mode": "direct",
        "server": "dns_direct"
      },
      {
        "clash_mode": "global",
        "server": "dns_proxy"
      }
    ],
    "final": "dns_proxy",
    "strategy": "ipv4_only"
  }
}

你是指tailscale的登录链接在log里比较难找吗?可以用一个简单点的配置,把日志级别改成info,这样日志少一些。在日志里找到地址,登录一次就好。之后换成比较日常的配置。

我没root,就是singbox github上给的安卓 release版本

好主意~谢谢大佬~~

我看了下你的config,请教两个问题。
1.
192.168.41.0/24 应该是家里的内网网段吧?你是在家里的nas上作了tailscale出口么?还是tailscale的网段?我的tailscale网段是100.0.0.0/8
2. myhome.domain对应的ip是什么?家里内网么?还是tailscake内网还是你家里有公网,用的公网?

192.168.41.0/24是我的内网网段,我的家里运行tailscale的nas在这个网段里。我nas上的tailscale作为router,advertise了这个网段。也就是说我在别的tailscale设备上可以通过tailscale的100地址和我自己的192.168.41.0/24都可以访问我家里的设备。

myhome.domain是我自己的域名,在公共dns上解析到了内网地址192.168.41/24那个网段(对外人来说没有实际作用,对我来说就是方便记忆,减少一些host配置,减少一些域名服务器上的配置问题)。我在能访问192.168.41/24的设备上,不用修改host也能访问我的设备。没有也无所谓的

另外,我没有用exit node,如果你说的出口是指这个的话

感谢,我先用singbox apk 试试看看,看看是什么问题

对了,顺便说一下, {
“outbound”: “any”,
“server”: “dns_direct”
},
这句在1.12已经移除了,其实可以去掉这句。

好的,多谢提醒