Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applications added to "include_package" lose network connection (Tun) #2617

Open
4 of 5 tasks
Victor0543 opened this issue Feb 21, 2025 · 2 comments
Open
4 of 5 tasks

Comments

@Victor0543
Copy link

Victor0543 commented Feb 21, 2025

Operating system

Android

System version

Android 12

Installation type

sing-box for Android Graphical Client

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

1.11.3

Version

Description

When I'm adding the include_package section to the Tun inbound, any application added to this section loses network connectivity. Ping seem to work, but TCP connections cannot be established.

If the include_package section is removed, network connectivity returns to the said application.

I was able to reproduce this issue on two different phones (Android 12 and 15 13) with two different Sing-box versions (1.11.3 and 1.12.0-alpha.9).

Reproduction

  1. Install Termux and install curl (pkg update && pkg install curl) (optional) or have Google Chrome installed.
  2. Add the following configuration profile to Sing-box:
{
  "log": {
    "level": "debug"
  },
  "dns": {
    "servers": [
      {
        "address": "local"
      }
    ]
  },
  "inbounds": [
    {
      "type": "tun",
      "tag": "tun-in",
      "address": "172.19.0.1/30",
      "auto_route": true,
      "strict_route": false,
      "include_package": [
        "com.termux",
        "com.android.chrome"
      ]
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct"
    }
  ],
  "route": {
    "rules": [
      {
        "inbound": "tun-in",
        "action": "sniff"
      },
      {
        "protocol": "dns",
        "action": "hijack-dns"
      }
    ],
    "final": "direct",
    "auto_detect_interface": true,
    "override_android_vpn": true
  }
}
  1. Activate the profile.

  2. In Termux execute curl https://ipinfo.io/ip - the command will result in timeout. Without Termux you can try opening the same URL in Google Chrome .

    To verify that this issue is not related to DNS, you can try accessing your router by IP address.

  3. Comment the line "com.termux", (or "com.android.chrome" + preceding comma) in the configuration profile.

  4. Reconnect the profile.

  5. Repeat step 4. This time you should see your IP address in Termux or Google Chrome, which will indicate successful connection.

It should be noted that if the option include_package removed altogether, connection in Termux and Google Chrome also starts working normally.

Logs

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.
@nekohasekai
Copy link
Member

Can't reproduce, maybe it's a device-specific problem.

@Victor0543
Copy link
Author

I wasn't able to reproduce it through Android emulator in Android Studio, so it's probably indeed device-specific.

The problem is reproducible on the following devices:

  • Google Pixel 3a (Android 12L)
  • Xiaomi Mi A1 (Android 13, LineageOS 20)

I originally mentioned Android 15, but this was a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants