SagerNet / SagerNet/sing-box

network_strategy对UDP流量不生效

Open
#3,053 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
38.1k
Forks
4.6k
Avg merge
19d 15h
Merged PRs (30d)
1

Description

操作系统

iOS

系统版本

18.5

安装类型

sing-box for iOS 图形客户端程序

如果您使用图形客户端程序,请提供该程序版本。

1.11.4

版本

描述

当连接一个“不可上网”的WIFI时,network_strategy设置为fallback的预期行为是使用蜂窝网络,而实际行为是只有TCP流量生效,UDP流量依然是无法上网的状态

补充:直连和代理都存在上述问题

重现方式
{
  "dns": {
    "servers": [
      {
        "address": "tcp://119.28.28.28"
      }
    ],
    "strategy": "ipv4_only"
  },
  "inbounds": [
    {
      "type": "tun",
      "address": "172.19.0.1/30",
      "auto_route": true,
      "stack": "system"
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "network_strategy": "fallback"
    }
  ],
  "route": {
    "rules": [
      {
        "port": 53,
        "ip_cidr": "172.19.0.2",
        "action": "hijack-dns"
      }
    ],
    "auto_detect_interface": true
  }
}

保持蜂窝数据打开,并使WIFI断开互联网连接,使用DNS InspectorDeep DigAPP发起UDP类型的DNS查询和TCP类型的DNS查询

日志

支持我们
完整性要求
  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided minimal configuration on iOS 18.5 and sing-box 1.11.4, using an internet-disconnected Wi-Fi network and cellular data. Compare the TCP and UDP DNS queries described in the report, including both direct and proxied traffic. Done means UDP traffic follows network_strategy=fallback through the cellular network as TCP traffic does.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, ios
Domain
mobile-dev, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.