Windows TUN with auto_route can leave public IPv4 traffic on Ethernet

Aperta
#4,747 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

Start by reading the Windows TUN auto_route handling and route selection code, then reproduce the report with the provided standalone configuration and Find-NetRoute query. Compare the selected interface with and without the two /1 route_address entries; done means public IPv4 traffic selects the TUN interface on the affected setup or the limitation and its cause are identified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Operating system

Windows

System version

Windows edition, version, and OS build from winver

Installation type

Third-party graphical clients that advertise themselves as using sing-box (Windows)

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

UAC Spoofer Desktop 1.1.3 (Windows x64)

Version
sing-box version 1.13.14
Environment: go1.26.4 windows/amd64
Revision: 25a600db24f7680ad9806ce5427bd0ab8afe1114
Description

On the affected Windows machine, TUN started with auto_route: true and strict_route: true. While the client showed TUN as connected, Find-NetRoute -RemoteIPAddress 142.251.155.4 selected Ethernet via 0.0.0.0/0, with RouteMetric: 0 and Protocol: NetMgmt. With the system proxy bypassed, the YouTube request was reset during the TLS handshake.

Expected behavior: Windows selects the TUN interface for public IPv4 traffic covered by auto_route.

Workaround: We set the TUN's IPv4 route_address entries to 0.0.0.0/1 and 128.0.0.0/1 and kept route.auto_detect_interface enabled. The affected user confirmed that YouTube loaded after this change.

Could sing-box offer split IPv4 default routes for Windows systems where the physical adapter's /0 wins? This resembles #4666 at the route-selection level. Whether it has the same underlying cause is unknown.

Reproduction

The issue was observed in the desktop client. The following standalone configuration passed sing-box check. Runtime reproduction with the standalone CLI is pending.

{
  "log": { "level": "debug" },
  "inbounds": [
    {
      "type": "tun",
      "interface_name": "singbox-repro",
      "address": ["172.20.0.1/30"],
      "auto_route": true,
      "strict_route": true,
      "stack": "mixed"
    }
  ],
  "outbounds": [{ "type": "direct", "tag": "direct" }],
  "route": { "auto_detect_interface": true, "final": "direct" }
}

1-On the affected machine, close the desktop client and run sing-box run -c config.json as Administrator.
2-While TUN is active, run Find-NetRoute -RemoteIPAddress 142.251.155.4 and record the selected interface and prefix.
3-Stop sing-box, add "route_address": ["0.0.0.0/1", "128.0.0.0/1"] to the TUN inbound, and repeat the route query.
4-Record whether the selected interface changes from Ethernet to singbox-repro.

Logs
InterfaceAlias    : Ethernet
DestinationPrefix : 0.0.0.0/0
RouteMetric       : 0
Protocol          : NetMgmt
curl: (35) Recv failure: Connection was reset
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.
Lingua principale
Go
Stelle
40.4k
Fork
5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SagerNet/sing-box

Tutte le issue di SagerNet/sing-box

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.