sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

Sing-box TUN choosing wrong adapter to connect

Open somebodywashere opened this issue 1 year ago • 1 comments

Operating system

Windows

System version

10

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.

NekoRay fork v4.1.4 by Mahdi-zarei, this issue was always persisted even in older "original" versions

Version

No response

Description

Sing-box TUN decision on what adapter to chose to connect is based ONLY on interface metric rather than checking metric and if adapter has Connected state.

Screenshot3995

Here router will chose adapter at index 12 or 15 (just lowest metric), rather than 7 (lowest metric for adapter with Connected state).

Reproduction

Windows sometime choose strange metrics and this leads to that. You can tune metrics manually and test.

Logs

No response

Supporter

Integrity requirements

  • [X] 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.
  • [X] 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.
  • [X] 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.
  • [X] 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.

somebodywashere avatar Sep 13 '24 13:09 somebodywashere

Try https://github.com/SagerNet/sing-box/commit/b3eddc9e8ccaad99b2b701279f7f830eb5a38b4a

nekohasekai avatar Sep 14 '24 01:09 nekohasekai