Skip to content

使用 tun 的 system stack 时 safari 与 iOS 上使用 webkit 核的浏览器无法连接某些网站 #2741

Description

@poscat0x04

Operating system

iOS

System version

18.3.2

Installation type

sing-box for iOS Graphical Client

If you are using a graphical client, please provide the version of the client.

1.12-alpha.18

Description

在使用 tun 作为入站且使用 system stack 时 safari 与使用 webkit 核的 iOS Firefox, Chrome 无法连接某些网站(目前只观察到有 wiki.archlinux.org,但是不排除有其他网站)。当使用 mixedgvisor stack 时症状消失。而且无论是在手机端还是路由器上(sing-box 版本 1.12-alpha.16, linux 版本 6.12.18)运行 sing-box,都会导致流量经过 sing-box tun 接口的 safari 出现此问题。

此问题在 macos 下也可以复现,但是 macos 下 safari 不停 spam reload 有概率能成功连接(iPhone 上成功连接概率比较小)。比较诡异的是我尝试用 wireshark 抓 utun 上的包但是开开 wireshark 后症状就消失了。

Reproduction

最小可复现配置,在两个平台上均可以使用:

{
  "log": {
    "level": "debug",
    "timestamp": false
  },
  "dns": {
    "final": "223",
    "strategy": "ipv4_only",
    "servers": [
      {
        "type": "udp",
        "server": "223.5.5.5",
        "detour": "direct",
        "tag": "223"
      }
    ]
  },
  "inbounds": [
    {
      "type": "tun",
      "tag": "tun",
      "auto_route": true,
      "address": [
        "172.19.0.1/30",
        "fdfe:dcba:9876::1/126"
      ],
      "interface_name": "tun0",
      "mtu": 1500,
      "stack": "system"
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct"
    }
  ],
  "route": {
    "auto_detect_interface": true,
    "default_domain_resolver": "223",
    "final": "direct",
    "rules": [
      {
        "ip_cidr": [
          "172.19.0.2/32"
        ],
        "action": "hijack-dns"
      }
    ]
  }
}

启动 sing-box 后访问 https://wiki.archlinux.org

Logs

No significant log is seen, even with the debug level enabled.

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions