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

Should not add ipv6 route if ipv6 address didn't be set

Open Zxneric opened this issue 1 year ago • 3 comments

Operating system

Android

System version

Android 13

Installation type

Original sing-box Command Line

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

1.9.0-rc.1

Version

No response

Description

If user didn't specify ipv6 address for tun interface, auto route should not add route for it.

https://github.com/SagerNet/sing-box-for-android/blob/1a7b9dc6fd2e73337853b20397b8504e1daf874e/app/src/main/java/io/nekohasekai/sfa/bg/VPNService.kt#L90-L97

Reproduction

"inbounds": [
    {
      "auto_route": true,
      "interface_name": "singbox",
      "inet4_address": "172.119.0.1/30",
      "type": "tun",
      "strict_route": true,
      "stack": "gvisor",
      "sniff": true
    }
  ],

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.

Zxneric avatar Mar 24 '24 08:03 Zxneric

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar May 24 '24 01:05 github-actions[bot]

Any updates?

Zxneric avatar May 25 '24 14:05 Zxneric

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jul 25 '24 01:07 github-actions[bot]

The same thing happened to me (ios sing-box vt 1.10.6).

I did configure an ipv6 address for the inbound tun, however if my wan (wifi or carrier network) dosen't have a ipv6 address, ipv6 accsess will report no route to host error in log. (prefer_ipv4 dns rule won't help, since many apps don't retrieve their server ips through dns lookup, but fetching through app private api, or hardcoded a group of ips in app, and using ipv6 if the app found default route network interface configured with an ipv6 address)

"inbounds": [
  {
    "type": "tun",
    "tag": "tun",
    "address": [
      "172.18.0.1/30",
      "fdfe:dcba:9876::1/126"
    ],
    "mtu": 9000,
    "auto_route": true,
    "strict_route": true,
    "stack": "system",
    "sniff": true,
    "sniff_override_destination": false
  }
],

It will be convenient if introducing a field to tun inbound struct, something like ip_stack = [native, ipv4, ipv6, dual], with native, will depends on native wan has ipv4 or ipv6 or both.

tedli avatar Jan 17 '25 06:01 tedli