Feature Request: Support a configurable Wintun adapter GUID on Windows
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- networking
Direzione di ricerca
Start with the TUN inbound options in sing-box, then find where the Windows adapter GUID is derived via generateGUIDByDeviceName in the sing-tun Windows implementation. The change spans both repositories: add an optional GUID option to sing-tun, then pass a wintun_guid field from sing-box through to it. Done means a supplied GUID is used for both opening and creating the adapter, omitted values keep the current behavior, and other platforms ignore the field. Confirm the design with a maintainer before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Currently, sing-box does not expose an option to configure the GUID of its Wintun adapter.
The adapter identity is managed internally by the underlying "sing-tun" implementation, which derives a deterministic GUID from the device name.
I propose adding an optional "wintun_guid" configuration field to the TUN inbound, allowing users to explicitly specify the Wintun adapter GUID on Windows.
This would provide greater control over adapter identity without changing the existing default behavior.
Proposed Configuration
{
"type": "tun",
"tag": "tun-in",
"interface_name": "sing-box",
"wintun_guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"address": [
"172.19.0.1/30"
]
}
The "wintun_guid" field would be optional.
- If specified, sing-box passes the GUID to the underlying "sing-tun" implementation.
- If omitted, the existing GUID generation mechanism remains unchanged.
- On non-Windows platforms, the field has no effect.
Motivation
There are use cases where applications need to coordinate TUN adapter identity across multiple network engines or configurations.
For example:
- Multiple network engines sharing a consistent Wintun adapter identity.
- Host applications managing TUN device lifecycle independently of the network engine.
- Maintaining adapter identity independently of interface display names.
- Integrations requiring predictable Windows adapter identification.
Windows interface names and adapter GUIDs represent different aspects of adapter identity. Exposing an optional GUID would allow applications to manage these independently.
Proposed Implementation
The implementation would involve two components:
- sing-tun
Add an optional "GUID" field to the TUN options.
The Windows implementation should:
- Use the explicitly supplied GUID when present.
- Preserve the existing "generateGUIDByDeviceName" behavior when omitted.
- Leave other platform implementations unaffected.
- sing-box
Expose an optional "wintun_guid" field in the TUN inbound configuration.
Pass the configured value through the platform-specific TUN configuration into "sing-tun".
Backward Compatibility
This feature would be fully backward-compatible.
Existing configurations would continue using the current device-name-based GUID generation mechanism.
No changes would be required for users who do not need explicit adapter identity management.
Platform Support
This option would only apply to Windows and Wintun.
Other platforms should ignore the field or leave it unused.
Additional Considerations
- Validate the supplied value as a canonical UUID.
- Ensure the same GUID is used for both opening and creating the adapter.
- Document that explicitly assigned GUIDs should not conflict with unrelated Wintun adapters.
- Keep the current automatic GUID generation as the default.
Question
Would maintainers consider exposing an optional "wintun_guid" field for Windows TUN inbounds?
I would be happy to contribute the implementation, including the corresponding changes in "sing-tun" if needed.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SagerNet/sing-box
-
`check` and startup are quadratic in outbound group size since 1.14.4 (duplicate tag check)Forse già presa @Tidehyc l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
database file removal errorsAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
Tutte le issue di SagerNet/sing-box
Issue simili
-
good first issue tools
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Edwin-metcalf/MetCode#76 ·
I maintainer di solito rispondono entro 1 giorno
-
-diff's removed-name budget ignores the names the -ptr pass testedForse già presa @nova-loop l’ha presa oggi. Apertaarea: cli bug good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TMHSDigital/subenum#495 ·
I maintainer di solito rispondono entro 1 giorno
-
bug effort:s impact:med raised-by:worker risk:low to:worker
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
medici-finance/assay#8120 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
factory:subtask
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
reportedBy/community
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
openchoreo/openchoreo#5751 ·
I maintainer di solito rispondono entro 1 giorno